From 51c66a5976923195e3975e48b909cbafcf95c72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Wed, 19 Jul 2017 17:40:47 +0800 Subject: [PATCH 001/646] =?UTF-8?q?Init=20types=20for=20wx=EF=BC=88?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=EF=BC=89js=20sdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/wx-js-sdk/index.d.ts | 473 +++++++++++++++++++++++++++++ types/wx-js-sdk/tsconfig.json | 22 ++ types/wx-js-sdk/tslint.json | 1 + types/wx-js-sdk/wx-js-sdk-tests.ts | 0 4 files changed, 496 insertions(+) create mode 100644 types/wx-js-sdk/index.d.ts create mode 100644 types/wx-js-sdk/tsconfig.json create mode 100644 types/wx-js-sdk/tslint.json create mode 100644 types/wx-js-sdk/wx-js-sdk-tests.ts diff --git a/types/wx-js-sdk/index.d.ts b/types/wx-js-sdk/index.d.ts new file mode 100644 index 0000000000..e11f835bd4 --- /dev/null +++ b/types/wx-js-sdk/index.d.ts @@ -0,0 +1,473 @@ + +export namespace wx { + + export interface wxconfig { + debug: boolean; // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 + appId: string; //公众号的唯一标识 + timestamp: number; //签名的时间戳 + nonceStr: string; //签名的随机串 + signature: string; //签名 + jsApiList: string[] //需要使用的JS接口列表 + } + + /** + * 通过config接口注入权限验证配置 + * @param setting 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 + * jsApiList[] 需要使用的JS接口列表 + */ + export const config: (setting: wxconfig) => void + + /** + * config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。 + * @param x + */ + export const ready: (x: () => void ) => void; + + /** + * config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 + */ + export const error: (err: (res: any) => void) => void + + + /** + * 判断当前客户端版本是否支持指定JS接口,checkJsApi接口是客户端6.0.2新引入的一个预留接口,第一期开放的接口均可不使用checkJsApi来检测 + */ + export interface checkApiConfig { + jsApiList: string[]; //需要检测的JS接口列表 + + // 以键值对的形式返回,可用的api值true,不可用为false + // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"} + success: (res: {checkResult: {[methodName: string]: boolean}, errMsg: {msg: string}}) => void + } + + /** + * 判断当前客户端版本是否支持指定JS接口 + * @param setting + */ + export const checkJsApi: (setting: checkApiConfig) => void + + export interface shareTimelineConfig { + title: string; // 分享标题 + link: string; // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: string; // 分享图标 + success: () => void; + cancel: () => void + } + + /** + * 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 + * + * @param setting itle分享标题 ,link分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, imgUrl分享图标, success用户确认分享后执行的回调函数 + */ + export const onMenuShareTimeline: (setting: shareTimelineConfig) => void + + + export interface shareAppMessage extends shareTimelineConfig { + desc: string; // 分享描述 + type?: string; // 分享类型,music、video或link,不填默认为link + dataUrl?: string; // 如果type是music或video,则要提供数据链接,默认为空 + } + + /** + * 获取“分享给朋友”按钮点击状态及自定义分享内容接口 + * @param setting title 标题,desc 分享描述,link 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, imgUrl 分享图标,type 分享类型,music、video或link,不填默认为link + * dataUrl如果type是music或video,则要提供数据链接,默认为空, success 用户确认分享后执行的回调函数, cancel 用户取消分享后执行的回调函数 + */ + export const onMenuShareAppMessage: (setting: shareAppMessage) => void + + export interface menuShareQQ extends shareTimelineConfig { + desc: string; // 分享描述 + } + + /** + * “分享到QQ”按钮点击状态及自定义分享内容接口 + */ + export const onMenuShareQQ: (config: menuShareQQ) => void + + + export interface menuShareWeibo extends shareTimelineConfig { + desc: string; // 分享描述 + } + + /** + * 获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 + */ + export const onMenuShareWeibo: (config: menuShareWeibo) => void + + + export interface menuShareQZone extends menuShareWeibo { + } + + /** + * 获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 + */ + export const onMenuShareQzone: (config: menuShareQZone) => void + + /** + * count默认9, sizeType指定是原图还是压缩图,默认二者都有,sourceType 可以指定来源是相册还是相机,默认二者都有 + * var localIds = res.localIds; 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 + */ + export interface chooseImageConfig { + count: number; // 默认9 + sizeType: string[]; // 可以指定是原图还是压缩图,默认二者都有 + sourceType: string[]; // 可以指定来源是相册还是相机,默认二者都有 + success: (res: any) => void // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 + } + + /** + * 拍照或从手机相册中选图接口 + */ + export const chooseImage: (config: chooseImageConfig) => void + + /** + * current:当前显示图片的http链接, urls:需要预览的图片http链接列表 + */ + export interface previewImageConfig { + current: string; // 当前显示图片的http链接 + urls: string[]; // 需要预览的图片http链接列表 + } + + /** + *  预览图片接口 + * @param config + */ + export const previewImage: (config: previewImageConfig) => void + + /** + * localId:要上传的图片的本地ID,由chooseImage接口获得 + * isShowProgressTips:默认为1,显示进度提示 + * res: var serverId = res.serverId; 返回图片的服务器端ID + */ + export interface uploadImageConfig { + localId: string; + isShowProgressTips?: number; + success: (res: any) => void + } + + export const uploadImage: (config: uploadImageConfig) => void + + /** + * serverId:需要下载的图片的服务器端ID,由uploadImage接口获得 + * res: var localId = res.localId; 返回图片下载后的本地ID + */ + export interface downLoadImageConfig { + serverId: string; + isShowProgressTips?: number; + success: (res: any) => void + } + + export const downLoadImage: (config: downLoadImageConfig) => void + + /** + * locallId: 图片的localID + */ + export interface getLocalImgDataConfig { + localId: string; + success: (res: any) => void + } + + /** + * 获取本地图片接口,此接口仅在 iOS WKWebview 下提供,用于兼容 iOS WKWebview 不支持 localId 直接显示图片的问题 + */ + export const getLocalImgData: (config: getLocalImgDataConfig) => void + + /** + * 开始录音 + */ + export const startRecord: () => void + + /** + * 停止录音 + * res: var localId = res.localId; + */ + export const stopRecord: (success: (res: any) => void) => void + + /** + * 录音时间超过一分钟没有停止的时候会执行 complete 回调 + * @param complete :var localId = res.localId; + */ + export const onVoiceRecordEnd: (complete: (res: any) => void) => void + + /** + * 需要播放的音频的本地ID,由stopRecord接口获得 + * @param localId + */ + export const playVoice: (localId: string) => void + + /** + * 需要暂停的音频的本地ID,由stopRecord接口获得 + */ + export const pauseVoice: (localId: string) => void + + /** + * 需要停止的音频的本地ID,由stopRecord接口获得 + */ + export const stopVoice: (localId: string) => void + + /** + * res: var localId = res.localId; 返回音频的本地ID + */ + export const onVoicePlayEnd: (success: (res: any) => void) => void + + interface uploadVoiceConfig { + localId: string; + isShowProgressTips?: number; + success: (res: any) => void + } + + /** + * 上传语音接口,上传语音有效期3天,可用微信多媒体接口下载语音到自己的服务器, + * 此处获得的 serverId 即 media_id,参考文档 .目前多媒体文件下载接口的频率限制为10000次/天,如需要调高频率,请登录微信公众平台,在开发 - 接口权限的列表中,申请提高临时上限。 + * @param config res: var serverId = res.serverId; 返回音频的服务器端ID + */ + export const uploadVoice: (config: uploadVoiceConfig) => void + + /** + * serverId:需要下载的音频的服务器端ID,由uploadVoice接口获得 + * isShowProgressTips: 默认为1,显示进度提示 + */ + export interface downloadVoiceConfig { + serverId: string; + isShowProgressTips?: number; + success: (res: any) => void + } + + export const downloadVoice: (config: downloadVoiceConfig) => void + + /** + * success: res.translateResult,语音识别的结果 + */ + export interface translateVoiceConfig extends uploadVoiceConfig { + } + + /** + * 识别音频并返回识别结果接口 + * @param config + */ + export const translateVoice: (config: translateVoiceConfig) => void + + /** + * 获取网络状态, var networkType = res.networkType; // 返回网络类型2g,3g,4g,wifi + */ + export const getNetworkType: (success: (res: any) => void) => void + + interface openLocationConfig { + latitude: number; + longitude: number; + name: string; // 位置名 + address: string; // 地址详情说明 + scale: number; // 地图缩放级别,整形值,范围从1~28。默认为最大 + infoUrl: string; // 在查看位置界面底部显示的超链接,可点击跳转 + } + + /** + * 微信内置地图查看位置接口 + * @param config name:位置名,scale:地图缩放级别,整形值,范围从1~28。默认为最大 + * infoUrl: 在查看位置界面底部显示的超链接,可点击跳转 + */ + export const openLocation: (config: openLocationConfig) => void + + export interface Location { + latitude: number; + longitude: number; + speed: number; // 速度,以米/每秒计 + accuracy: number; // 位置精度 + } + + export interface getLocationConfig { + type: string //默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' + success: (res: Location) => void + } + + /** + * 获取地理位置接口 + * @param config + */ + export const getLocation: (config: getLocationConfig) => void + + + /** + * ticket:摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面 + * + */ + export interface startSearchBeaconsConfig { + ticket: string; + complete: (argv: any) => void + } + + /** + * 开启查找周边ibeacon设备接口 + * @param config + */ + export const startSearchBeacons: (config: startSearchBeaconsConfig) => void + + + export interface stopSearchBeaconsConfig { + complete: (res: any) => void + } + /** + * 关闭查找完成后的回调函数 + */ + export const stopSearchBeacons: (config: stopSearchBeaconsConfig) => void + + + export interface onSearchBeaconsConfig { + complete: (argv: any) => void + } + /** + * 监听周边ibeacon设备接口, + * 摇一摇周边接口使用注意事项及更多返回结果说明,请参考:摇一摇周边获取设备信息 + */ + export const onSearchBeacons: (config: onSearchBeaconsConfig) => void + + /** + * 关闭当前网页窗口接口 + */ + export const closeWindow: () => void + + + export interface menuItemsConfig { + menuList: string[] // 要隐藏/显示的菜单项,只能隐藏“传播类”和“保护类”按钮 + } + + /** + * 批量隐藏功能按钮接口 + */ + export const hideMenuItems: (config: menuItemsConfig) => void + + /** + * 批量显示功能按钮接口 + */ + export const showMenuItems: (config: menuItemsConfig) => void + + /** + * 隐藏所有非基础按钮接口 + */ + export const hideAllNonBaseMenuItem: () => void + + /** + * 显示所有功能按钮接口 + */ + export const showAllNonBaseMenuItem: () => void + + /** + * needResult: 默认为0,扫描结果由微信处理,1则直接返回扫描结果, + * scanType:["qrCode","barCode"],可以指定扫二维码还是一维码,默认二者都有 + * success: var result = res.resultStr; 当needResult 为 1 时,扫码返回的结果 + */ + export interface scanQRCodeConfig { + needResult?: number; + scanType?: string[]; + success: (res: any) => void + } + + /** + * 调起微信扫一扫接口 + */ + export const scanQRCode: (config: scanQRCodeConfig) => void + + /** + * productId:商品id + * viewType: 0.默认值,普通商品详情页1.扫一扫商品详情页2.小店商品详情页 + */ + export interface openProductSpecificViewConfig { + productId: string; + viewType?: string; + } + + /** + * 跳转微信商品页接口 + * @param config + */ + export const openProductSpecificView: (config: openProductSpecificViewConfig) => void + + + /** + * shopId: 门店Id + * cardType:卡券类型 + * cardId:卡券Id + * timestamp:卡券签名时间戳 + * nonceStr:卡券签名随机串 + * signtype:签名方式,默认'SHA1' + * cardsign:卡券签名 + * success: var cardList= res.cardList; 用户选中的卡券列表信息 + */ + export interface chooseCardConfig { + shopId?: string; + cardType?: string; + cardId?: string; + timestamp: number; + nonceStr: string; + signType: string; + cardSign: string; + success: (res: any) => void + } + + /** + * 拉取适用卡券列表并获取用户选择信息 + * @param config + */ + export const chooseCard: (config: chooseCardConfig) => void + + export class AddCardObj { + cardId: string; + cardExt: string; + } + + /** + * res: var cardList = res.cardList; 添加的卡券列表信息 + */ + export interface addCardConfig { + cardList: AddCardObj[]; + success: (res: any) => void; + } + + /** + * 批量添加卡券接口 + */ + export const addCard: (config: addCardConfig) => void + + export class OpenCardObj { + cardId: string; + code: string; + } + + /** + * 需要打开的卡券列表 + */ + export interface openCardConfig { + cardList: OpenCardObj[]; + } + + /** + * 查看微信卡包中的卡券接口 + */ + export const openCard: (config: openCardConfig) => void + + /** + * timestamp: 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 + * nonceStr: 支付签名随机串,不长于 32 位 + * package: 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=*** + * signType: 签名方式,默认为'SHA1',使用新版支付需传入'MD5' + * paySign: 支付签名 + * success: 支付成功后的回调函数 + */ + export interface chooseWXPayConfig { + timestamp: number; + nonceStr: string; + package: string; + signType: string; + paySign: string; + success: (res: any) => void; + } + + /** + * 发起一个微信支付请求 + * @param config + */ + export const chooseWXPay: (config: chooseWXPayConfig) => void + +} + + + diff --git a/types/wx-js-sdk/tsconfig.json b/types/wx-js-sdk/tsconfig.json new file mode 100644 index 0000000000..ee30dc2a86 --- /dev/null +++ b/types/wx-js-sdk/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "wx-js-sdk-tests.ts" + ] +} diff --git a/types/wx-js-sdk/tslint.json b/types/wx-js-sdk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/wx-js-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/wx-js-sdk/wx-js-sdk-tests.ts b/types/wx-js-sdk/wx-js-sdk-tests.ts new file mode 100644 index 0000000000..e69de29bb2 From 21e54ba7e5747dcb2e42ba7b7c3a7c3e69a8f22c Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 19 Jul 2017 23:34:41 +0800 Subject: [PATCH 002/646] rename to wx-js-sdk-dt --- types/{wx-js-sdk => wx-js-sdk-dt}/index.d.ts | 0 types/{wx-js-sdk => wx-js-sdk-dt}/tsconfig.json | 2 +- types/{wx-js-sdk => wx-js-sdk-dt}/tslint.json | 0 .../wx-js-sdk-tests.ts => wx-js-sdk-dt/wx-js-sdk-dt-tests.ts} | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename types/{wx-js-sdk => wx-js-sdk-dt}/index.d.ts (100%) rename types/{wx-js-sdk => wx-js-sdk-dt}/tsconfig.json (92%) rename types/{wx-js-sdk => wx-js-sdk-dt}/tslint.json (100%) rename types/{wx-js-sdk/wx-js-sdk-tests.ts => wx-js-sdk-dt/wx-js-sdk-dt-tests.ts} (100%) diff --git a/types/wx-js-sdk/index.d.ts b/types/wx-js-sdk-dt/index.d.ts similarity index 100% rename from types/wx-js-sdk/index.d.ts rename to types/wx-js-sdk-dt/index.d.ts diff --git a/types/wx-js-sdk/tsconfig.json b/types/wx-js-sdk-dt/tsconfig.json similarity index 92% rename from types/wx-js-sdk/tsconfig.json rename to types/wx-js-sdk-dt/tsconfig.json index ee30dc2a86..780e3ab13c 100644 --- a/types/wx-js-sdk/tsconfig.json +++ b/types/wx-js-sdk-dt/tsconfig.json @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "wx-js-sdk-tests.ts" + "wx-js-sdk-dt-tests.ts" ] } diff --git a/types/wx-js-sdk/tslint.json b/types/wx-js-sdk-dt/tslint.json similarity index 100% rename from types/wx-js-sdk/tslint.json rename to types/wx-js-sdk-dt/tslint.json diff --git a/types/wx-js-sdk/wx-js-sdk-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts similarity index 100% rename from types/wx-js-sdk/wx-js-sdk-tests.ts rename to types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts From a085a30eacaff618f61dc81b030e43502a6b8544 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 20 Jul 2017 00:59:01 +0800 Subject: [PATCH 003/646] fix lint errors --- types/wx-js-sdk-dt/index.d.ts | 229 +++++++++++------------ types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts | 7 + 2 files changed, 119 insertions(+), 117 deletions(-) diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index e11f835bd4..321e6a2f09 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -1,13 +1,27 @@ +// Type definitions for wx-js-sdk 1.2 +// Project: https://res.wx.qq.com/open/js/jweixin-1.2.0.js +// Definitions by: Bian Zhongjie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export namespace wx { + interface wxconfig { + // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 + debug: boolean; - export interface wxconfig { - debug: boolean; // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 - appId: string; //公众号的唯一标识 - timestamp: number; //签名的时间戳 - nonceStr: string; //签名的随机串 - signature: string; //签名 - jsApiList: string[] //需要使用的JS接口列表 + // 公众号的唯一标识 + appId: string; + + // 签名的时间戳 + timestamp: number; + + // 签名的随机串 + nonceStr: string; + + // 签名 + signature: string; + + // 需要使用的JS接口列表 + jsApiList: string[]; } /** @@ -15,43 +29,43 @@ export namespace wx { * @param setting 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 * jsApiList[] 需要使用的JS接口列表 */ - export const config: (setting: wxconfig) => void + function config(setting: wxconfig): void; /** * config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。 * @param x */ - export const ready: (x: () => void ) => void; + function ready(x: () => void ): void; /** * config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 */ - export const error: (err: (res: any) => void) => void - + function error(err: (res: any) => void): void; /** * 判断当前客户端版本是否支持指定JS接口,checkJsApi接口是客户端6.0.2新引入的一个预留接口,第一期开放的接口均可不使用checkJsApi来检测 */ - export interface checkApiConfig { - jsApiList: string[]; //需要检测的JS接口列表 + interface checkApiConfig { + // 需要检测的JS接口列表 + jsApiList: string[]; // 以键值对的形式返回,可用的api值true,不可用为false // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"} - success: (res: {checkResult: {[methodName: string]: boolean}, errMsg: {msg: string}}) => void + success(res: {checkResult: {[methodName: string]: boolean}, errMsg: {msg: string}}): void; } /** * 判断当前客户端版本是否支持指定JS接口 * @param setting */ - export const checkJsApi: (setting: checkApiConfig) => void + function checkJsApi(setting: checkApiConfig): void; - export interface shareTimelineConfig { + interface ShareTimelineConfig { title: string; // 分享标题 link: string; // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: string; // 分享图标 - success: () => void; - cancel: () => void + success(): void; + cancel(): void; } /** @@ -59,10 +73,9 @@ export namespace wx { * * @param setting itle分享标题 ,link分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, imgUrl分享图标, success用户确认分享后执行的回调函数 */ - export const onMenuShareTimeline: (setting: shareTimelineConfig) => void + function onMenuShareTimeline(setting: ShareTimelineConfig): void; - - export interface shareAppMessage extends shareTimelineConfig { + interface shareAppMessage extends ShareTimelineConfig { desc: string; // 分享描述 type?: string; // 分享类型,music、video或link,不填默认为link dataUrl?: string; // 如果type是music或video,则要提供数据链接,默认为空 @@ -73,56 +86,51 @@ export namespace wx { * @param setting title 标题,desc 分享描述,link 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, imgUrl 分享图标,type 分享类型,music、video或link,不填默认为link * dataUrl如果type是music或video,则要提供数据链接,默认为空, success 用户确认分享后执行的回调函数, cancel 用户取消分享后执行的回调函数 */ - export const onMenuShareAppMessage: (setting: shareAppMessage) => void + function onMenuShareAppMessage(setting: shareAppMessage): void; - export interface menuShareQQ extends shareTimelineConfig { + interface menuShareQQ extends ShareTimelineConfig { desc: string; // 分享描述 } /** * “分享到QQ”按钮点击状态及自定义分享内容接口 */ - export const onMenuShareQQ: (config: menuShareQQ) => void + function onMenuShareQQ(config: menuShareQQ): void; - - export interface menuShareWeibo extends shareTimelineConfig { + interface MenuShareWeibo extends ShareTimelineConfig { desc: string; // 分享描述 } /** * 获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 */ - export const onMenuShareWeibo: (config: menuShareWeibo) => void - - - export interface menuShareQZone extends menuShareWeibo { - } + function onMenuShareWeibo(config: MenuShareWeibo): void; /** * 获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 */ - export const onMenuShareQzone: (config: menuShareQZone) => void + function onMenuShareQzone(config: MenuShareWeibo): void; /** * count默认9, sizeType指定是原图还是压缩图,默认二者都有,sourceType 可以指定来源是相册还是相机,默认二者都有 * var localIds = res.localIds; 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 */ - export interface chooseImageConfig { + interface chooseImageConfig { count: number; // 默认9 sizeType: string[]; // 可以指定是原图还是压缩图,默认二者都有 sourceType: string[]; // 可以指定来源是相册还是相机,默认二者都有 - success: (res: any) => void // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 + success(res: any): void; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 } /** * 拍照或从手机相册中选图接口 */ - export const chooseImage: (config: chooseImageConfig) => void + function chooseImage(config: chooseImageConfig): void; /** * current:当前显示图片的http链接, urls:需要预览的图片http链接列表 */ - export interface previewImageConfig { + interface previewImageConfig { current: string; // 当前显示图片的http链接 urls: string[]; // 需要预览的图片http链接列表 } @@ -131,125 +139,119 @@ export namespace wx { *  预览图片接口 * @param config */ - export const previewImage: (config: previewImageConfig) => void + function previewImage(config: previewImageConfig): void; /** * localId:要上传的图片的本地ID,由chooseImage接口获得 * isShowProgressTips:默认为1,显示进度提示 * res: var serverId = res.serverId; 返回图片的服务器端ID */ - export interface uploadImageConfig { + interface uploadImageConfig { localId: string; isShowProgressTips?: number; - success: (res: any) => void + success(res: any): void; } - export const uploadImage: (config: uploadImageConfig) => void + function uploadImage(config: uploadImageConfig): void; /** * serverId:需要下载的图片的服务器端ID,由uploadImage接口获得 * res: var localId = res.localId; 返回图片下载后的本地ID */ - export interface downLoadImageConfig { + interface downLoadImageConfig { serverId: string; isShowProgressTips?: number; - success: (res: any) => void + success(res: any): void; } - export const downLoadImage: (config: downLoadImageConfig) => void + function downLoadImage(config: downLoadImageConfig): void; /** * locallId: 图片的localID */ - export interface getLocalImgDataConfig { + interface getLocalImgDataConfig { localId: string; - success: (res: any) => void + success(res: any): void; } /** * 获取本地图片接口,此接口仅在 iOS WKWebview 下提供,用于兼容 iOS WKWebview 不支持 localId 直接显示图片的问题 */ - export const getLocalImgData: (config: getLocalImgDataConfig) => void + function getLocalImgData(config: getLocalImgDataConfig): void; /** * 开始录音 */ - export const startRecord: () => void + function startRecord(): void; /** * 停止录音 * res: var localId = res.localId; */ - export const stopRecord: (success: (res: any) => void) => void + function stopRecord(success: (res: any) => void): void; /** * 录音时间超过一分钟没有停止的时候会执行 complete 回调 * @param complete :var localId = res.localId; */ - export const onVoiceRecordEnd: (complete: (res: any) => void) => void + function onVoiceRecordEnd(complete: (res: any) => void): void; /** * 需要播放的音频的本地ID,由stopRecord接口获得 * @param localId */ - export const playVoice: (localId: string) => void + function playVoice(localId: string): void; /** * 需要暂停的音频的本地ID,由stopRecord接口获得 */ - export const pauseVoice: (localId: string) => void + function pauseVoice(localId: string): void; /** * 需要停止的音频的本地ID,由stopRecord接口获得 */ - export const stopVoice: (localId: string) => void + function stopVoice(localId: string): void; /** * res: var localId = res.localId; 返回音频的本地ID */ - export const onVoicePlayEnd: (success: (res: any) => void) => void + function onVoicePlayEnd(success: (res: any) => void): void; - interface uploadVoiceConfig { + interface UploadVoiceConfig { localId: string; isShowProgressTips?: number; - success: (res: any) => void - } + success(res: any): void; + } /** * 上传语音接口,上传语音有效期3天,可用微信多媒体接口下载语音到自己的服务器, * 此处获得的 serverId 即 media_id,参考文档 .目前多媒体文件下载接口的频率限制为10000次/天,如需要调高频率,请登录微信公众平台,在开发 - 接口权限的列表中,申请提高临时上限。 * @param config res: var serverId = res.serverId; 返回音频的服务器端ID */ - export const uploadVoice: (config: uploadVoiceConfig) => void + function uploadVoice(config: UploadVoiceConfig): void; /** * serverId:需要下载的音频的服务器端ID,由uploadVoice接口获得 * isShowProgressTips: 默认为1,显示进度提示 */ - export interface downloadVoiceConfig { + interface downloadVoiceConfig { serverId: string; isShowProgressTips?: number; - success: (res: any) => void + success(res: any): void; } - export const downloadVoice: (config: downloadVoiceConfig) => void - - /** - * success: res.translateResult,语音识别的结果 - */ - export interface translateVoiceConfig extends uploadVoiceConfig { - } + function downloadVoice(config: downloadVoiceConfig): void; /** * 识别音频并返回识别结果接口 * @param config */ - export const translateVoice: (config: translateVoiceConfig) => void + function translateVoice(config: UploadVoiceConfig): void; /** * 获取网络状态, var networkType = res.networkType; // 返回网络类型2g,3g,4g,wifi */ - export const getNetworkType: (success: (res: any) => void) => void + function getNetworkType(success: (res: any) => void): void; interface openLocationConfig { latitude: number; @@ -265,112 +267,110 @@ export namespace wx { * @param config name:位置名,scale:地图缩放级别,整形值,范围从1~28。默认为最大 * infoUrl: 在查看位置界面底部显示的超链接,可点击跳转 */ - export const openLocation: (config: openLocationConfig) => void + function openLocation(config: openLocationConfig): void; - export interface Location { + interface Location { latitude: number; longitude: number; speed: number; // 速度,以米/每秒计 accuracy: number; // 位置精度 } - export interface getLocationConfig { - type: string //默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' - success: (res: Location) => void + interface getLocationConfig { + // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' + type: string; + success(res: Location): void; } /** * 获取地理位置接口 * @param config */ - export const getLocation: (config: getLocationConfig) => void - + function getLocation(config: getLocationConfig): void; /** * ticket:摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面 * */ - export interface startSearchBeaconsConfig { + interface startSearchBeaconsConfig { ticket: string; - complete: (argv: any) => void + complete(argv: any): void; } /** * 开启查找周边ibeacon设备接口 * @param config */ - export const startSearchBeacons: (config: startSearchBeaconsConfig) => void + function startSearchBeacons(config: startSearchBeaconsConfig): void; - - export interface stopSearchBeaconsConfig { - complete: (res: any) => void + interface stopSearchBeaconsConfig { + complete(res: any): void; } + /** * 关闭查找完成后的回调函数 */ - export const stopSearchBeacons: (config: stopSearchBeaconsConfig) => void + function stopSearchBeacons(config: stopSearchBeaconsConfig): void; - - export interface onSearchBeaconsConfig { - complete: (argv: any) => void + interface onSearchBeaconsConfig { + complete(argv: any): void; } /** * 监听周边ibeacon设备接口, * 摇一摇周边接口使用注意事项及更多返回结果说明,请参考:摇一摇周边获取设备信息 */ - export const onSearchBeacons: (config: onSearchBeaconsConfig) => void + function onSearchBeacons(config: onSearchBeaconsConfig): void; /** * 关闭当前网页窗口接口 */ - export const closeWindow: () => void + function closeWindow(): void; - - export interface menuItemsConfig { - menuList: string[] // 要隐藏/显示的菜单项,只能隐藏“传播类”和“保护类”按钮 + interface menuItemsConfig { + menuList: string[]; // 要隐藏/显示的菜单项,只能隐藏“传播类”和“保护类”按钮 } /** * 批量隐藏功能按钮接口 */ - export const hideMenuItems: (config: menuItemsConfig) => void + function hideMenuItems(config: menuItemsConfig): void; /** * 批量显示功能按钮接口 */ - export const showMenuItems: (config: menuItemsConfig) => void + function showMenuItems(config: menuItemsConfig): void; /** * 隐藏所有非基础按钮接口 */ - export const hideAllNonBaseMenuItem: () => void + function hideAllNonBaseMenuItem(): void; /** * 显示所有功能按钮接口 */ - export const showAllNonBaseMenuItem: () => void + function showAllNonBaseMenuItem(): void; /** * needResult: 默认为0,扫描结果由微信处理,1则直接返回扫描结果, * scanType:["qrCode","barCode"],可以指定扫二维码还是一维码,默认二者都有 * success: var result = res.resultStr; 当needResult 为 1 时,扫码返回的结果 */ - export interface scanQRCodeConfig { + interface scanQRCodeConfig { needResult?: number; scanType?: string[]; - success: (res: any) => void + success(res: any): void; } /** * 调起微信扫一扫接口 */ - export const scanQRCode: (config: scanQRCodeConfig) => void + function scanQRCode(config: scanQRCodeConfig): void; /** * productId:商品id * viewType: 0.默认值,普通商品详情页1.扫一扫商品详情页2.小店商品详情页 */ - export interface openProductSpecificViewConfig { + interface openProductSpecificViewConfig { productId: string; viewType?: string; } @@ -379,8 +379,7 @@ export namespace wx { * 跳转微信商品页接口 * @param config */ - export const openProductSpecificView: (config: openProductSpecificViewConfig) => void - + function openProductSpecificView(config: openProductSpecificViewConfig): void; /** * shopId: 门店Id @@ -392,7 +391,7 @@ export namespace wx { * cardsign:卡券签名 * success: var cardList= res.cardList; 用户选中的卡券列表信息 */ - export interface chooseCardConfig { + interface chooseCardConfig { shopId?: string; cardType?: string; cardId?: string; @@ -400,16 +399,16 @@ export namespace wx { nonceStr: string; signType: string; cardSign: string; - success: (res: any) => void + success(res: any): void; } /** * 拉取适用卡券列表并获取用户选择信息 * @param config */ - export const chooseCard: (config: chooseCardConfig) => void + function chooseCard(config: chooseCardConfig): void; - export class AddCardObj { + class AddCardObj { cardId: string; cardExt: string; } @@ -417,17 +416,17 @@ export namespace wx { /** * res: var cardList = res.cardList; 添加的卡券列表信息 */ - export interface addCardConfig { + interface addCardConfig { cardList: AddCardObj[]; - success: (res: any) => void; + success(res: any): void; } /** * 批量添加卡券接口 */ - export const addCard: (config: addCardConfig) => void + function addCard(config: addCardConfig): void; - export class OpenCardObj { + class OpenCardObj { cardId: string; code: string; } @@ -435,14 +434,14 @@ export namespace wx { /** * 需要打开的卡券列表 */ - export interface openCardConfig { + interface openCardConfig { cardList: OpenCardObj[]; } /** * 查看微信卡包中的卡券接口 */ - export const openCard: (config: openCardConfig) => void + function openCard(config: openCardConfig): void; /** * timestamp: 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 @@ -452,22 +451,18 @@ export namespace wx { * paySign: 支付签名 * success: 支付成功后的回调函数 */ - export interface chooseWXPayConfig { + interface chooseWXPayConfig { timestamp: number; nonceStr: string; package: string; signType: string; paySign: string; - success: (res: any) => void; + success(res: any): void; } /** * 发起一个微信支付请求 * @param config */ - export const chooseWXPay: (config: chooseWXPayConfig) => void - + function chooseWXPay(config: chooseWXPayConfig): void; } - - - diff --git a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts index e69de29bb2..429306e7c1 100644 --- a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts +++ b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts @@ -0,0 +1,7 @@ +// No npm package for wx-js-sdk, source location is: https://res.wx.qq.com/open/js/jweixin-1.2.0.js +declare const wx: any; +wx.config({ + nonceStr: '', + signature: '', + jsApiList: [''] +}); From 3301404c0c6434b358cb0a1d972f176139637e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Thu, 20 Jul 2017 10:24:45 +0800 Subject: [PATCH 004/646] Change some definitions and add some tests. --- types/wx-js-sdk-dt/index.d.ts | 120 +++++++++++------------ types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts | 105 +++++++++++++++++++- 2 files changed, 164 insertions(+), 61 deletions(-) diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index 321e6a2f09..1edbc1eb65 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -1,12 +1,12 @@ // Type definitions for wx-js-sdk 1.2 -// Project: https://res.wx.qq.com/open/js/jweixin-1.2.0.js +// Project: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115 // Definitions by: Bian Zhongjie // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export namespace wx { +declare namespace wx { interface wxconfig { // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 - debug: boolean; + debug?: boolean; // 公众号的唯一标识 appId: string; @@ -45,7 +45,7 @@ export namespace wx { /** * 判断当前客户端版本是否支持指定JS接口,checkJsApi接口是客户端6.0.2新引入的一个预留接口,第一期开放的接口均可不使用checkJsApi来检测 */ - interface checkApiConfig { + interface CheckApiConfig { // 需要检测的JS接口列表 jsApiList: string[]; @@ -58,14 +58,14 @@ export namespace wx { * 判断当前客户端版本是否支持指定JS接口 * @param setting */ - function checkJsApi(setting: checkApiConfig): void; + function checkJsApi(setting: CheckApiConfig): void; interface ShareTimelineConfig { title: string; // 分享标题 link: string; // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl: string; // 分享图标 - success(): void; - cancel(): void; + imgUrl?: string; // 分享图标 + success?(): void; + cancel?(): void; } /** @@ -75,7 +75,7 @@ export namespace wx { */ function onMenuShareTimeline(setting: ShareTimelineConfig): void; - interface shareAppMessage extends ShareTimelineConfig { + interface SharedAppMessage extends ShareTimelineConfig { desc: string; // 分享描述 type?: string; // 分享类型,music、video或link,不填默认为link dataUrl?: string; // 如果type是music或video,则要提供数据链接,默认为空 @@ -86,16 +86,16 @@ export namespace wx { * @param setting title 标题,desc 分享描述,link 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, imgUrl 分享图标,type 分享类型,music、video或link,不填默认为link * dataUrl如果type是music或video,则要提供数据链接,默认为空, success 用户确认分享后执行的回调函数, cancel 用户取消分享后执行的回调函数 */ - function onMenuShareAppMessage(setting: shareAppMessage): void; + function onMenuShareAppMessage(setting: SharedAppMessage): void; - interface menuShareQQ extends ShareTimelineConfig { + interface MenuShareQQ extends ShareTimelineConfig { desc: string; // 分享描述 } /** * “分享到QQ”按钮点击状态及自定义分享内容接口 */ - function onMenuShareQQ(config: menuShareQQ): void; + function onMenuShareQQ(config: MenuShareQQ): void; interface MenuShareWeibo extends ShareTimelineConfig { desc: string; // 分享描述 @@ -115,22 +115,22 @@ export namespace wx { * count默认9, sizeType指定是原图还是压缩图,默认二者都有,sourceType 可以指定来源是相册还是相机,默认二者都有 * var localIds = res.localIds; 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 */ - interface chooseImageConfig { - count: number; // 默认9 - sizeType: string[]; // 可以指定是原图还是压缩图,默认二者都有 - sourceType: string[]; // 可以指定来源是相册还是相机,默认二者都有 - success(res: any): void; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 + interface ChooseImageConfig { + count?: number; // 默认9 + sizeType?: string[]; // 可以指定是原图还是压缩图,默认二者都有 + sourceType?: string[]; // 可以指定来源是相册还是相机,默认二者都有 + success(res: { localIds: string[]}): void; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 } /** * 拍照或从手机相册中选图接口 */ - function chooseImage(config: chooseImageConfig): void; + function chooseImage(config: ChooseImageConfig): void; /** * current:当前显示图片的http链接, urls:需要预览的图片http链接列表 */ - interface previewImageConfig { + interface PreviewImageConfig { current: string; // 当前显示图片的http链接 urls: string[]; // 需要预览的图片http链接列表 } @@ -139,32 +139,32 @@ export namespace wx { *  预览图片接口 * @param config */ - function previewImage(config: previewImageConfig): void; + function previewImage(config: PreviewImageConfig): void; /** * localId:要上传的图片的本地ID,由chooseImage接口获得 * isShowProgressTips:默认为1,显示进度提示 * res: var serverId = res.serverId; 返回图片的服务器端ID */ - interface uploadImageConfig { + interface UploadImageConfig { localId: string; isShowProgressTips?: number; success(res: any): void; } - function uploadImage(config: uploadImageConfig): void; + function uploadImage(config: UploadImageConfig): void; /** * serverId:需要下载的图片的服务器端ID,由uploadImage接口获得 * res: var localId = res.localId; 返回图片下载后的本地ID */ - interface downLoadImageConfig { + interface DownLoadImageConfig { serverId: string; isShowProgressTips?: number; - success(res: any): void; + success?(res: any): void; } - function downLoadImage(config: downLoadImageConfig): void; + function downloadImage(config: DownLoadImageConfig): void; /** * locallId: 图片的localID @@ -251,15 +251,15 @@ export namespace wx { /** * 获取网络状态, var networkType = res.networkType; // 返回网络类型2g,3g,4g,wifi */ - function getNetworkType(success: (res: any) => void): void; + function getNetworkType(success: (res: { networkType: string }) => void): void; - interface openLocationConfig { - latitude: number; - longitude: number; - name: string; // 位置名 - address: string; // 地址详情说明 - scale: number; // 地图缩放级别,整形值,范围从1~28。默认为最大 - infoUrl: string; // 在查看位置界面底部显示的超链接,可点击跳转 + interface OpenLocationConfig { + latitude?: number; + longitude?: number; + name?: string; // 位置名 + address?: string; // 地址详情说明 + scale?: number; // 地图缩放级别,整形值,范围从1~28。默认为最大 + infoUrl?: string; // 在查看位置界面底部显示的超链接,可点击跳转 } /** @@ -267,7 +267,7 @@ export namespace wx { * @param config name:位置名,scale:地图缩放级别,整形值,范围从1~28。默认为最大 * infoUrl: 在查看位置界面底部显示的超链接,可点击跳转 */ - function openLocation(config: openLocationConfig): void; + function openLocation(config: OpenLocationConfig): void; interface Location { latitude: number; @@ -276,9 +276,9 @@ export namespace wx { accuracy: number; // 位置精度 } - interface getLocationConfig { + interface GetLocationConfig { // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' - type: string; + type?: string; success(res: Location): void; } @@ -286,13 +286,13 @@ export namespace wx { * 获取地理位置接口 * @param config */ - function getLocation(config: getLocationConfig): void; + function getLocation(config: GetLocationConfig): void; /** * ticket:摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面 * */ - interface startSearchBeaconsConfig { + interface StartSearchBeaconsConfig { ticket: string; complete(argv: any): void; } @@ -301,16 +301,16 @@ export namespace wx { * 开启查找周边ibeacon设备接口 * @param config */ - function startSearchBeacons(config: startSearchBeaconsConfig): void; + function startSearchBeacons(config: StartSearchBeaconsConfig): void; - interface stopSearchBeaconsConfig { + interface StopSearchBeaconsConfig { complete(res: any): void; } /** * 关闭查找完成后的回调函数 */ - function stopSearchBeacons(config: stopSearchBeaconsConfig): void; + function stopSearchBeacons(config: StopSearchBeaconsConfig): void; interface onSearchBeaconsConfig { complete(argv: any): void; @@ -326,19 +326,19 @@ export namespace wx { */ function closeWindow(): void; - interface menuItemsConfig { + interface MenuItemsConfig { menuList: string[]; // 要隐藏/显示的菜单项,只能隐藏“传播类”和“保护类”按钮 } /** * 批量隐藏功能按钮接口 */ - function hideMenuItems(config: menuItemsConfig): void; + function hideMenuItems(config: MenuItemsConfig): void; /** * 批量显示功能按钮接口 */ - function showMenuItems(config: menuItemsConfig): void; + function showMenuItems(config: MenuItemsConfig): void; /** * 隐藏所有非基础按钮接口 @@ -355,22 +355,22 @@ export namespace wx { * scanType:["qrCode","barCode"],可以指定扫二维码还是一维码,默认二者都有 * success: var result = res.resultStr; 当needResult 为 1 时,扫码返回的结果 */ - interface scanQRCodeConfig { + interface ScanQRCodeConfig { needResult?: number; scanType?: string[]; - success(res: any): void; + success?(res: any): void; } /** * 调起微信扫一扫接口 */ - function scanQRCode(config: scanQRCodeConfig): void; + function scanQRCode(config: ScanQRCodeConfig): void; /** * productId:商品id * viewType: 0.默认值,普通商品详情页1.扫一扫商品详情页2.小店商品详情页 */ - interface openProductSpecificViewConfig { + interface OpenProductSpecificViewConfig { productId: string; viewType?: string; } @@ -379,7 +379,7 @@ export namespace wx { * 跳转微信商品页接口 * @param config */ - function openProductSpecificView(config: openProductSpecificViewConfig): void; + function openProductSpecificView(config: OpenProductSpecificViewConfig): void; /** * shopId: 门店Id @@ -391,7 +391,7 @@ export namespace wx { * cardsign:卡券签名 * success: var cardList= res.cardList; 用户选中的卡券列表信息 */ - interface chooseCardConfig { + interface ChooseCardConfig { shopId?: string; cardType?: string; cardId?: string; @@ -399,14 +399,14 @@ export namespace wx { nonceStr: string; signType: string; cardSign: string; - success(res: any): void; + success?(res: any): void; } /** * 拉取适用卡券列表并获取用户选择信息 * @param config */ - function chooseCard(config: chooseCardConfig): void; + function chooseCard(config: ChooseCardConfig): void; class AddCardObj { cardId: string; @@ -416,15 +416,15 @@ export namespace wx { /** * res: var cardList = res.cardList; 添加的卡券列表信息 */ - interface addCardConfig { + interface AddCardConfig { cardList: AddCardObj[]; - success(res: any): void; + success?(res: any): void; } /** * 批量添加卡券接口 */ - function addCard(config: addCardConfig): void; + function addCard(config: AddCardConfig): void; class OpenCardObj { cardId: string; @@ -434,14 +434,14 @@ export namespace wx { /** * 需要打开的卡券列表 */ - interface openCardConfig { + interface OpenCardConfig { cardList: OpenCardObj[]; } /** * 查看微信卡包中的卡券接口 */ - function openCard(config: openCardConfig): void; + function openCard(config: OpenCardConfig): void; /** * timestamp: 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 @@ -451,11 +451,11 @@ export namespace wx { * paySign: 支付签名 * success: 支付成功后的回调函数 */ - interface chooseWXPayConfig { + interface ChooseWXPayConfig { timestamp: number; nonceStr: string; package: string; - signType: string; + signType?: string; paySign: string; success(res: any): void; } @@ -464,5 +464,5 @@ export namespace wx { * 发起一个微信支付请求 * @param config */ - function chooseWXPay(config: chooseWXPayConfig): void; + function chooseWXPay(config: ChooseWXPayConfig): void; } diff --git a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts index 429306e7c1..81ba2e9b80 100644 --- a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts +++ b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts @@ -1,7 +1,110 @@ // No npm package for wx-js-sdk, source location is: https://res.wx.qq.com/open/js/jweixin-1.2.0.js -declare const wx: any; + wx.config({ + appId: '', + timestamp: 123, nonceStr: '', signature: '', jsApiList: [''] }); + +wx.ready(() => { +}); + +wx.error((res: any) => { +}); + +wx.checkJsApi({ + jsApiList: [''], + success: (res) => { + } +}); + +wx.onMenuShareAppMessage({ + desc: '', + title: '', + link: '', + imgUrl: '' +}); + +wx.scanQRCode({ +}); + +wx.closeWindow(); + +wx.downloadImage({ + serverId: '' +}); + +wx.addCard({ + cardList: [ + { + cardId: '', + cardExt: '' + } + ] +}); + +wx.chooseImage({ + success: (res) => { + res.localIds; + } +}); + +wx.chooseWXPay({ + timestamp: 0, + nonceStr: '', + package: '', + paySign: '', + success: (res) => {} +}); + +wx.getLocation({ + success: (res) => { + if (res) { + res.accuracy; + res.latitude; + res.longitude; + res.speed; + } + } +}); + +wx.getNetworkType((res) => { + if (res) { + res.networkType; + } +}); + +wx.hideMenuItems({ + menuList: [] +}); + +wx.hideAllNonBaseMenuItem(); + +wx.onMenuShareQQ({ + title: '', + link: '', + desc: '' +}); + +wx.openLocation({ + name: '', + latitude: 123.2, + longitude: -12.23 +}); + +wx.openProductSpecificView({ + productId: '', + viewType: '' +}); + +wx.chooseCard({ + cardId: '', + shopId: '', + cardType: '', + cardSign: '', + nonceStr: '', + timestamp: 1, + signType: '' +}); From c87e766b76c6f78be7ffcad2e810d6defc69e869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Thu, 20 Jul 2017 12:28:35 +0800 Subject: [PATCH 005/646] Update comments --- types/wx-js-sdk-dt/index.d.ts | 240 ++++++++++++++++------- types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts | 5 + 2 files changed, 175 insertions(+), 70 deletions(-) diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index 1edbc1eb65..d55d7fca4f 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -4,66 +4,96 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace wx { + /** + * 微信配置对象 + */ interface wxconfig { - // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 + /** + * 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。 + */ debug?: boolean; - // 公众号的唯一标识 + /** + * 公众号的唯一标识 + */ appId: string; - // 签名的时间戳 + /** + * 签名的时间戳 + */ timestamp: number; - // 签名的随机串 + /** + * 签名的随机串 + */ nonceStr: string; - // 签名 + /** + * 签名 + */ signature: string; - // 需要使用的JS接口列表 + /** + * 需要使用的JS接口列表 + */ jsApiList: string[]; } /** - * 通过config接口注入权限验证配置 - * @param setting 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 - * jsApiList[] 需要使用的JS接口列表 + * 通过 config 接口注入权限验证配置 + * @param setting 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。 + * jsApiList[] 需要使用的 JS 接口列表 */ function config(setting: wxconfig): void; /** - * config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。 + * config 信息验证后会执行 ready 方法,所有接口调用都必须在 config 接口获得结果之后,config 是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在 ready 函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在 ready 函数中。 * @param x */ function ready(x: () => void ): void; /** - * config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 + * config 信息验证失败会执行 error 函数,如签名过期导致验证失败,具体错误信息可以打开 config 的 debug 模式查看,也可以在返回的 res 参数中查看,对于 SPA 可以在这里更新签名。 */ function error(err: (res: any) => void): void; /** - * 判断当前客户端版本是否支持指定JS接口,checkJsApi接口是客户端6.0.2新引入的一个预留接口,第一期开放的接口均可不使用checkJsApi来检测 + * 判断当前客户端版本是否支持指定 JS 接口, checkJsApi 接口是客户端6.0.2新引入的一个预留接口,第一期开放的接口均可不使用 checkJsApi 来检测 */ interface CheckApiConfig { - // 需要检测的JS接口列表 + /** + * 需要检测的JS接口列表 + */ jsApiList: string[]; - // 以键值对的形式返回,可用的api值true,不可用为false - // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"} - success(res: {checkResult: {[methodName: string]: boolean}, errMsg: {msg: string}}): void; + /** + * 以键值对的形式返回,可用的 api 值 true,不可用为 false + * 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"} + */ + success(res: { checkResult: { [methodName: string]: boolean }, errMsg: { msg: string } }): void; } /** - * 判断当前客户端版本是否支持指定JS接口 - * @param setting + * 判断当前客户端版本是否支持指定 JS 接口 + * @param setting CheckApiConfig 对象 */ function checkJsApi(setting: CheckApiConfig): void; interface ShareTimelineConfig { - title: string; // 分享标题 - link: string; // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl?: string; // 分享图标 + /** + * 分享标题 + */ + title: string; + + /** + * 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致 + */ + link: string; + + /** + * 分享图标 + */ + imgUrl?: string; success?(): void; cancel?(): void; } @@ -71,25 +101,42 @@ declare namespace wx { /** * 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 * - * @param setting itle分享标题 ,link分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, imgUrl分享图标, success用户确认分享后执行的回调函数 + * @param setting ShareTimelineConfig 对象 */ function onMenuShareTimeline(setting: ShareTimelineConfig): void; + /** + * 消息分享对象 + */ interface SharedAppMessage extends ShareTimelineConfig { - desc: string; // 分享描述 - type?: string; // 分享类型,music、video或link,不填默认为link - dataUrl?: string; // 如果type是music或video,则要提供数据链接,默认为空 + /** + * 分享描述 + */ + desc: string; + + /** + * 分享类型, music、video 或 link,不填默认为 link + */ + type?: string; + + /** + * 如果 type 是 music 或 video,则要提供数据链接,默认为空 + */ + dataUrl?: string; } /** * 获取“分享给朋友”按钮点击状态及自定义分享内容接口 - * @param setting title 标题,desc 分享描述,link 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, imgUrl 分享图标,type 分享类型,music、video或link,不填默认为link - * dataUrl如果type是music或video,则要提供数据链接,默认为空, success 用户确认分享后执行的回调函数, cancel 用户取消分享后执行的回调函数 + * @param setting title 标题,desc 分享描述,link 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致, imgUrl 分享图标,type 分享类型, music、video 或 link,不填默认为 link + * dataUrl 如果 type 是 music 或 video,则要提供数据链接,默认为空, success 用户确认分享后执行的回调函数, cancel 用户取消分享后执行的回调函数 */ function onMenuShareAppMessage(setting: SharedAppMessage): void; interface MenuShareQQ extends ShareTimelineConfig { - desc: string; // 分享描述 + /** + * 分享描述 + */ + desc: string; } /** @@ -98,7 +145,10 @@ declare namespace wx { function onMenuShareQQ(config: MenuShareQQ): void; interface MenuShareWeibo extends ShareTimelineConfig { - desc: string; // 分享描述 + /** + * 分享描述 + */ + desc: string; } /** @@ -112,14 +162,29 @@ declare namespace wx { function onMenuShareQzone(config: MenuShareWeibo): void; /** - * count默认9, sizeType指定是原图还是压缩图,默认二者都有,sourceType 可以指定来源是相册还是相机,默认二者都有 - * var localIds = res.localIds; 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 + * count 默认9, sizeType 指定是原图还是压缩图,默认二者都有,sourceType 可以指定来源是相册还是相机,默认二者都有 + * var localIds = res.localIds; 返回选定照片的本地ID列表,localId 可以作为 img 标签的 src 属性显示图片 */ interface ChooseImageConfig { - count?: number; // 默认9 - sizeType?: string[]; // 可以指定是原图还是压缩图,默认二者都有 - sourceType?: string[]; // 可以指定来源是相册还是相机,默认二者都有 - success(res: { localIds: string[]}): void; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 + /** + * 照片数,默认9 + */ + count?: number; + + /** + * 可以指定是原图还是压缩图,默认二者都有 + */ + sizeType?: string[]; + + /** + * 可以指定来源是相册还是相机,默认二者都有 + */ + sourceType?: string[]; + + /** + * 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片 + */ + success(res: { localIds: string[]}): void; } /** @@ -128,11 +193,17 @@ declare namespace wx { function chooseImage(config: ChooseImageConfig): void; /** - * current:当前显示图片的http链接, urls:需要预览的图片http链接列表 + * 显示照片预览用的配置对象 */ interface PreviewImageConfig { - current: string; // 当前显示图片的http链接 - urls: string[]; // 需要预览的图片http链接列表 + /** + * 当前显示图片的 http 链接 + */ + current: string; + /** + * 需要预览的图片 http 链接列表 + */ + urls: string[]; } /** @@ -142,9 +213,9 @@ declare namespace wx { function previewImage(config: PreviewImageConfig): void; /** - * localId:要上传的图片的本地ID,由chooseImage接口获得 - * isShowProgressTips:默认为1,显示进度提示 - * res: var serverId = res.serverId; 返回图片的服务器端ID + * localId:要上传的图片的本地 ID,由 chooseImage 接口获得 + * isShowProgressTips: 默认为1,显示进度提示 + * res: var serverId = res.serverId; 返回图片的服务器端 ID */ interface UploadImageConfig { localId: string; @@ -155,8 +226,8 @@ declare namespace wx { function uploadImage(config: UploadImageConfig): void; /** - * serverId:需要下载的图片的服务器端ID,由uploadImage接口获得 - * res: var localId = res.localId; 返回图片下载后的本地ID + * serverId: 需要下载的图片的服务器端ID,由 uploadImage 接口获得 + * res: var localId = res.localId; 返回图片下载后的本地 ID */ interface DownLoadImageConfig { serverId: string; @@ -167,7 +238,7 @@ declare namespace wx { function downloadImage(config: DownLoadImageConfig): void; /** - * locallId: 图片的localID + * locallId: 图片的 localID */ interface getLocalImgDataConfig { localId: string; @@ -197,23 +268,23 @@ declare namespace wx { function onVoiceRecordEnd(complete: (res: any) => void): void; /** - * 需要播放的音频的本地ID,由stopRecord接口获得 + * 需要播放的音频的本地 ID,由 stopRecord 接口获得 * @param localId */ function playVoice(localId: string): void; /** - * 需要暂停的音频的本地ID,由stopRecord接口获得 + * 需要暂停的音频的本地 ID,由 stopRecord 接口获得 */ function pauseVoice(localId: string): void; /** - * 需要停止的音频的本地ID,由stopRecord接口获得 + * 需要停止的音频的本地 ID,由 stopRecord 接口获得 */ function stopVoice(localId: string): void; /** - * res: var localId = res.localId; 返回音频的本地ID + * res: var localId = res.localId; 返回音频的本地 ID */ function onVoicePlayEnd(success: (res: any) => void): void; @@ -226,12 +297,12 @@ declare namespace wx { /** * 上传语音接口,上传语音有效期3天,可用微信多媒体接口下载语音到自己的服务器, * 此处获得的 serverId 即 media_id,参考文档 .目前多媒体文件下载接口的频率限制为10000次/天,如需要调高频率,请登录微信公众平台,在开发 - 接口权限的列表中,申请提高临时上限。 - * @param config res: var serverId = res.serverId; 返回音频的服务器端ID + * @param config res: var serverId = res.serverId; 返回音频的服务器端 ID */ function uploadVoice(config: UploadVoiceConfig): void; /** - * serverId:需要下载的音频的服务器端ID,由uploadVoice接口获得 + * serverId:需要下载的音频的服务器端 ID,由 uploadVoice 接口获得 * isShowProgressTips: 默认为1,显示进度提示 */ interface downloadVoiceConfig { @@ -249,35 +320,61 @@ declare namespace wx { function translateVoice(config: UploadVoiceConfig): void; /** - * 获取网络状态, var networkType = res.networkType; // 返回网络类型2g,3g,4g,wifi + * 获取网络状态, var networkType = res.networkType; 返回网络类型 2g,3g,4g,wifi */ function getNetworkType(success: (res: { networkType: string }) => void): void; interface OpenLocationConfig { latitude?: number; longitude?: number; - name?: string; // 位置名 - address?: string; // 地址详情说明 - scale?: number; // 地图缩放级别,整形值,范围从1~28。默认为最大 - infoUrl?: string; // 在查看位置界面底部显示的超链接,可点击跳转 + + /** + * 位置名 + */ + name?: string; + + /** + * 地址详情说明 + */ + address?: string; + + /** + * 地图缩放级别,整形值,范围从1~28。默认为最大 + */ + scale?: number; + + /** + * 在查看位置界面底部显示的超链接, 可点击跳转 + */ + infoUrl?: string; } /** * 微信内置地图查看位置接口 - * @param config name:位置名,scale:地图缩放级别,整形值,范围从1~28。默认为最大 - * infoUrl: 在查看位置界面底部显示的超链接,可点击跳转 + * @param config name: 位置名, scale: 地图缩放级别, 整形值, 范围从1~28。默认为最大 + * infoUrl: 在查看位置界面底部显示的超链接, 可点击跳转 */ function openLocation(config: OpenLocationConfig): void; interface Location { latitude: number; longitude: number; - speed: number; // 速度,以米/每秒计 - accuracy: number; // 位置精度 + + /** + * 速度,以米/每秒计 + */ + speed: number; + + /** + * 位置精度 + */ + accuracy: number; } interface GetLocationConfig { - // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' + /** + * 默认为 wgs84 的 gps 坐标,如果要返回直接给 openLocation 用的火星坐标,可传入'gcj02' + */ type?: string; success(res: Location): void; } @@ -289,7 +386,7 @@ declare namespace wx { function getLocation(config: GetLocationConfig): void; /** - * ticket:摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面 + * ticket:摇周边的业务 ticket, 系统自动添加在摇出来的页面链接后面 * */ interface StartSearchBeaconsConfig { @@ -298,7 +395,7 @@ declare namespace wx { } /** - * 开启查找周边ibeacon设备接口 + * 开启查找周边 ibeacon 设备接口 * @param config */ function startSearchBeacons(config: StartSearchBeaconsConfig): void; @@ -316,7 +413,7 @@ declare namespace wx { complete(argv: any): void; } /** - * 监听周边ibeacon设备接口, + * 监听周边 ibeacon 设备接口, * 摇一摇周边接口使用注意事项及更多返回结果说明,请参考:摇一摇周边获取设备信息 */ function onSearchBeacons(config: onSearchBeaconsConfig): void; @@ -327,7 +424,10 @@ declare namespace wx { function closeWindow(): void; interface MenuItemsConfig { - menuList: string[]; // 要隐藏/显示的菜单项,只能隐藏“传播类”和“保护类”按钮 + /** + * 要隐藏/显示的菜单项,只能隐藏“传播类”和“保护类”按钮 + */ + menuList: string[]; } /** @@ -352,8 +452,8 @@ declare namespace wx { /** * needResult: 默认为0,扫描结果由微信处理,1则直接返回扫描结果, - * scanType:["qrCode","barCode"],可以指定扫二维码还是一维码,默认二者都有 - * success: var result = res.resultStr; 当needResult 为 1 时,扫码返回的结果 + * scanType:["qrCode","barCode"], 可以指定扫二维码还是一维码,默认二者都有 + * success: var result = res.resultStr; 当 needResult 为 1 时,扫码返回的结果 */ interface ScanQRCodeConfig { needResult?: number; @@ -368,7 +468,7 @@ declare namespace wx { /** * productId:商品id - * viewType: 0.默认值,普通商品详情页1.扫一扫商品详情页2.小店商品详情页 + * viewType: 0.默认值,普通商品详情页; 1.扫一扫商品详情页; 2.小店商品详情页 */ interface OpenProductSpecificViewConfig { productId: string; @@ -414,7 +514,7 @@ declare namespace wx { } /** - * res: var cardList = res.cardList; 添加的卡券列表信息 + * res: var cardList = res.cardList; 添加的卡券列表信息 */ interface AddCardConfig { cardList: AddCardObj[]; @@ -444,9 +544,9 @@ declare namespace wx { function openCard(config: OpenCardConfig): void; /** - * timestamp: 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 + * timestamp: 支付签名时间戳,注意微信jssdk中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的S字符 * nonceStr: 支付签名随机串,不长于 32 位 - * package: 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=*** + * package: 统一支付接口返回的 prepay_id 参数值,提交格式如:prepay_id=*** * signType: 签名方式,默认为'SHA1',使用新版支付需传入'MD5' * paySign: 支付签名 * success: 支付成功后的回调函数 diff --git a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts index 81ba2e9b80..84c97e6bf4 100644 --- a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts +++ b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts @@ -27,6 +27,11 @@ wx.onMenuShareAppMessage({ imgUrl: '' }); +wx.onMenuShareTimeline({ + title: '', + link: '' +}); + wx.scanQRCode({ }); From 751fa3012923f3ebfbd7576374ecef51e4127908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Thu, 20 Jul 2017 15:20:55 +0800 Subject: [PATCH 006/646] Update comments --- types/wx-js-sdk-dt/index.d.ts | 268 +++++++++++++++++++++------------- 1 file changed, 163 insertions(+), 105 deletions(-) diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index d55d7fca4f..c775c1df68 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -7,7 +7,7 @@ declare namespace wx { /** * 微信配置对象 */ - interface wxconfig { + interface WxConfig { /** * 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。 */ @@ -40,20 +40,20 @@ declare namespace wx { } /** - * 通过 config 接口注入权限验证配置 - * @param setting 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。 - * jsApiList[] 需要使用的 JS 接口列表 + * 初始化,做任何操作前必须调用该方法 + * @param setting 配置对象 */ - function config(setting: wxconfig): void; + function config(setting: WxConfig): void; /** - * config 信息验证后会执行 ready 方法,所有接口调用都必须在 config 接口获得结果之后,config 是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在 ready 函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在 ready 函数中。 - * @param x + * 配置微信初始化成功后的回调 + * @param x 回调 */ function ready(x: () => void ): void; /** - * config 信息验证失败会执行 error 函数,如签名过期导致验证失败,具体错误信息可以打开 config 的 debug 模式查看,也可以在返回的 res 参数中查看,对于 SPA 可以在这里更新签名。 + * 配置微信初始化失败后的回调 + * @param err 失败回调 */ function error(err: (res: any) => void): void; @@ -75,7 +75,6 @@ declare namespace wx { /** * 判断当前客户端版本是否支持指定 JS 接口 - * @param setting CheckApiConfig 对象 */ function checkJsApi(setting: CheckApiConfig): void; @@ -94,14 +93,20 @@ declare namespace wx { * 分享图标 */ imgUrl?: string; + + /** + * 分享成功后的回调 + */ success?(): void; + + /** + * 分享失败后的回调 + */ cancel?(): void; } /** * 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 - * - * @param setting ShareTimelineConfig 对象 */ function onMenuShareTimeline(setting: ShareTimelineConfig): void; @@ -127,8 +132,6 @@ declare namespace wx { /** * 获取“分享给朋友”按钮点击状态及自定义分享内容接口 - * @param setting title 标题,desc 分享描述,link 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致, imgUrl 分享图标,type 分享类型, music、video 或 link,不填默认为 link - * dataUrl 如果 type 是 music 或 video,则要提供数据链接,默认为空, success 用户确认分享后执行的回调函数, cancel 用户取消分享后执行的回调函数 */ function onMenuShareAppMessage(setting: SharedAppMessage): void; @@ -161,10 +164,6 @@ declare namespace wx { */ function onMenuShareQzone(config: MenuShareWeibo): void; - /** - * count 默认9, sizeType 指定是原图还是压缩图,默认二者都有,sourceType 可以指定来源是相册还是相机,默认二者都有 - * var localIds = res.localIds; 返回选定照片的本地ID列表,localId 可以作为 img 标签的 src 属性显示图片 - */ interface ChooseImageConfig { /** * 照片数,默认9 @@ -207,48 +206,64 @@ declare namespace wx { } /** - *  预览图片接口 - * @param config + * 预览图片接口 */ function previewImage(config: PreviewImageConfig): void; - /** - * localId:要上传的图片的本地 ID,由 chooseImage 接口获得 - * isShowProgressTips: 默认为1,显示进度提示 - * res: var serverId = res.serverId; 返回图片的服务器端 ID - */ interface UploadImageConfig { + /** + * localId:要上传的图片的本地 ID,由 chooseImage 接口获得 + */ localId: string; + + /** + * isShowProgressTips: 默认为1,显示进度提示 + */ isShowProgressTips?: number; + + /** + * res: var serverId = res.serverId; 返回图片的服务器端 ID + */ success(res: any): void; } + /** + * 上传图片 + */ function uploadImage(config: UploadImageConfig): void; - /** - * serverId: 需要下载的图片的服务器端ID,由 uploadImage 接口获得 - * res: var localId = res.localId; 返回图片下载后的本地 ID - */ interface DownLoadImageConfig { + /** + * serverId: 需要下载的图片的服务器端ID,由 uploadImage 接口获得 + */ serverId: string; + isShowProgressTips?: number; - success?(res: any): void; + + /** + * var localId = res.localId; 返回图片下载后的本地 ID + */ + success?(res: { localId: string }): void; } function downloadImage(config: DownLoadImageConfig): void; - /** - * locallId: 图片的 localID - */ - interface getLocalImgDataConfig { + interface GetLocalImgDataConfig { + /** + * 图片的 localID + */ localId: string; - success(res: any): void; + + /** + * 成功后的回调, localData是图片的base64数据,可以用img标签显示 + */ + success(res: { localData: string} ): void; } /** * 获取本地图片接口,此接口仅在 iOS WKWebview 下提供,用于兼容 iOS WKWebview 不支持 localId 直接显示图片的问题 */ - function getLocalImgData(config: getLocalImgDataConfig): void; + function getLocalImgData(config: GetLocalImgDataConfig): void; /** * 开始录音 @@ -257,36 +272,33 @@ declare namespace wx { /** * 停止录音 - * res: var localId = res.localId; */ - function stopRecord(success: (res: any) => void): void; + function stopRecord(success: (res: {localId: string}) => void): void; /** - * 录音时间超过一分钟没有停止的时候会执行 complete 回调 - * @param complete :var localId = res.localId; + * 录音时间超过一分钟没有停止的时候会执回调 */ - function onVoiceRecordEnd(complete: (res: any) => void): void; + function onVoiceRecordEnd(complete: (res: { localId: string }) => void): void; /** - * 需要播放的音频的本地 ID,由 stopRecord 接口获得 - * @param localId + * 播放音频 */ function playVoice(localId: string): void; /** - * 需要暂停的音频的本地 ID,由 stopRecord 接口获得 + * 暂停音频 */ function pauseVoice(localId: string): void; /** - * 需要停止的音频的本地 ID,由 stopRecord 接口获得 + * 停止播放音频 */ function stopVoice(localId: string): void; /** - * res: var localId = res.localId; 返回音频的本地 ID + * 停止播放后的回调 */ - function onVoicePlayEnd(success: (res: any) => void): void; + function onVoicePlayEnd(success: (res: { localId: string }) => void): void; interface UploadVoiceConfig { localId: string; @@ -295,27 +307,31 @@ declare namespace wx { } /** - * 上传语音接口,上传语音有效期3天,可用微信多媒体接口下载语音到自己的服务器, - * 此处获得的 serverId 即 media_id,参考文档 .目前多媒体文件下载接口的频率限制为10000次/天,如需要调高频率,请登录微信公众平台,在开发 - 接口权限的列表中,申请提高临时上限。 - * @param config res: var serverId = res.serverId; 返回音频的服务器端 ID + * 上传语音接口, 上传语音有效期3天,可用微信多媒体接口下载语音到自己的服务器, */ function uploadVoice(config: UploadVoiceConfig): void; - /** - * serverId:需要下载的音频的服务器端 ID,由 uploadVoice 接口获得 - * isShowProgressTips: 默认为1,显示进度提示 - */ interface downloadVoiceConfig { - serverId: string; - isShowProgressTips?: number; - success(res: any): void; + /** + * 需要下载的音频的服务器端 ID,由 uploadVoice 接口获得 + */ + serverId: string; + + /** + * 默认为1,显示进度提示 + */ + isShowProgressTips?: number; + + /** + * 下载成功回调 + */ + success(res: any): void; } function downloadVoice(config: downloadVoiceConfig): void; /** * 识别音频并返回识别结果接口 - * @param config */ function translateVoice(config: UploadVoiceConfig): void; @@ -350,9 +366,7 @@ declare namespace wx { } /** - * 微信内置地图查看位置接口 - * @param config name: 位置名, scale: 地图缩放级别, 整形值, 范围从1~28。默认为最大 - * infoUrl: 在查看位置界面底部显示的超链接, 可点击跳转 + * 微信内置地图查看位置 */ function openLocation(config: OpenLocationConfig): void; @@ -376,27 +390,29 @@ declare namespace wx { * 默认为 wgs84 的 gps 坐标,如果要返回直接给 openLocation 用的火星坐标,可传入'gcj02' */ type?: string; + success(res: Location): void; } /** * 获取地理位置接口 - * @param config */ function getLocation(config: GetLocationConfig): void; - /** - * ticket:摇周边的业务 ticket, 系统自动添加在摇出来的页面链接后面 - * - */ interface StartSearchBeaconsConfig { + /** + * 摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面 + */ ticket: string; + + /** + * 完成后的回调 + */ complete(argv: any): void; } /** * 开启查找周边 ibeacon 设备接口 - * @param config */ function startSearchBeacons(config: StartSearchBeaconsConfig): void; @@ -450,15 +466,21 @@ declare namespace wx { */ function showAllNonBaseMenuItem(): void; - /** - * needResult: 默认为0,扫描结果由微信处理,1则直接返回扫描结果, - * scanType:["qrCode","barCode"], 可以指定扫二维码还是一维码,默认二者都有 - * success: var result = res.resultStr; 当 needResult 为 1 时,扫码返回的结果 - */ interface ScanQRCodeConfig { + /** + * 默认为0,扫描结果由微信处理,1则直接返回扫描结果, + */ needResult?: number; + + /** + * ["qrCode","barCode"], 可以指定扫二维码还是一维码,默认二者都有 + */ scanType?: string[]; - success?(res: any): void; + + /** + * resultStr 是当 needResult 为 1 时,扫码返回的结果 + */ + success?(res: { resultStr: string }): void; } /** @@ -466,59 +488,81 @@ declare namespace wx { */ function scanQRCode(config: ScanQRCodeConfig): void; - /** - * productId:商品id - * viewType: 0.默认值,普通商品详情页; 1.扫一扫商品详情页; 2.小店商品详情页 - */ interface OpenProductSpecificViewConfig { + /** + * 商品id + */ productId: string; + + /** + * 0.默认值,普通商品详情页; 1.扫一扫商品详情页; 2.小店商品详情页 + */ viewType?: string; } /** * 跳转微信商品页接口 - * @param config */ function openProductSpecificView(config: OpenProductSpecificViewConfig): void; - /** - * shopId: 门店Id - * cardType:卡券类型 - * cardId:卡券Id - * timestamp:卡券签名时间戳 - * nonceStr:卡券签名随机串 - * signtype:签名方式,默认'SHA1' - * cardsign:卡券签名 - * success: var cardList= res.cardList; 用户选中的卡券列表信息 - */ interface ChooseCardConfig { + /** + * 门店Id + */ shopId?: string; + + /** + * 卡券类型 + */ cardType?: string; + + /** + * 卡券Id + */ cardId?: string; + + /** + * 卡券签名时间戳 + */ timestamp: number; + + /** + * 卡券签名随机串 + */ nonceStr: string; + + /** + * 签名方式,默认'SHA1' + */ signType: string; + + /** + * 卡券签名 + */ cardSign: string; - success?(res: any): void; + + /** + * var cardList= res.cardList; 用户选中的卡券列表信息 + */ + success?(res: { cardList: Card[] }): void; } /** - * 拉取适用卡券列表并获取用户选择信息 - * @param config + * 卡券对象 */ - function chooseCard(config: ChooseCardConfig): void; - - class AddCardObj { + interface Card { cardId: string; cardExt: string; } /** - * res: var cardList = res.cardList; 添加的卡券列表信息 + * 拉取适用卡券列表并获取用户选择信息 */ + function chooseCard(config: ChooseCardConfig): void; + interface AddCardConfig { - cardList: AddCardObj[]; - success?(res: any): void; + cardList: Card[]; + success?(res: { cardList: Card[] }): void; } /** @@ -543,26 +587,40 @@ declare namespace wx { */ function openCard(config: OpenCardConfig): void; - /** - * timestamp: 支付签名时间戳,注意微信jssdk中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的S字符 - * nonceStr: 支付签名随机串,不长于 32 位 - * package: 统一支付接口返回的 prepay_id 参数值,提交格式如:prepay_id=*** - * signType: 签名方式,默认为'SHA1',使用新版支付需传入'MD5' - * paySign: 支付签名 - * success: 支付成功后的回调函数 - */ interface ChooseWXPayConfig { + /** + * 支付签名时间戳,注意微信jssdk中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的S字符 + */ timestamp: number; + + /** + * 支付签名随机串,不长于 32 位 + */ nonceStr: string; + + /** + * 统一支付接口返回的 prepay_id 参数值,提交格式如:prepay_id=*** + */ package: string; + + /** + * 签名方式,默认为'SHA1',使用新版支付需传入'MD5' + */ signType?: string; + + /** + * 支付签名 + */ paySign: string; + + /** + * 支付成功后的回调函数 + */ success(res: any): void; } /** * 发起一个微信支付请求 - * @param config */ function chooseWXPay(config: ChooseWXPayConfig): void; } From 9e2b390ee9dd8d835e3e3f1f8fdf795264038fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Thu, 20 Jul 2017 15:58:00 +0800 Subject: [PATCH 007/646] Fix a type error and update comments --- types/wx-js-sdk-dt/index.d.ts | 12 ++++++------ types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index c775c1df68..ec93e37efa 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -212,12 +212,12 @@ declare namespace wx { interface UploadImageConfig { /** - * localId:要上传的图片的本地 ID,由 chooseImage 接口获得 + * 要上传的图片的本地 ID,由 chooseImage 接口获得 */ localId: string; /** - * isShowProgressTips: 默认为1,显示进度提示 + * 默认为1,显示进度提示 */ isShowProgressTips?: number; @@ -276,7 +276,7 @@ declare namespace wx { function stopRecord(success: (res: {localId: string}) => void): void; /** - * 录音时间超过一分钟没有停止的时候会执回调 + * 录音时间超过一分钟没有停止的时候会执行回调 */ function onVoiceRecordEnd(complete: (res: { localId: string }) => void): void; @@ -425,14 +425,14 @@ declare namespace wx { */ function stopSearchBeacons(config: StopSearchBeaconsConfig): void; - interface onSearchBeaconsConfig { + interface OnSearchBeaconsConfig { complete(argv: any): void; } /** * 监听周边 ibeacon 设备接口, * 摇一摇周边接口使用注意事项及更多返回结果说明,请参考:摇一摇周边获取设备信息 */ - function onSearchBeacons(config: onSearchBeaconsConfig): void; + function onSearchBeacons(config: OnSearchBeaconsConfig): void; /** * 关闭当前网页窗口接口 @@ -497,7 +497,7 @@ declare namespace wx { /** * 0.默认值,普通商品详情页; 1.扫一扫商品详情页; 2.小店商品详情页 */ - viewType?: string; + viewType?: number; } /** diff --git a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts index 84c97e6bf4..deeb753b29 100644 --- a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts +++ b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts @@ -100,8 +100,8 @@ wx.openLocation({ }); wx.openProductSpecificView({ - productId: '', - viewType: '' + productId: '1', + viewType: 0 }); wx.chooseCard({ @@ -113,3 +113,15 @@ wx.chooseCard({ timestamp: 1, signType: '' }); + +wx.onVoiceRecordEnd((res) => { + res.localId; +}); + +wx.onVoicePlayEnd((res) => { + res.localId; +}); + +wx.openProductSpecificView({ + productId: '' +}); From 4fa494c39a1484bbbd2677117fa84c67790ea5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Wed, 26 Jul 2017 10:32:21 +0800 Subject: [PATCH 008/646] Add amap typings --- types/amap-js-sdk/amap-js-sdk-tests.ts | 4 + types/amap-js-sdk/index.d.ts | 898 +++++++++++++++++++++++++ types/amap-js-sdk/tsconfig.json | 23 + types/amap-js-sdk/tslint.json | 1 + 4 files changed, 926 insertions(+) create mode 100644 types/amap-js-sdk/amap-js-sdk-tests.ts create mode 100644 types/amap-js-sdk/index.d.ts create mode 100644 types/amap-js-sdk/tsconfig.json create mode 100644 types/amap-js-sdk/tslint.json diff --git a/types/amap-js-sdk/amap-js-sdk-tests.ts b/types/amap-js-sdk/amap-js-sdk-tests.ts new file mode 100644 index 0000000000..9354bed23a --- /dev/null +++ b/types/amap-js-sdk/amap-js-sdk-tests.ts @@ -0,0 +1,4 @@ +const map = new AMap.Map('id', { + resizeEnable: true, + animateEnable: true +}); diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts new file mode 100644 index 0000000000..681ac7c2d0 --- /dev/null +++ b/types/amap-js-sdk/index.d.ts @@ -0,0 +1,898 @@ +// Type definitions for amap-js-sdk x.x +// Project: http://lbs.amap.com/api/javascript-api/summary/ +// Definitions by: Bian Zhongjie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace AMap { + type EventCallback = (...args: any[]) => void; + type GenericEventCallback = (res: T) => void; + + const plugin: (pluginNames: string[], ready?: () => void) => void; + + namespace event { + /** + * 注册DOM对象事件:给DOM对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 + 参数: + instance:需注册事件的DOM对象(必填), + eventName:事件名称(必填), + handler:事件功能函数(必填), + context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + */ + const addDomListener: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 注册对象事件:给对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 + 参数: + instance:需注册事件的对象(必填), + eventName:事件名称(必填), + handler:事件功能函数(必填), + context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + */ + const addListener: (instance: Object, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 类似于addListener,但处理程序会在处理完第一个事件后将自已移除。 + */ + const addListenerOnce: (instance: Object, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 删除由上述 event.addDomListener 和 event.addListener 传回的指定侦听器。 + */ + const removeListener: (listener: EventListener) => void; + + /** + * 触发非DOM事件:触发非DOM事件eventName,extArgs将扩展到事件监听函数(handler)接受到的event参数中。如:在extArgs内写入{m:10,p:2},eventName监听函数(handler)可以接收到包含m,p两个key值的event对象。 + */ + const trigger: (instance: Object, eventName: string, extArgs: any) => void; + } + + + /** + * 此对象用于表示地图、覆盖物、叠加层上的各种鼠标事件返回,包含以下字段: + */ + interface MapsEventOptions { + lnglat: LngLat; + pixel: Pixel; + type: string; + target: Object; + } + + abstract class EventBindable { + on(eventName: string, callback: EventCallback): void; + off(eventName: string, callback: EventCallback): void; + } + + +/* --------------------------- 基础类 --------------------------- */ +/* 参考地址:http://lbs.amap.com/api/javascript-api/reference/core */ + + /** + * 像素坐标,确定地图上的一个像素点。 + */ + class Pixel { + + /** + * 构造一个像素坐标对象。 + */ + constructor(x: number, y: number); + /** + * 获得X方向像素坐标 + */ + getX(): number; + + /** + * 获得Y方向像素坐标 + */ + getY(): number; + + /** + * 当前像素坐标与传入像素坐标是否相等 + */ + equals(point: Pixel): boolean; + + /** + * 以字符串形式返回像素坐标对象 + */ + toString(): string; + } + + /** + * 地物对象的像素尺寸 + */ + class Size { + + /** + * 构造尺寸对象 + * @param {number} width 宽度,单位:像素 + * @param {number} height 高度,单位:像素 + */ + constructor(width: number, height: number); + + /** + * 获得宽度 + */ + getWidth(): number; + + /** + * 获得高度 + */ + getHeight(): number; + + /** + * 以字符串形式返回尺寸大小对象 + */ + toString(): string; + } + + /** + * 经纬度坐标,确定地图上的一个点 + */ + class LngLat { + + /** + * 构造一个地理坐标对象 + * @param {number} lng 经度 + * @param {number} lat 纬度 + */ + constructor(lng: number, lat:number); + + /** + * 当前经纬度坐标值经度移动w,纬度移动s,得到新的坐标。 + * + * @param {number} w 经度,向右移为正值,单位:米 + * @param {number} s 纬度,向上移为正值,单位:米 + */ + offset(w:number, s:number): LngLat; + + /** + * 计算当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米 + * + * @param {(LngLat | [number, number])} lnglat 传入的经纬度 + */ + distance(lnglat: LngLat | [number, number]): number; + + /** + * 获取经度值 + */ + getLng(): number; + + /** + * 获取纬度值 + */ + getLat(): number; + + /** + * 判断当前坐标对象与传入坐标对象是否相等 + * + * @param {LngLat} lnglat 传入坐标对象 + */ + equals(lnglat: LngLat): boolean; + + /** + * LngLat对象以字符串的形式返回 + */ + toString(): string; + } + + /** + * 地物对象的经纬度矩形范围 + */ + class Bounds { + + /** + * 构造一个矩形范围 + * @param {LngLat} southWest 西南角经纬度坐标 + * @param {LngLat} northEast 东北角经纬度坐标 + */ + constructor(southWest: LngLat, northEast: LngLat); + + /** + * 判断指定点坐标是否在矩形范围内 + * @param {LngLat} point 指定点 + */ + contains(point: LngLat): boolean; + + /** + * 获取当前Bounds的中心点经纬度坐标 + */ + getCenter(): LngLat; + + /** + * 获取西南角坐标 + */ + getSouthWest(): LngLat; + + /** + * 获取东北角坐标 + */ + getNorthEast(): LngLat; + + /** + * 以字符串形式返回地物对象的矩形范围 + */ + toString(): string; + } + + interface TileLayerOptions { + map: Map; + tileSize: number; + tileUrl: string; + errorUrl: string; + getTileUrl: (x: number, y: number, z: number) => string; + zIndex: number; + opacity: number; + zooms: number[]; + detectRetina: boolean; + } + + abstract class Layer extends EventBindable { + setOpacity(alpha: number): void; + show(): void; + hide(): void; + getTiles(): string[]; + reload(): void; + setTileUrl(): void; + getZooms(): number[]; + setzIndex(index: number): void; + setMap(map: Map): void; + } + + class TileLayer extends Layer { + constructor(tileOpt?: { + map: Map, + tileSize?: number, + tileUrl?: string, + errorUrl?: string, + getTileUrl?: (x: number, y: number, z: number) => string, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean + }); + } + + namespace TileLayer { + + abstract class MapTypeLayer extends Layer { + constructor(options?: { + map: Map, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean + }); + } + + class Satellite extends MapTypeLayer { + } + + class RoadNet extends MapTypeLayer { + } + + class Traffic extends MapTypeLayer { + constructor(options?: { + map: Map, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean, + autoRefresh?: boolean, + interval?: number + }); + + interval: number; + autoRefresh: boolean; + } + } + + interface IndoorMap { + + } + + interface MapOptions { + view?: View2D; + layers?: TileLayer[]; + level?: number; + center?: LngLat; + labelzIndex?: number; + zooms?: number[]; + lang?: string; + cursor?: string; + crs?: string; + animateEnable?: boolean; + isHotspot?: boolean; + defaultLayer?: TileLayer; + rotateEnable?: boolean; + resizeEnable?: boolean; + showIndoorMap?: boolean; + indoorMap?: IndoorMap; + expandZoomRange?: boolean; + dragEnable?: boolean; + zoomEnable?: boolean; + doubleClickZoom?: boolean; + keyboardEnable?: boolean; + jogEnable?: boolean; + scrollWheel?: boolean; + touchZoom?: boolean; + mapStyle?: string; + features?: string[]; + } + + class View2D { + constructor(opt: { + center?: LngLat, + rotation?: number, + zoom?: number, + crs?: string + }); + } + + class Map extends EventBindable { + + constructor(mapDiv: string, opts?: MapOptions); + + getZoom(): number; + + getLayers(): TileLayer[]; + + getCenter(): LngLat; + + getCity(callback: (result: { + provice: string, + city: string, + citycode: string, + district: string + }) => void): void; + + getBounds(): Bounds; + getlabelzIndex(): number; + getLimitBounds(): Bounds; + getLang(): string; + getSize(): Size; + getRotation(): number; + getStatus(): any; + getDefaultCursor(): string; + getResolution(point: LngLat): number; + getScale(dpi: number): number; + setZoom(level: number): void; + setlabelzIndex(index: number): void; + setLayers(layers: TileLayer[]): void; + add(overlayers: any[]): void; + remove(overlayers: any[]): void; + getAllOverlays(type: string): Marker[] | Circle[] | Polygon[] | Polyline[]; + setCenter(position: LngLat): void; + setZoomAndCenter(zoomLevel: number, center: LngLat): void; + setCity(city:string, callback: () => void): void; + setBounds(bound: Bounds): void; + setLimitBounds(bound: Bounds): void; + clearLimitBounds(): void; + setLang(lang: string): void; + setRotation(rotation: number): void; + setStatus(status: any): void; + setDefaultCursor(cursor: string): void; + zoomIn(): void; + zoomOut(): void; + panTo(position: LngLat): void; + panBy(x: number, y: number): void; + setFitView(overlayList?: any[]): void; + clearMap(): void; + destroy(): void; + plugin(name: string| string[], callback: () => void): void; + addControl(obj: IMapControl|Object): void; + removeControl(obj: IMapControl|Object): void; + clearInfoWindow(): void; + pixelToLngLat(pixel: Pixel, level: number): LngLat; + lnglatToPixel(lnglat: LngLat, level: number): Pixel; + containerToLngLat(pixel: Pixel, level: number): LngLat; + lngLatToContainer(lnglat: LngLat, level: number): Pixel; + setMapStyle(style: string): void; + getMapStyle(): string; + setFeatures(features: string[]): void; + getFeatures(): string[]; + setDefaultLayer(layer: TileLayer): void; + + } + + class Icon { + constructor(options?: { + size?: Size, + imageOffset?: Pixel, + image?: string, + imageSize?: Size + }); + + getImageSize(): Size; + setImageSize(size: Size): void; + } + + /** + * MarkerShape用于划定Marker的可点击区域范围。需要注意的是,在IE浏览器中图标透明区域默认为不触发事件,因此MarkerShape在IE中不起作用。 + */ + class MarkerShape { + constructor(options: { + /** + * + * 可点击区域组成元素数组,存放图形的像素坐标等信息,该数组元素由type决定: + * - circle:coords格式为 [x1, y1, r],x1,y1为圆心像素坐标,r为圆半径 + * - poly: coords格式为 [x1, y1, x2, y2 … xn, yn],各x,y表示多边形边界像素坐标 + * - rect: coords格式为 [x1, y1, x2, y2],x1,y1为矩形左上角像素坐标,x2,y2为矩形右下角像素坐标 + * Markshape的像素坐标是指相对于marker的左上角的像素坐标偏移量 + */ + coords?: number[], + + /** + * 可点击区域类型,可选值: + * - circle:圆形 + * - poly:多边形 + * - rect:矩形 + */ + type?: string + }); + } + + interface MarkerOptions { + map?: Map; + position?: LngLat; + offset?: Pixel; + icon?: string|Icon; + content?: string| HTMLElement; + topWhenClick?: boolean; + topWhenMouseOver?: boolean; + draggable?: boolean; + raiseOnDrag?: boolean; + cursor?: string; + visible?: boolean; + zIndex?: number; + angle?: number; + autoRotation?: boolean; + animation?: string; + shadow?: Icon; + title?: string; + clickable?: boolean; + shape?: MarkerShape; + extData?: any; + label?: { content: string, offset: Pixel }; + } + + /** + * 点标记。 + */ + class Marker extends EventBindable { + constructor(options?: MarkerOptions); + + markOnAMAP(obj: { + name: string, + position: LngLat + }): void; + + getOffset(): Pixel; + setOffset(offset: Pixel): void; + + setAnimation(animate: string): void; + getAnimation(): string; + + setClickable(clickable: boolean): void; + getClickable(): boolean; + + getPosition(): LngLat; + setPosition(lnglat: LngLat): void; + + setAngle(angle: number): void; + getAngle(): number; + + setLabel(label: { + content?: string, + offset?: Pixel + }): void; + getLabel(): { + content?: string, + offset?: Pixel + }; + + setzIndex(index: number): void; + + getIcon(): string|Icon; + setIcon(content: string|Icon): void; + + setDraggable(draggable: boolean): void; + getDraggable(): boolean; + + hide(): void; + show(): void; + + setCursor(cursor: string): void; + + setContent(content: string| HTMLElement): void; + getContent(): string; + + moveAlong(lnglatlist: LngLat[], speed?: number, f?: (k: number) => number, circlable?: boolean): void; + moveTo(lnglat: LngLat, speed?: number, f?: (k: number) => number): void; + stopMove(): void; + setMap(map: Map): void; + getMap(): Map; + setTitle(title: string): void; + getTitle(): string; + setTop(isTop: boolean): void; + getTop(): boolean; + setShadow(icon: Icon): void; + getShadow(): Icon; + setShape(shape: MarkerShape): void; + getShape(): MarkerShape; + setExtData(ext: any): void; + getExtData(): any; + } + + interface CircleOptions { + map: Map; + zIndex?: number; + center: LngLat; + radius?: number; + strokeColor?: string; + strokeOpacity?: number; + fillColor?: string; + fillOpacity?: string; + strokeStyle?: string; + extData?: any; + strokeDasharray?: number[]; + } + + class Circle { + constructor(options?: CircleOptions); + setCenter(lnglat: LngLat): void; + getCenter(): LngLat; + getBounds(): Bounds; + setRadius(radius: number): void; + getRadius(): number; + setOptions(circleopt: CircleOptions): void; + getOptions(): CircleOptions; + hide(): void; + show(): void; + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + contains(point: LngLat): boolean; + } + + interface PolygonOptions { + map?: Map; + zIndex?: number; + path?: LngLat[]|LngLat[][]; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + fillColor?: string; + fillOpacity?: number; + extData?: any; + strokeStyle?: string; + strokeDasharray?: number[]; + } + + class Polygon extends EventBindable { + constructor(options?: PolygonOptions); + + setPath(path: LngLat[]|LngLat[][]): void; + getPath(): LngLat[]|LngLat[][]; + setOptions(opt: PolygonOptions): void; + getOptions(): PolygonOptions; + getBounds(): Bounds; + getArea(): number; + hide(): void; + show(): void; + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + contains(point: LngLat): boolean; + } + + interface PolylineOptions { + map?: Map; + zIndex?: number; + geodesic?: boolean; + isOutline?: boolean; + outlineColor?: string; + path?: LngLat[]; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + strokeStyle?: string; + strokeDasharray?: number[]; + extData?: any; + } + + class Polyline extends EventBindable { + constructor(options?: PolylineOptions); + + setPath(path: LngLat[]): void; + getPath(): LngLat[]; + + setOptions(opt: PolylineOptions): void; + getOptions(): PolylineOptions; + + getLength(): number; + getBounds(): Bounds; + hide(): void; + show(): void; + + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + + } + + interface IMapControl { + show(): void; + hide(): void; + } + + class MapType implements IMapControl { + constructor(options?: { + defaultType?: number; + showTraffic?: boolean; + showRoad?: boolean; + }); + + show(): void; + hide(): void; + } + + class OverView extends EventBindable implements IMapControl { + constructor(options?: { + tileLayer?: TileLayer[], + isOpen?: boolean, + visible?: boolean + }); + + open(): void; + close(): void; + setTileLayer(layer: TileLayer): void; + getTileLayer(): TileLayer; + show(): void; + hide(): void; + } + + class Scale extends EventBindable implements IMapControl { + offset: Pixel; + position: string; + + show(): void; + hide(): void; + } + + class ToolBar extends EventBindable implements IMapControl { + constructor(options?: { + offset?: Pixel, + position?: string, + ruler?: boolean, + noIpLocate?: boolean, + locate?: boolean, + liteStyle?: boolean, + direction?: boolean, + autoPosition?: boolean, + locationMarker?: Marker, + useNative?: boolean + }); + + getOffset(): Pixel; + setOffset(offset: Pixel): void; + hideRuler(): void; + showRuler(): void; + hideDirection(): void; + showDirection(): void + hideLocation(): void; + showLocation(): void; + doLocation(): void; + getLocation(): { lng:number, lat:number }; + show(): void; + hide(): void; + } + + class InfoWindow extends EventBindable { + constructor(options?: { + isCustom?: boolean, + autoMove?: boolean, + closeWhenClickMap?: boolean, + content?: string | HTMLElement, + size?: Size, + offset?: Pixel, + position?: LngLat, + showShadow?: boolean + }); + + open(map: Map, pos: LngLat): void; + close(): void; + getIsOpen(): boolean; + setPosition(lnglat: LngLat): void; + getPosition(): LngLat; + setSize(size: Size): void; + getSize(): Size; + getContent(): string; + setContent(content: string|HTMLElement): void; + } + + class AdvancedInfoWindow extends EventBindable { + constructor(options?: { + autoMove?: boolean, + closeWhenClickMap?: boolean, + content?: string|HTMLElement, + offset?: Pixel, + position?: LngLat, + panel?: string|HTMLElement, + searchRadius?: number, + placeSearch?: boolean, + driving?: boolean, + walking?: boolean, + transit?: boolean, + asOrigin?: boolean, + asDestination?: boolean + }); + + open(map: Map, pos: LngLat): void; + close(): void; + getIsOpen(): boolean; + setPosition(lnglat: LngLat): void; + getPosition(): LngLat; + setContent(content: string|HTMLElement): void; + getContent(): string; + } + + class Geolocation extends EventBindable { + constructor(options: { + enableHighAccuracy?: boolean, + timeout?: number, + noIpLocate?: boolean, + maximumAge?: number, + convert?: boolean, + showButton?: boolean, + buttonDom?: string|HTMLElement, + buttonPosition?: string, + buttonOffset?: Pixel, + showMarker?: boolean, + markerOptions?: MarkerOptions, + showCircle?: boolean, + circleOptions?: CircleOptions, + panToLocation?: boolean, + zoomToAccuracy?: boolean, + useNative?: boolean + }); + + isSupported(): boolean; + getCurrentPosition(): void; + watchPosition(): number; + clearWatch(watchId: number): number; + } + + interface GeolocationResult { + position: LngLat; + accuracy: number; + isConverted: boolean; + info: string; + } + + interface GeolocationError { + info: string; + } + + /** + * 坐标转换结果 + */ + interface ConvertorResult { + info: string; + locations: LngLat[]; + } + + /** + * 坐标转换 + */ + function convertFrom(lnglat: LngLat | LngLat[], type: string, result: (status: string, result: ConvertorResult) => void): void; + + interface CitySearchResult { + city: string; + bounds: Bounds; + } + + class CitySearch extends EventBindable { + getLocalCity(callback: (status: string, result: string | CitySearchResult) => void): void; + getCityByIp(ip: string, callback: (status: string, result: string | CitySearchResult) => void): void; + } + + class Poi { + + } + + const enum DrivingPolicy { + LEAST_TIME, + LEAST_FEE, + LEAST_DISTANCE, + REAL_TRAFFIC + } + + interface ViaCity { + name: string; + citycode: string; + adcode: string; + districts: District[] + } + + interface District { + name: string; + adcode: string; + } + + interface TMC { + lcode: string; + distance: number; + status: string; + } + + interface DriveStep { + start_location: LngLat; + end_location: LngLat; + instruction: string; + action: string; + assist_action: string; + orientation: string; + road: string; + distance: number; + tolls: number; + tolls_distance: number; + toll_road: string; + time: number; + path: LngLat[], + cities?: ViaCity[], + tmcs?: TMC[] + } + + interface DriveRoute { + distance: number; + time: number; + policy: string; + tolls: number; + tolls_distance: number; + steps: DriveStep[] + } + + interface DrivingResult { + info: string; + origin: LngLat; + destination: LngLat|Poi; + start: Poi; + waypoints: Poi; + taxi_cost: number; + routes: DriveRoute[] + } + + class Driving extends EventBindable { + constructor(options?: { + policy?: DrivingPolicy, + extensions?: string, + map?: Map, + panel?: string|HTMLElement, + hideMarkers?: boolean, + showTraffic?: boolean + }); + + search(origin:LngLat, destination: LngLat, opts?: { + waypoints: LngLat[] + }, callback?: (status: string, result: string|DrivingResult) => void): void; + + search(point: { + keyword: string, + city: string + }[], callback: (status: string, result: string|DrivingResult) => void): void; + + setPolicy(policy: DrivingPolicy): void; + setAvoidPolygons(path: LngLat[][]): void; + setAvoidRoad(road: string): void; + clearAvoidRoad(): void; + clearAvoidPolygons(): void; + getAvlidPolygons(): LngLat[][]; + getAvoidRoad(): string; + clear(): void; + searchOnAMAP(obj: { + origin?: LngLat, + originName?: string, + destination?: LngLat, + destinationName?: string + }): void; + } +} diff --git a/types/amap-js-sdk/tsconfig.json b/types/amap-js-sdk/tsconfig.json new file mode 100644 index 0000000000..5fe4ef145c --- /dev/null +++ b/types/amap-js-sdk/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amap-js-sdk-tests.ts" + ] +} diff --git a/types/amap-js-sdk/tslint.json b/types/amap-js-sdk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amap-js-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3046d015fa80ce2c08df936fe6495ba641a444ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Fri, 18 Aug 2017 14:32:40 +0800 Subject: [PATCH 009/646] =?UTF-8?q?=E6=9B=B4=E6=96=B0amap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/amap-js-sdk/index.d.ts | 147 +++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts index 681ac7c2d0..5cdde31e53 100644 --- a/types/amap-js-sdk/index.d.ts +++ b/types/amap-js-sdk/index.d.ts @@ -772,6 +772,100 @@ declare namespace AMap { info: string; } + interface BusinessArea { + id: string; + name: string; + location: string; + } + + interface Road { + id: string; + name: string; + distance: number; + location: LngLat; + direction: string; + } + + interface Cross { + distance: number; + direction: string; + location: LngLat; + first_id: string; + first_name: string; + second_id: string; + second_name: string; + } + + interface AddressComponent { + province: string; + city: string; + citycode: string; + district: string; + adcode: string; + township: string; + street: string; + streetNumber: string; + neighborhood: string; + neighborhoodType: string; + building: string; + buildingType: string; + businessAreas: BusinessArea[]; + } + + interface Geocode { + addressComponent: AddressComponent; + formattedAddress: string; + location: LngLat; + adcode: string; + level: string; + } + + interface ReGeocode { + addressComponent: AddressComponent; + formattedAddress: string; + roads: Road[]; + crosses: Cross[]; + pois: ReGeocodePoi[]; + } + + interface ReGeocodePoi { + id: string; + name: string; + type: string; + tel: string; + distance: number; + direction: string; + address: string; + location: LngLat; + businessArea: string; + } + + interface GeocodeResult { + info: string; + geocodes: LngLat[]; + resultNum: number; + } + + interface ReGeocodeResult { + info: string; + regeocode: ReGeocode; + } + + class Geocoder { + constructor(opts?: { + city?: string, + radius?: number, + batch?: boolean, + extensions?: string + }); + + getLocation(address: string, callback?: (status?: string, result?: string | GeocodeResult) => void): void; + + setCity(city: string): void; + + getAddress(location:LngLat|LngLat[], callback: (status?: string, result?: string | ReGeocodeResult) => void): void; + } + /** * 坐标转换结果 */ @@ -895,4 +989,57 @@ declare namespace AMap { destinationName?: string }): void; } + + // 天气插件 + + interface WeatherLiveResult { + info: string; + province: string; + city: string; + adcode: string; + weather: string; + temperature: number; + windDirection: string; + windPower: number; + humidity: string; + reportTime: string; + } + + interface Forecast { + date: string; + week: string; + dayWeather: string; + nightWeather: string; + dayTemp: number; + nightTemp: number; + dayWindDir: string; + nightWindDir: string; + dayWindPower: string; + nightWindPower: string; + } + + interface WeatherForecastResult { + info: string; + province: string; + city: string; + adcode: string; + reportTime: string; + forecasts: Forecast[]; + } + + class Weather { + /** + * 查询实时天气信息 + * @param district 支持城市名称/区域编码(如:“杭州市”/“330100”) + * @param callback 当请求成功时ErrorStatus为null,当请求不成功时ErrorStatus为Obj + */ + getLive(district: string, callback: (errorStatus: any, result: WeatherLiveResult) => void): void; + + /** + * 查询四天预报天气,包括查询当天天气信息 + * @param district 支持城市名称/区域编码(如:“杭州市”/“330100”) + * @param callback 当请求成功时ErrorStatus为null,当请求不成功时ErrorStatus为Obj + */ + getForecast(district: string, callback: (errorStatus: any, result: WeatherForecastResult) => void): void; + } } From 02182cbb750c8e3507d22dbc5510d6e3dc133ae8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 11 Sep 2017 13:29:53 +0800 Subject: [PATCH 010/646] Add some apis --- types/amap-js-sdk/index.d.ts | 171 ++++++++++++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 1 deletion(-) diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts index 5cdde31e53..e6b4311dc3 100644 --- a/types/amap-js-sdk/index.d.ts +++ b/types/amap-js-sdk/index.d.ts @@ -7,7 +7,19 @@ declare namespace AMap { type EventCallback = (...args: any[]) => void; type GenericEventCallback = (res: T) => void; - const plugin: (pluginNames: string[], ready?: () => void) => void; + /** + * 加载插件 + * @param pluginNames + * @param ready + */ + function plugin(pluginNames: string[], ready?: () => void): void; + + /** + * 加载服务 + * @param serviceName + * @param ready + */ + function service(serviceName: string, ready?: () => void): void; namespace event { /** @@ -1042,4 +1054,161 @@ declare namespace AMap { */ getForecast(district: string, callback: (errorStatus: any, result: WeatherForecastResult) => void): void; } + + + interface Tip { + name: string, + district: string, + adcode: string + } + + interface AutocompleteResult { + info: string, + count: number, + tips: Tip[] + } + + class Autocomplete { + constructor(opts: { + type?: string, + city?: string, + datatype?: string, + citylimit?: boolean, + input?: string + }); + + search(keyword:string, callback: (status: string, result: string | AutocompleteResult) => void): void; + } + + interface SelectChangeEvent { + type: string, + id: string, + marker: Marker, + listElement: HTMLLIElement, + data: Poi + } + + interface PoiList { + pois: Poi[], + pageIndex: number, + pageSize: number, + count: number + } + + interface CityInfo { + name: string, + citycode: string, + adcode: string, + count: number + } + + interface SearchResult { + info: string, + poiList: PoiList, + keywordList: string[], + cityList: CityInfo[] + } + + interface Photo { + title: string, + url: string + } + + interface Content { + id: string, + name: string + } + + interface Discount { + title: string, + detail: string, + start_time: string, + end_time: string, + sold_num: string, + photos: Photo[], + url: string, + provider: string + } + + interface Groupbuy { + title: string, + type_code: string, + type: string, + detail: string, + stime: string, + etime: string, + count: number, + sold_num: number, + original_price: number, + groupbuy_price: number, + discount: number, + ticket_address: string, + ticket_tel: string, + photos: Photo[], + url: string, + provider: string + } + + class PlaceSearch { + constructor(opts: { + city?: string, + citylimit?: boolean, + children?: number, + type?: string, + lang?: string, + pageSize?: number, + pageIndex?: number, + extensions?: string, + map?: Map, + panel?: string|HTMLElement, + showCover?: boolean, + renderStyle?: string, + autoFitView?: boolean + }); + + search(keyword: string, callback: (status: string, result: string | SearchResult) => void): void; + searchNearBy(keyword: string, center: LngLat, radius: number, callback: (status: string,result: string|SearchResult) => void): void; + searchInBounds(keyword: string, bounds: Bounds|Polygon, callback: (status: string, result: string|SearchResult) => void): void; + getDetails(POIID: string, callback: (status: string, result: string|SearchResult) => void): void; + setType(type: string): void; + setCityLimit(p: boolean): void; + setPageIndex(pageIndex: number): void; + setPageSize(setPageSize: number): void; + setCity(city: string): void; + setLang(lang: string): string; + getLang(): string; + clear(): void; + poiOnAMAP(obj: Object): void; + detailOnAMAP(obj: object): void; + } + + interface DistrictSearchOptions { + level: string, + showbiz?: boolean, + extensions?: string, + subdistrict?: number + } + + interface DistrictSearchResult { + info: string, + districtList: District[] + } + + interface District { + name: string, + center: LngLat, + citycode: string, + adcode: string, + level: string, + boundaries: LngLat[], + districtList: District[] + } + + class DistrictSearch { + constructor(opts: DistrictSearchOptions); + + search(keywords: string, callback?: (status: string,result: string| DistrictSearchResult) => void, opts?: DistrictSearchOptions): void; + setLevel(level: string): void; + setSubdistrict(district: number): void; + } } From b1b9f1a32481a7e62370b3fe7c7ffc555fe18ec3 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Wed, 29 Aug 2018 09:38:58 -0700 Subject: [PATCH 011/646] Initial commit. Does not compile yet due to strictNullChecks and all. Need to fix those in the next transaction. --- types/@oracle/index.d.ts | 0 types/@oracle/oraclejet/index.d.ts | 0 types/@oracle/oraclejet/ojs/index.d.ts | 23 + .../oraclejet/ojs/ojaccordion/index.d.ts | 49 ++ .../oraclejet/ojs/ojanimation/index.d.ts | 19 + .../ojs/ojarraydataprovider/index.d.ts | 22 + .../ojs/ojarraytreedataprovider/index.d.ts | 18 + .../@oracle/oraclejet/ojs/ojavatar/index.d.ts | 28 + .../@oracle/oraclejet/ojs/ojbutton/index.d.ts | 144 +++ .../@oracle/oraclejet/ojs/ojchart/index.d.ts | 822 ++++++++++++++++++ .../oraclejet/ojs/ojcheckboxset/index.d.ts | 47 + .../oraclejet/ojs/ojcollapsible/index.d.ts | 52 ++ .../ojs/ojcollectiondataprovider/index.d.ts | 17 + .../@oracle/oraclejet/ojs/ojcolor/index.d.ts | 179 ++++ .../oraclejet/ojs/ojcolorpalette/index.d.ts | 56 ++ .../oraclejet/ojs/ojcolorspectrum/index.d.ts | 44 + .../oraclejet/ojs/ojcomponentcore/index.d.ts | 31 + .../oraclejet/ojs/ojcomposite/index.d.ts | 31 + .../oraclejet/ojs/ojconveyorbelt/index.d.ts | 23 + types/@oracle/oraclejet/ojs/ojcore/index.d.ts | 123 +++ .../oraclejet/ojs/ojdataprovider/index.d.ts | 254 ++++++ .../oraclejet/ojs/ojdatetimepicker/index.d.ts | 308 +++++++ .../@oracle/oraclejet/ojs/ojdefer/index.d.ts | 13 + .../ojs/ojdeferreddataprovider/index.d.ts | 17 + .../@oracle/oraclejet/ojs/ojdialog/index.d.ts | 127 +++ .../oraclejet/ojs/ojdvt-base/index.d.ts | 20 + .../oraclejet/ojs/ojeditablevalue/index.d.ts | 67 ++ .../oraclejet/ojs/ojfilepicker/index.d.ts | 44 + .../oraclejet/ojs/ojfilmstrip/index.d.ts | 42 + .../oraclejet/ojs/ojformlayout/index.d.ts | 37 + .../@oracle/oraclejet/ojs/ojgantt/index.d.ts | 286 ++++++ .../@oracle/oraclejet/ojs/ojgauge/index.d.ts | 347 ++++++++ .../oraclejet/ojs/ojindexer/index.d.ts | 13 + .../oraclejet/ojs/ojinputnumber/index.d.ts | 95 ++ .../oraclejet/ojs/ojinputtext/index.d.ts | 178 ++++ .../@oracle/oraclejet/ojs/ojkeyset/index.d.ts | 32 + .../ojs/ojknockout-keyset/index.d.ts | 9 + .../oraclejet/ojs/ojknockout-model/index.d.ts | 7 + .../oraclejet/ojs/ojknockout/index.d.ts | 14 + .../@oracle/oraclejet/ojs/ojlabel/index.d.ts | 33 + .../oraclejet/ojs/ojlabelvalue/index.d.ts | 25 + .../@oracle/oraclejet/ojs/ojlegend/index.d.ts | 230 +++++ .../ojs/ojlistdataproviderview/index.d.ts | 21 + .../oraclejet/ojs/ojlistview/index.d.ts | 167 ++++ .../oraclejet/ojs/ojmasonrylayout/index.d.ts | 85 ++ types/@oracle/oraclejet/ojs/ojmenu/index.d.ts | 87 ++ .../oraclejet/ojs/ojmenuselectmany/index.d.ts | 36 + .../oraclejet/ojs/ojmessage/index.d.ts | 51 ++ .../oraclejet/ojs/ojmessages/index.d.ts | 55 ++ .../oraclejet/ojs/ojmessaging/index.d.ts | 30 + .../@oracle/oraclejet/ojs/ojmodel/index.d.ts | 169 ++++ .../ojs/ojmodule-element-utils/index.d.ts | 3 + .../oraclejet/ojs/ojmodule-element/index.d.ts | 54 ++ .../@oracle/oraclejet/ojs/ojmodule/index.d.ts | 24 + .../ojs/ojmoduleanimations/index.d.ts | 30 + .../oraclejet/ojs/ojnavigationlist/index.d.ts | 253 ++++++ types/@oracle/oraclejet/ojs/ojnbox/index.d.ts | 251 ++++++ .../oraclejet/ojs/ojoffcanvas/index.d.ts | 13 + .../oraclejet/ojs/ojoptgroup/index.d.ts | 25 + .../@oracle/oraclejet/ojs/ojoption/index.d.ts | 25 + .../oraclejet/ojs/ojpictochart/index.d.ts | 206 +++++ .../@oracle/oraclejet/ojs/ojpopup/index.d.ts | 105 +++ .../oraclejet/ojs/ojprogress/index.d.ts | 28 + .../oraclejet/ojs/ojprogresslist/index.d.ts | 50 ++ .../oraclejet/ojs/ojpulltorefresh/index.d.ts | 7 + .../oraclejet/ojs/ojradioset/index.d.ts | 47 + .../oraclejet/ojs/ojrefresher/index.d.ts | 30 + .../@oracle/oraclejet/ojs/ojrouter/index.d.ts | 69 ++ .../oraclejet/ojs/ojselectcombobox/index.d.ts | 427 +++++++++ .../@oracle/oraclejet/ojs/ojslider/index.d.ts | 61 ++ .../oraclejet/ojs/ojsunburst/index.d.ts | 270 ++++++ .../oraclejet/ojs/ojswipeactions/index.d.ts | 24 + .../oraclejet/ojs/ojswipetoreveal/index.d.ts | 7 + .../@oracle/oraclejet/ojs/ojswitch/index.d.ts | 39 + .../oraclejet/ojs/ojswitcher/index.d.ts | 21 + .../@oracle/oraclejet/ojs/ojtable/index.d.ts | 197 +++++ .../oraclejet/ojs/ojtagcloud/index.d.ts | 139 +++ .../oraclejet/ojs/ojthematicmap/index.d.ts | 376 ++++++++ .../oraclejet/ojs/ojtime-base/index.d.ts | 15 + .../oraclejet/ojs/ojtimeaxis/index.d.ts | 40 + .../oraclejet/ojs/ojtimeutils/index.d.ts | 8 + .../oraclejet/ojs/ojtoolbar/index.d.ts | 19 + .../@oracle/oraclejet/ojs/ojtrain/index.d.ts | 58 ++ .../ojs/ojtreedataprovider/index.d.ts | 7 + .../oraclejet/ojs/ojtreemap/index.d.ts | 241 +++++ .../ojs/ojvalidation-base/index.d.ts | 188 ++++ .../ojs/ojvalidation-datetime/index.d.ts | 108 +++ .../ojs/ojvalidation-number/index.d.ts | 51 ++ .../ojs/ojvalidationgroup/index.d.ts | 22 + .../tests/oraclejet/@oraclejet-tests.ts | 26 + types/@oracle/tsconfig.json | 20 + types/@oracle/tslint.json | 1 + 92 files changed, 8212 insertions(+) create mode 100644 types/@oracle/index.d.ts create mode 100644 types/@oracle/oraclejet/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojanimation/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojavatar/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojbutton/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojchart/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcolor/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojcore/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojdefer/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojdialog/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojgantt/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojgauge/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojindexer/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojknockout/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojlabel/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojlegend/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojlistview/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmenu/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmessage/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmessages/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmodel/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmodule/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojnbox/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojoption/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojpopup/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojprogress/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojradioset/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojrouter/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojslider/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojswitch/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtable/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtrain/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts create mode 100644 types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts create mode 100644 types/@oracle/tests/oraclejet/@oraclejet-tests.ts create mode 100644 types/@oracle/tsconfig.json create mode 100644 types/@oracle/tslint.json diff --git a/types/@oracle/index.d.ts b/types/@oracle/index.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/@oracle/oraclejet/index.d.ts b/types/@oracle/oraclejet/index.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/@oracle/oraclejet/ojs/index.d.ts b/types/@oracle/oraclejet/ojs/index.d.ts new file mode 100644 index 0000000000..90fb69208a --- /dev/null +++ b/types/@oracle/oraclejet/ojs/index.d.ts @@ -0,0 +1,23 @@ +/// +declare namespace oj { + + var revision: string; + var version: string; + function ajax(settings?: object): object; + function sync(method: string, model: oj.Model|oj.Collection, options?: object): object; + +} +declare namespace oj { + interface JetSettableProperties { + } + interface GenericSetter { + set(propertyName: K, propertyValue: SP[K]): void; + unset(propertyName: K): void; + } + abstract class JetElement extends HTMLElement implements GenericSetter { + set(propertyName: K, propertyValue: SP[K]): void; + unset(propertyName: K): void; + } + interface JetElementEventMap extends HTMLElementEventMap { + } +} \ No newline at end of file diff --git a/types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts b/types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts new file mode 100644 index 0000000000..427ee7ecaa --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts @@ -0,0 +1,49 @@ +/// +/// +declare namespace oj { + class ojAccordion extends baseComponent { + expanded: Array<{id?: string, index?: number}>|null; + multiple: boolean; + onExpandedChanged: (event: CustomEvent)=> any; + onMultipleChanged: (event: CustomEvent)=> any; + onOjBeforeCollapse: (event: oj.ojAccordion.ojBeforeCollapse)=> any; + onOjBeforeExpand: (event: oj.ojAccordion.ojBeforeExpand)=> any; + onOjCollapse: (event: oj.ojAccordion.ojCollapse)=> any; + onOjExpand: (event: oj.ojAccordion.ojExpand)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojAccordionEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + } + namespace ojAccordion { + class ojBeforeCollapse extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { + + } + + class ojBeforeExpand extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { + + } + + class ojCollapse extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { + + } + + class ojExpand extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { + + } + } + interface ojAccordionEventMap extends oj.baseComponentEventMap { + 'ojBeforeCollapse': oj.ojAccordion.ojBeforeCollapse; + 'ojBeforeExpand': oj.ojAccordion.ojBeforeExpand; + 'ojCollapse': oj.ojAccordion.ojCollapse; + 'ojExpand': oj.ojAccordion.ojExpand; + 'expandedChanged': CustomEvent; + 'multipleChanged': CustomEvent; + } + interface ojAccordionSettableProperties extends baseComponentSettableProperties { + expanded: Array|Array|Array<{id?: string, index?: number}>|null; + multiple: boolean; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojanimation/index.d.ts b/types/@oracle/oraclejet/ojs/ojanimation/index.d.ts new file mode 100644 index 0000000000..bd4b77f2c6 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojanimation/index.d.ts @@ -0,0 +1,19 @@ +declare namespace oj { + namespace AnimationUtils { + function collapse(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, startMaxHeight?: string, endMaxHeight?: string, startMaxWidth?: string, endMaxWidth?: string}): Promise; + function expand(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, startMaxHeight?: string, endMaxHeight?: string, startMaxWidth?: string, endMaxWidth?: string}): Promise; + function fadeIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, startOpacity?: number, endOpacity?: number}): Promise; + function fadeOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, startOpacity?: number, endOpacity?: number}): Promise; + function flipIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, startAngle?: string, endAngle?: string, backfaceVisibility?: string, perspective?: string, transformOrigin?: string, flipTarget?: string}): Promise; + function flipOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, startAngle?: string, endAngle?: string, backfaceVisibility?: string, perspective?: string, transformOrigin?: string, flipTarget?: string}): Promise; + function ripple(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, offsetX?: string, offsetY?: string, color?: string, diameter?: string, startOpacity?: number, endOpacity?: number}): Promise; + function slideIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, offsetX?: string, offsetY?: string}): Promise; + function slideOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, offsetX?: string, offsetY?: string}): Promise; + function zoomIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, transformOrigin?: string}): Promise; + function zoomOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, transformOrigin?: string}): Promise; + } + namespace AnimationUtils { + type AnimationMethods = 'collapse'|'expand'|'fadeIn'|'fadeOut'|'flipIn'|'flipOut'|'ripple'|'slideIn'|'slideOut'|'zoomIn'|'zoomOut'; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts new file mode 100644 index 0000000000..dddaf2290a --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts @@ -0,0 +1,22 @@ +/// +declare namespace oj { + class ArrayDataProvider implements DataProvider { + constructor(data: Array|(()=> Array), options?: {sortComparators?: SortComparators, implicitSort?: SortCriterion[], keys?: Array|(()=> Array), idAttribute?: string|Array, keyAttributes?: string|Array}); + addEventListener(eventType: string, listener: EventListener): void + containsKeys(params: FetchByKeysParameters): Promise> + dispatchEvent(evt: Event): boolean + fetchByKeys(params: FetchByKeysParameters): Promise> + fetchByOffset(params: FetchByOffsetParameters): Promise> + fetchFirst>(params?: FetchListParameters): AsyncIterable + getCapability(capabilityName?: string): any + getTotalSize(): Promise; + isEmpty(): 'yes'|'no'|'unknown'; + removeEventListener(eventType: string, listener: EventListener): void + } + +} +declare namespace oj { + interface SortComparators { + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts new file mode 100644 index 0000000000..dbb445c36f --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts @@ -0,0 +1,18 @@ +/// +declare namespace oj { + class ArrayTreeDataProvider implements TreeDataProvider { + constructor(data: Array|(()=> Array), options?: {sortComparators?: SortComparators, implicitSort?: SortCriterion[], keyAttributes?: string|Array, keyAttributesScope?: 'global'|'siblings', childrenAttribute?: string}); + addEventListener(eventType: string, listener: EventListener): void + containsKeys(params: FetchByKeysParameters): Promise> + dispatchEvent(evt: Event): boolean + fetchByKeys(params: FetchByKeysParameters): Promise> + fetchByOffset(params: FetchByOffsetParameters): Promise> + fetchFirst>(params?: FetchListParameters): AsyncIterable + getCapability(capabilityName?: string): any + getChildDataProvider(any): ArrayTreeDataProvider + getTotalSize(): Promise; + isEmpty(): 'yes'|'no'|'unknown'; + removeEventListener(eventType: string, listener: EventListener): void + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojavatar/index.d.ts b/types/@oracle/oraclejet/ojs/ojavatar/index.d.ts new file mode 100644 index 0000000000..bfdda53359 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojavatar/index.d.ts @@ -0,0 +1,28 @@ +declare namespace oj { + class ojAvatar extends JetElement { + initials: string; + size: 'xxs'|'xs'|'sm'|'md'|'lg'|'xl'|'xxl'; + src: string; + onInitialsChanged: (event: CustomEvent)=> any; + onSizeChanged: (event: CustomEvent)=> any; + onSrcChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojAvatarEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojAvatarEventMap extends oj.JetElementEventMap { + 'initialsChanged': CustomEvent; + 'sizeChanged': CustomEvent; + 'srcChanged': CustomEvent; + } + interface ojAvatarSettableProperties extends JetSettableProperties { + initials: string; + size: 'xxs'|'xs'|'sm'|'md'|'lg'|'xl'|'xxl'; + src: string; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojbutton/index.d.ts b/types/@oracle/oraclejet/ojs/ojbutton/index.d.ts new file mode 100644 index 0000000000..22df674702 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojbutton/index.d.ts @@ -0,0 +1,144 @@ +/// +declare namespace oj { + class ojButton extends baseComponent { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + onChromingChanged: (event: CustomEvent)=> any; + onDisabledChanged: (event: CustomEvent)=> any; + onDisplayChanged: (event: CustomEvent)=> any; + onOjAction: (event: oj.ojButton.ojAction)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojButton { + class ojAction extends CustomEvent<{ [propName: string]: any}> { + + } + } + interface ojButtonEventMap extends oj.baseComponentEventMap { + 'ojAction': oj.ojButton.ojAction; + 'chromingChanged': CustomEvent; + 'disabledChanged': CustomEvent; + 'displayChanged': CustomEvent; + } + interface ojButtonSettableProperties extends baseComponentSettableProperties { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + } + +} +declare namespace oj { + abstract class ojButtonset extends baseComponent { + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojButtonsetEventMap extends oj.baseComponentEventMap { + } + interface ojButtonsetSettableProperties extends baseComponentSettableProperties { + } + +} +declare namespace oj { + class ojButtonsetMany extends ojButtonset { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + focusManagement: 'oneTabstop'|'none'; + value: Array|null; + onChromingChanged: (event: CustomEvent)=> any; + onDisabledChanged: (event: CustomEvent)=> any; + onDisplayChanged: (event: CustomEvent)=> any; + onFocusManagementChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojButtonsetManyEventMap extends oj.ojButtonsetEventMap { + 'chromingChanged': CustomEvent; + 'disabledChanged': CustomEvent; + 'displayChanged': CustomEvent; + 'focusManagementChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojButtonsetManySettableProperties extends ojButtonsetSettableProperties { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + focusManagement: 'oneTabstop'|'none'; + value: Array|null; + } + +} +declare namespace oj { + class ojButtonsetOne extends ojButtonset { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + focusManagement: 'oneTabstop'|'none'; + value: any; + onChromingChanged: (event: CustomEvent)=> any; + onDisabledChanged: (event: CustomEvent)=> any; + onDisplayChanged: (event: CustomEvent)=> any; + onFocusManagementChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetOneEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojButtonsetOneEventMap extends oj.ojButtonsetEventMap { + 'chromingChanged': CustomEvent; + 'disabledChanged': CustomEvent; + 'displayChanged': CustomEvent; + 'focusManagementChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojButtonsetOneSettableProperties extends ojButtonsetSettableProperties { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + focusManagement: 'oneTabstop'|'none'; + value: any; + } + +} +declare namespace oj { + class ojMenuButton extends ojButton { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + onChromingChanged: (event: CustomEvent)=> any; + onDisabledChanged: (event: CustomEvent)=> any; + onDisplayChanged: (event: CustomEvent)=> any; + onOjAction: (event: oj.ojMenuButton.ojAction)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuButtonEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojMenuButton { + class ojAction extends CustomEvent<{ [propName: string]: any}> { + + } + } + interface ojMenuButtonEventMap extends oj.ojButtonEventMap { + 'ojAction': oj.ojMenuButton.ojAction; + 'chromingChanged': CustomEvent; + 'disabledChanged': CustomEvent; + 'displayChanged': CustomEvent; + } + interface ojMenuButtonSettableProperties extends ojButtonSettableProperties { + chroming: 'full'|'half'|'outlined'; + disabled: boolean; + display: 'all'|'icons'; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojchart/index.d.ts b/types/@oracle/oraclejet/ojs/ojchart/index.d.ts new file mode 100644 index 0000000000..f2e3354441 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojchart/index.d.ts @@ -0,0 +1,822 @@ +/// +/// +declare namespace oj { + class ojChart extends dvtBaseComponent> { + animationOnDataChange: 'auto'|'slideToLeft'|'slideToRight'|'none'; + animationOnDisplay: 'auto'|'alphaFade'|'zoom'|'none'; + as: string; + coordinateSystem: 'polar'|'cartesian'; + data: oj.DataProvider|null; + dataCursor: 'off'|'on'|'auto'; + dataCursorBehavior: 'smooth'|'snap'|'auto'; + dataCursorPosition: {x: number|string, y: number, y2: number}; + dataLabel: ((context: oj.ojChart.DataLabelContext) => ({insert: Element|string}|{preventDefault: boolean})); + dnd: {drag: {groups: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, items: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, series: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}}, drop: {legend: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, plotArea: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, xAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, y2Axis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, yAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}}}; + dragMode: 'pan'|'zoom'|'select'|'off'|'user'; + drilling: 'on'|'seriesOnly'|'groupsOnly'|'off'; + groupComparator: ((param0: object, param1: Object)=> number)|null; + hiddenCategories: Array; + hideAndShowBehavior: 'withRescale'|'withoutRescale'|'none'; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + initialZooming: 'first'|'last'|'none'; + legend: {backgroundColor: string, borderColor: string, maxSize: string, position: 'start'|'end'|'bottom'|'top'|'auto', referenceObjectSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, rendered: 'on'|'off'|'auto', scrolling: 'off'|'asNeeded', sections: Array<{items: Array<{borderColor: string, categories: Array, categoryVisibility: 'hidden'|'visible', color: string, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerShape?: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shortDesc: string, source: string, symbolType: 'line'|'lineWithMarker'|'image'|'marker', text: string}>, sections: Array, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}>, seriesSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, size: string, symbolHeight: number, symbolWidth: number, textStyle: object, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}; + orientation: 'horizontal'|'vertical'; + otherThreshold: number; + overview: {content: object, height: string, rendered: 'on'|'off'}; + pieCenter: {converter: object, label: string, labelStyle: object, renderer: ((context: oj.ojChart.PieCenterContext) => ({insert: Element|string}|{preventDefault: boolean})), scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}; + plotArea: {backgroundColor: string, borderColor: string, borderWidth: number, rendered: 'off'|'on'}; + polarGridShape: 'polygon'|'circle'; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + seriesComparator: ((param0: object, param1: Object)=> number)|null; + sorting: 'ascending'|'descending'|'off'; + splitDualY: 'on'|'off'|'auto'; + splitterPosition: number; + stack: 'on'|'off'; + stackLabel: 'on'|'off'; + styleDefaults: {animationDownColor: string, animationDuration: number, animationIndicators: 'none'|'all', animationUpColor: string, barGapRatio: number, borderColor: string, borderWidth: number, boxPlot: {medianSvgClassName: string, medianSvgStyle: object, whiskerEndLength: string, whiskerEndSvgClassName: string, whiskerEndSvgStyle: object, whiskerSvgClassName: string, whiskerSvgStyle: object}, colors: Array, dataCursor: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerDisplayed: 'off'|'on', markerSize: number}, dataItemGaps: string, dataLabelPosition: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto', dataLabelStyle: object|Array, funnelBackgroundColor: string, groupSeparators: {color: string, rendered: 'off'|'auto'}, hoverBehaviorDelay: number, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto', lineWidth: number, markerColor: string, markerDisplayed: 'on'|'off'|'auto', markerShape?: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|string, markerSize: number, marqueeBorderColor: string, marqueeColor: string, maxBarWidth: number, otherColor: string, patterns: Array, pieFeelerColor: string, pieInnerRadius: number, selectionEffect: 'explode'|'highlightAndExplode'|'highlight', seriesEffect: 'color'|'pattern'|'gradient', shapes: Array, stackLabelStyle: object, stockFallingColor: string, stockRangeColor: string, stockRisingColor: string, stockVolumeColor: string, threeDEffect: 'on'|'off', tooltipLabelStyle: object, tooltipValueStyle: object}; + timeAxisType: 'enabled'|'mixedFrequency'|'skipGaps'|'disabled'|'auto'; + tooltip: {renderer: ((context: oj.ojChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + type: 'line'|'area'|'lineWithArea'|'stock'|'boxPlot'|'combo'|'pie'|'scatter'|'bubble'|'funnel'|'pyramid'|'bar'; + valueFormats: {close: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, group: {tooltipDisplay: 'off'|'auto', tooltipLabel: string|Array}, high: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, label: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}, low: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, open: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q1: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q3: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, series: {tooltipDisplay: 'off'|'auto', tooltipLabel: string}, targetValue: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, value: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, volume: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, x: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, z: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}}; + xAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'off'|'on'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number|string, maxSize: string, min: number|string, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, rendered: 'off'|'on', rotation: 'none'|'auto', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportEndGroup: number|string, viewportMax: number|string, viewportMin: number|string, viewportStartGroup: number|string}; + y2Axis: {alignTickMarks: 'off'|'on', axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object}; + yAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportMax: number, viewportMin: number}; + zoomAndScroll: 'delayedScrollOnly'|'liveScrollOnly'|'delayed'|'live'|'off'; + zoomDirection: 'x'|'y'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelClose?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelDefaultGroupName?: string, labelGroup?: string, labelHigh?: string, labelInvalidData?: string, labelLow?: string, labelNoData?: string, labelOpen?: string, labelOther?: string, labelPercentage?: string, labelQ1?: string, labelQ2?: string, labelQ3?: string, labelSeries?: string, labelTargetValue?: string, labelValue?: string, labelVolume?: string, labelX?: string, labelY?: string, labelZ?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipPan?: string, tooltipSelect?: string, tooltipZoom?: string}; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onCoordinateSystemChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDataCursorChanged: (event: CustomEvent)=> any; + onDataCursorBehaviorChanged: (event: CustomEvent)=> any; + onDataCursorPositionChanged: (event: CustomEvent)=> any; + onDataLabelChanged: (event: CustomEvent)=> any; + onDndChanged: (event: CustomEvent)=> any; + onDragModeChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onGroupComparatorChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHideAndShowBehaviorChanged: (event: CustomEvent)=> any; + onHighlightMatchChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onInitialZoomingChanged: (event: CustomEvent)=> any; + onLegendChanged: (event: CustomEvent)=> any; + onOrientationChanged: (event: CustomEvent)=> any; + onOtherThresholdChanged: (event: CustomEvent)=> any; + onOverviewChanged: (event: CustomEvent)=> any; + onPieCenterChanged: (event: CustomEvent)=> any; + onPlotAreaChanged: (event: CustomEvent)=> any; + onPolarGridShapeChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onSeriesComparatorChanged: (event: CustomEvent)=> any; + onSortingChanged: (event: CustomEvent)=> any; + onSplitDualYChanged: (event: CustomEvent)=> any; + onSplitterPositionChanged: (event: CustomEvent)=> any; + onStackChanged: (event: CustomEvent)=> any; + onStackLabelChanged: (event: CustomEvent)=> any; + onStyleDefaultsChanged: (event: CustomEvent)=> any; + onTimeAxisTypeChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTouchResponseChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + onValueFormatsChanged: (event: CustomEvent)=> any; + onXAxisChanged: (event: CustomEvent)=> any; + onY2AxisChanged: (event: CustomEvent)=> any; + onYAxisChanged: (event: CustomEvent)=> any; + onZoomAndScrollChanged: (event: CustomEvent)=> any; + onZoomDirectionChanged: (event: CustomEvent)=> any; + onOjDrill: (event: oj.ojChart.ojDrill)=> any; + onOjSelectInput: (event: oj.ojChart.ojSelectInput)=> any; + onOjViewportChange: (event: oj.ojChart.ojViewportChange)=> any; + onOjViewportChangeInput: (event: oj.ojChart.ojViewportChangeInput)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojChart.PieCenterLabelContext|oj.ojChart.LegendItemContext|oj.ojChart.ReferenceObject|oj.ojChart.GroupContext|oj.ojChart.AxisTitleContext|oj.ojChart.ItemContext|oj.ojChart.SeriesContext; + getDataItem(seriesIndex: number, groupIndex: number): object|null; + getGroup(groupIndex: string): string; + getGroupCount(): number; + getLegend(): object; + getPlotArea(): object; + getSeries(seriesIndex: string): string; + getSeriesCount(): number; + getValuesAt(x: number, y: number): object; + getXAxis(): object; + getY2Axis(): object; + getYAxis(): object; + } + namespace ojChart { + class ojDrill extends CustomEvent<{id: string, series: string, group: string, data: object, itemData: object, seriesData: object, groupData: Array, [propName: string]: any}> { + + } + + class ojSelectInput extends CustomEvent<{items: Array, selectionData: Array<{data: object, itemData: object, groupData: Array, seriesData: object}>, endGroup: string, startGroup: string, xMax: number, xMin: number, yMax: number, yMin: number, [propName: string]: any}> { + + } + + class ojViewportChange extends CustomEvent<{endGroup: string, startGroup: string, xMax: number, xMin: number, yMax: number, yMin: number, [propName: string]: any}> { + + } + + class ojViewportChangeInput extends CustomEvent<{endGroup: string, startGroup: string, xMax: number, xMin: number, yMax: number, yMin: number, [propName: string]: any}> { + + } + } + interface ojChartEventMap extends oj.dvtBaseComponentEventMap { + 'ojDrill': oj.ojChart.ojDrill; + 'ojSelectInput': oj.ojChart.ojSelectInput; + 'ojViewportChange': oj.ojChart.ojViewportChange; + 'ojViewportChangeInput': oj.ojChart.ojViewportChangeInput; + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'asChanged': CustomEvent; + 'coordinateSystemChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'dataCursorChanged': CustomEvent; + 'dataCursorBehaviorChanged': CustomEvent; + 'dataCursorPositionChanged': CustomEvent; + 'dataLabelChanged': CustomEvent; + 'dndChanged': CustomEvent; + 'dragModeChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'groupComparatorChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'hideAndShowBehaviorChanged': CustomEvent; + 'highlightMatchChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'initialZoomingChanged': CustomEvent; + 'legendChanged': CustomEvent; + 'orientationChanged': CustomEvent; + 'otherThresholdChanged': CustomEvent; + 'overviewChanged': CustomEvent; + 'pieCenterChanged': CustomEvent; + 'plotAreaChanged': CustomEvent; + 'polarGridShapeChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'seriesComparatorChanged': CustomEvent; + 'sortingChanged': CustomEvent; + 'splitDualYChanged': CustomEvent; + 'splitterPositionChanged': CustomEvent; + 'stackChanged': CustomEvent; + 'stackLabelChanged': CustomEvent; + 'styleDefaultsChanged': CustomEvent; + 'timeAxisTypeChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'touchResponseChanged': CustomEvent; + 'typeChanged': CustomEvent; + 'valueFormatsChanged': CustomEvent; + 'xAxisChanged': CustomEvent; + 'y2AxisChanged': CustomEvent; + 'yAxisChanged': CustomEvent; + 'zoomAndScrollChanged': CustomEvent; + 'zoomDirectionChanged': CustomEvent; + } + interface ojChartSettableProperties extends dvtBaseComponentSettableProperties { + animationOnDataChange: 'auto'|'slideToLeft'|'slideToRight'|'none'; + animationOnDisplay: 'auto'|'alphaFade'|'zoom'|'none'; + as: string; + coordinateSystem: 'polar'|'cartesian'; + data: oj.DataProvider|null; + dataCursor: 'off'|'on'|'auto'; + dataCursorBehavior: 'smooth'|'snap'|'auto'; + dataCursorPosition: {x: number|string, y: number, y2: number}; + dataLabel: ((context: oj.ojChart.DataLabelContext) => ({insert: Element|string}|{preventDefault: boolean})); + dnd: {drag: {groups: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, items: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, series: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}}, drop: {legend: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, plotArea: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, xAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, y2Axis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, yAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}}}; + dragMode: 'pan'|'zoom'|'select'|'off'|'user'; + drilling: 'on'|'seriesOnly'|'groupsOnly'|'off'; + groupComparator: ((param0: object, param1: Object)=> number)|null; + hiddenCategories: Array; + hideAndShowBehavior: 'withRescale'|'withoutRescale'|'none'; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + initialZooming: 'first'|'last'|'none'; + legend: {backgroundColor: string, borderColor: string, maxSize: string, position: 'start'|'end'|'bottom'|'top'|'auto', referenceObjectSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, rendered: 'on'|'off'|'auto', scrolling: 'off'|'asNeeded', sections: Array<{items: Array<{borderColor: string, categories: Array, categoryVisibility: 'hidden'|'visible', color: string, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerShape?: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shortDesc: string, source: string, symbolType: 'line'|'lineWithMarker'|'image'|'marker', text: string}>, sections: Array, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}>, seriesSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, size: string, symbolHeight: number, symbolWidth: number, textStyle: object, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}; + orientation: 'horizontal'|'vertical'; + otherThreshold: number; + overview: {content: object, height: string, rendered: 'on'|'off'}; + pieCenter: {converter: object, label: string, labelStyle: object, renderer: ((context: oj.ojChart.PieCenterContext) => ({insert: Element|string}|{preventDefault: boolean})), scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}; + plotArea: {backgroundColor: string, borderColor: string, borderWidth: number, rendered: 'off'|'on'}; + polarGridShape: 'polygon'|'circle'; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + seriesComparator: ((param0: object, param1: Object)=> number)|null; + sorting: 'ascending'|'descending'|'off'; + splitDualY: 'on'|'off'|'auto'; + splitterPosition: number; + stack: 'on'|'off'; + stackLabel: 'on'|'off'; + styleDefaults: {animationDownColor: string, animationDuration: number, animationIndicators: 'none'|'all', animationUpColor: string, barGapRatio: number, borderColor: string, borderWidth: number, boxPlot: {medianSvgClassName: string, medianSvgStyle: object, whiskerEndLength: string, whiskerEndSvgClassName: string, whiskerEndSvgStyle: object, whiskerSvgClassName: string, whiskerSvgStyle: object}, colors: Array, dataCursor: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerDisplayed: 'off'|'on', markerSize: number}, dataItemGaps: string, dataLabelPosition: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto', dataLabelStyle: object|Array, funnelBackgroundColor: string, groupSeparators: {color: string, rendered: 'off'|'auto'}, hoverBehaviorDelay: number, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto', lineWidth: number, markerColor: string, markerDisplayed: 'on'|'off'|'auto', markerShape?: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|string, markerSize: number, marqueeBorderColor: string, marqueeColor: string, maxBarWidth: number, otherColor: string, patterns: Array, pieFeelerColor: string, pieInnerRadius: number, selectionEffect: 'explode'|'highlightAndExplode'|'highlight', seriesEffect: 'color'|'pattern'|'gradient', shapes: Array, stackLabelStyle: object, stockFallingColor: string, stockRangeColor: string, stockRisingColor: string, stockVolumeColor: string, threeDEffect: 'on'|'off', tooltipLabelStyle: object, tooltipValueStyle: object}; + timeAxisType: 'enabled'|'mixedFrequency'|'skipGaps'|'disabled'|'auto'; + tooltip: {renderer: ((context: oj.ojChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + type: 'line'|'area'|'lineWithArea'|'stock'|'boxPlot'|'combo'|'pie'|'scatter'|'bubble'|'funnel'|'pyramid'|'bar'; + valueFormats: {close: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, group: {tooltipDisplay: 'off'|'auto', tooltipLabel: string|Array}, high: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, label: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}, low: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, open: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q1: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q3: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, series: {tooltipDisplay: 'off'|'auto', tooltipLabel: string}, targetValue: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, value: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, volume: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, x: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, z: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}}; + xAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'off'|'on'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number|string, maxSize: string, min: number|string, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, rendered: 'off'|'on', rotation: 'none'|'auto', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportEndGroup: number|string, viewportMax: number|string, viewportMin: number|string, viewportStartGroup: number|string}; + y2Axis: {alignTickMarks: 'off'|'on', axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object}; + yAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportMax: number, viewportMin: number}; + zoomAndScroll: 'delayedScrollOnly'|'liveScrollOnly'|'delayed'|'live'|'off'; + zoomDirection: 'x'|'y'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelClose?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelDefaultGroupName?: string, labelGroup?: string, labelHigh?: string, labelInvalidData?: string, labelLow?: string, labelNoData?: string, labelOpen?: string, labelOther?: string, labelPercentage?: string, labelQ1?: string, labelQ2?: string, labelQ3?: string, labelSeries?: string, labelTargetValue?: string, labelValue?: string, labelVolume?: string, labelX?: string, labelY?: string, labelZ?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipPan?: string, tooltipSelect?: string, tooltipZoom?: string}; + } + namespace ojChart { + type AxisTitleContext = + { + axis: 'xAxis'|'yAxis'|'y2Axis', subId: string + } + } + namespace ojChart { + type DataLabelContext = + { + id: any, series: string, group: string|Array, value: number, targetValue: number, x: number|string, y: number, z: number, low: number, high: number, open: number, close: number, volume: number, label: string, totalValue: number, data: object|null, itemData: object|null, seriesData: object|null, groupData: object|null, componentElement: Element + } + } + namespace ojChart { + type GroupContext = + { + indexPath: Array, subId: string + } + } + namespace ojChart { + type ItemContext = + { + seriesIndex: number, itemIndex: number, subId: string + } + } + namespace ojChart { + type LegendItemContext = + { + sectionIndexPath: Array, itemIndex: number, subId: string + } + } + namespace ojChart { + type PieCenterContext = + { + outerBounds: object, innerBounds: object, label: string, componentElement: Element + } + } + namespace ojChart { + type PieCenterLabelContext = + { + subId: string + } + } + namespace ojChart { + type ReferenceObject = + { + axis: 'xAxis'|'yAxis'|'y2Axis', index: number, subId: string + } + } + namespace ojChart { + type SeriesContext = + { + itemIndex: number, subId: string + } + } + namespace ojChart { + type TooltipContext = + { + parentElement: Element, id: any, series: string, group: string|Array, label: string, value: number, x: number|string, y: number, z: number, low: number, high: number, open: number, close: number, volume: number, targetValue: number, data: object|null, itemData: object|null, seriesData: object|null, groupData: object|null, componentElement: Element, color: string + } + } + +} +declare namespace oj { + class ojChartGroup extends JetElement { + drilling?: 'on'|'off'|'inherit'; + labelStyle?: object; + name?: string; + shortDesc?: string; + onDrillingChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + onNameChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartGroupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojChartGroupEventMap extends oj.JetElementEventMap { + 'drillingChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + 'nameChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + } + interface ojChartGroupSettableProperties extends JetSettableProperties { + drilling?: 'on'|'off'|'inherit'; + labelStyle?: object; + name?: string; + shortDesc?: string; + } + +} +declare namespace oj { + class ojChartItem extends JetElement { + borderColor?: string; + borderWidth?: number; + boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; + categories?: Array; + close?: number; + color?: string; + drilling?: 'on'|'off'|'inherit'; + groupId: Array; + high?: number; + items?: Array|Array; + label?: string|Array; + labelPosition?: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto'; + labelStyle?: object|Array; + low?: number; + markerDisplayed?: 'on'|'off'|'auto'; + markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; + markerSize?: number; + open?: number; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; + q1?: number; + q2?: number; + q3?: number; + seriesId: string; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + svgClassName?: string; + svgStyle?: object; + targetValue?: number; + value?: number; + volume?: number; + x?: number|string; + y?: number; + z?: number; + onBorderColorChanged: (event: CustomEvent)=> any; + onBorderWidthChanged: (event: CustomEvent)=> any; + onBoxPlotChanged: (event: CustomEvent)=> any; + onCategoriesChanged: (event: CustomEvent)=> any; + onCloseChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onGroupIdChanged: (event: CustomEvent)=> any; + onHighChanged: (event: CustomEvent)=> any; + onItemsChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onLabelPositionChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + onLowChanged: (event: CustomEvent)=> any; + onMarkerDisplayedChanged: (event: CustomEvent)=> any; + onMarkerShapeChanged: (event: CustomEvent)=> any; + onMarkerSizeChanged: (event: CustomEvent)=> any; + onOpenChanged: (event: CustomEvent)=> any; + onPatternChanged: (event: CustomEvent)=> any; + onQ1Changed: (event: CustomEvent)=> any; + onQ2Changed: (event: CustomEvent)=> any; + onQ3Changed: (event: CustomEvent)=> any; + onSeriesIdChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSourceChanged: (event: CustomEvent)=> any; + onSourceHoverChanged: (event: CustomEvent)=> any; + onSourceHoverSelectedChanged: (event: CustomEvent)=> any; + onSourceSelectedChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onTargetValueChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onVolumeChanged: (event: CustomEvent)=> any; + onXChanged: (event: CustomEvent)=> any; + onYChanged: (event: CustomEvent)=> any; + onZChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojChartItemEventMap extends oj.JetElementEventMap { + 'borderColorChanged': CustomEvent; + 'borderWidthChanged': CustomEvent; + 'boxPlotChanged': CustomEvent; + 'categoriesChanged': CustomEvent; + 'closeChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'groupIdChanged': CustomEvent; + 'highChanged': CustomEvent; + 'itemsChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'labelPositionChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + 'lowChanged': CustomEvent; + 'markerDisplayedChanged': CustomEvent; + 'markerShapeChanged': CustomEvent; + 'markerSizeChanged': CustomEvent; + 'openChanged': CustomEvent; + 'patternChanged': CustomEvent; + 'q1Changed': CustomEvent; + 'q2Changed': CustomEvent; + 'q3Changed': CustomEvent; + 'seriesIdChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'sourceChanged': CustomEvent; + 'sourceHoverChanged': CustomEvent; + 'sourceHoverSelectedChanged': CustomEvent; + 'sourceSelectedChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'targetValueChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'volumeChanged': CustomEvent; + 'xChanged': CustomEvent; + 'yChanged': CustomEvent; + 'zChanged': CustomEvent; + } + interface ojChartItemSettableProperties extends JetSettableProperties { + borderColor?: string; + borderWidth?: number; + boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; + categories?: Array; + close?: number; + color?: string; + drilling?: 'on'|'off'|'inherit'; + groupId: Array; + high?: number; + items?: Array|Array; + label?: string|Array; + labelPosition?: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto'; + labelStyle?: object|Array; + low?: number; + markerDisplayed?: 'on'|'off'|'auto'; + markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; + markerSize?: number; + open?: number; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; + q1?: number; + q2?: number; + q3?: number; + seriesId: string; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + svgClassName?: string; + svgStyle?: object; + targetValue?: number; + value?: number; + volume?: number; + x?: number|string; + y?: number; + z?: number; + } + +} +declare namespace oj { + class ojChartSeries extends JetElement { + areaColor?: string; + areaSvgClassName?: string; + areaSvgStyle?: object; + assignedToY2?: 'on'|'off'; + borderColor?: string; + borderWidth?: number; + boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3Color?: string, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; + categories?: Array; + color?: string; + displayInLegend?: 'on'|'off'|'auto'; + drilling?: 'on'|'off'|'inherit'; + lineStyle?: 'dotted'|'dashed'|'solid'; + lineType?: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto'; + lineWidth?: number; + markerColor?: string; + markerDisplayed?: 'on'|'off'|'auto'; + markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; + markerSize?: number; + markerSvgClassName?: string; + markerSvgStyle?: object; + name?: string; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; + pieSliceExplode?: number; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + stackCategory?: string; + svgClassName?: string; + svgStyle?: object; + type?: 'bar'|'line'|'area'|'lineWithArea'|'candlestick'|'boxPlot'|'auto'; + onAreaColorChanged: (event: CustomEvent)=> any; + onAreaSvgClassNameChanged: (event: CustomEvent)=> any; + onAreaSvgStyleChanged: (event: CustomEvent)=> any; + onAssignedToY2Changed: (event: CustomEvent)=> any; + onBorderColorChanged: (event: CustomEvent)=> any; + onBorderWidthChanged: (event: CustomEvent)=> any; + onBoxPlotChanged: (event: CustomEvent)=> any; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onDisplayInLegendChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onLineStyleChanged: (event: CustomEvent)=> any; + onLineTypeChanged: (event: CustomEvent)=> any; + onLineWidthChanged: (event: CustomEvent)=> any; + onMarkerColorChanged: (event: CustomEvent)=> any; + onMarkerDisplayedChanged: (event: CustomEvent)=> any; + onMarkerShapeChanged: (event: CustomEvent)=> any; + onMarkerSizeChanged: (event: CustomEvent)=> any; + onMarkerSvgClassNameChanged: (event: CustomEvent)=> any; + onMarkerSvgStyleChanged: (event: CustomEvent)=> any; + onNameChanged: (event: CustomEvent)=> any; + onPatternChanged: (event: CustomEvent)=> any; + onPieSliceExplodeChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSourceChanged: (event: CustomEvent)=> any; + onSourceHoverChanged: (event: CustomEvent)=> any; + onSourceHoverSelectedChanged: (event: CustomEvent)=> any; + onSourceSelectedChanged: (event: CustomEvent)=> any; + onStackCategoryChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartSeriesEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojChartSeriesEventMap extends oj.JetElementEventMap { + 'areaColorChanged': CustomEvent; + 'areaSvgClassNameChanged': CustomEvent; + 'areaSvgStyleChanged': CustomEvent; + 'assignedToY2Changed': CustomEvent; + 'borderColorChanged': CustomEvent; + 'borderWidthChanged': CustomEvent; + 'boxPlotChanged': CustomEvent; + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'displayInLegendChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'lineStyleChanged': CustomEvent; + 'lineTypeChanged': CustomEvent; + 'lineWidthChanged': CustomEvent; + 'markerColorChanged': CustomEvent; + 'markerDisplayedChanged': CustomEvent; + 'markerShapeChanged': CustomEvent; + 'markerSizeChanged': CustomEvent; + 'markerSvgClassNameChanged': CustomEvent; + 'markerSvgStyleChanged': CustomEvent; + 'nameChanged': CustomEvent; + 'patternChanged': CustomEvent; + 'pieSliceExplodeChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'sourceChanged': CustomEvent; + 'sourceHoverChanged': CustomEvent; + 'sourceHoverSelectedChanged': CustomEvent; + 'sourceSelectedChanged': CustomEvent; + 'stackCategoryChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'typeChanged': CustomEvent; + } + interface ojChartSeriesSettableProperties extends JetSettableProperties { + areaColor?: string; + areaSvgClassName?: string; + areaSvgStyle?: object; + assignedToY2?: 'on'|'off'; + borderColor?: string; + borderWidth?: number; + boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3Color?: string, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; + categories?: Array; + color?: string; + displayInLegend?: 'on'|'off'|'auto'; + drilling?: 'on'|'off'|'inherit'; + lineStyle?: 'dotted'|'dashed'|'solid'; + lineType?: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto'; + lineWidth?: number; + markerColor?: string; + markerDisplayed?: 'on'|'off'|'auto'; + markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; + markerSize?: number; + markerSvgClassName?: string; + markerSvgStyle?: object; + name?: string; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; + pieSliceExplode?: number; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + stackCategory?: string; + svgClassName?: string; + svgStyle?: object; + type?: 'bar'|'line'|'area'|'lineWithArea'|'candlestick'|'boxPlot'|'auto'; + } + +} +declare namespace oj { + class ojSparkChart extends dvtBaseComponent> { + animationDuration: number|null; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + areaColor: string; + areaSvgClassName: string; + areaSvgStyle: object; + as: string; + barGapRatio: number; + baselineScaling: 'zero'|'min'; + color: string; + data: oj.DataProvider|null; + firstColor: string; + highColor: string; + lastColor: string; + lineStyle: 'dotted'|'dashed'|'solid'; + lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'straight'; + lineWidth: number; + lowColor: string; + markerShape: 'square'|'circle'|'diamond'|'plus'|'triangleDown'|'triangleUp'|'human'|'star'|'auto'; + markerSize: number; + referenceObjects: Array; + svgClassName: string; + svgStyle: object; + tooltip: {renderer: ((context: oj.ojSparkChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; + type: 'area'|'lineWithArea'|'bar'|'line'; + visualEffects: 'none'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onAnimationDurationChanged: (event: CustomEvent)=> any; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAreaColorChanged: (event: CustomEvent)=> any; + onAreaSvgClassNameChanged: (event: CustomEvent)=> any; + onAreaSvgStyleChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onBarGapRatioChanged: (event: CustomEvent)=> any; + onBaselineScalingChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onFirstColorChanged: (event: CustomEvent)=> any; + onHighColorChanged: (event: CustomEvent)=> any; + onLastColorChanged: (event: CustomEvent)=> any; + onLineStyleChanged: (event: CustomEvent)=> any; + onLineTypeChanged: (event: CustomEvent)=> any; + onLineWidthChanged: (event: CustomEvent)=> any; + onLowColorChanged: (event: CustomEvent)=> any; + onMarkerShapeChanged: (event: CustomEvent)=> any; + onMarkerSizeChanged: (event: CustomEvent)=> any; + onReferenceObjectsChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + onVisualEffectsChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSparkChartEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getDataItem(itemIndex: number): oj.ojSparkChart.ItemContext|null; + } + interface ojSparkChartEventMap extends oj.dvtBaseComponentEventMap { + 'animationDurationChanged': CustomEvent; + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'areaColorChanged': CustomEvent; + 'areaSvgClassNameChanged': CustomEvent; + 'areaSvgStyleChanged': CustomEvent; + 'asChanged': CustomEvent; + 'barGapRatioChanged': CustomEvent; + 'baselineScalingChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'firstColorChanged': CustomEvent; + 'highColorChanged': CustomEvent; + 'lastColorChanged': CustomEvent; + 'lineStyleChanged': CustomEvent; + 'lineTypeChanged': CustomEvent; + 'lineWidthChanged': CustomEvent; + 'lowColorChanged': CustomEvent; + 'markerShapeChanged': CustomEvent; + 'markerSizeChanged': CustomEvent; + 'referenceObjectsChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'typeChanged': CustomEvent; + 'visualEffectsChanged': CustomEvent; + } + interface ojSparkChartSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number|null; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + areaColor: string; + areaSvgClassName: string; + areaSvgStyle: object; + as: string; + barGapRatio: number; + baselineScaling: 'zero'|'min'; + color: string; + data: oj.DataProvider|null; + firstColor: string; + highColor: string; + lastColor: string; + lineStyle: 'dotted'|'dashed'|'solid'; + lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'straight'; + lineWidth: number; + lowColor: string; + markerShape: 'square'|'circle'|'diamond'|'plus'|'triangleDown'|'triangleUp'|'human'|'star'|'auto'; + markerSize: number; + referenceObjects: Array; + svgClassName: string; + svgStyle: object; + tooltip: {renderer: ((context: oj.ojSparkChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; + type: 'area'|'lineWithArea'|'bar'|'line'; + visualEffects: 'none'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + namespace ojSparkChart { + type Item = + { + borderColor: string, color: string, date: Date, high: number, low: number, markerDisplayed: 'on'|'off', markerShape: 'square'|'circle'|'diamond'|'plus'|'triangleDown'|'triangleUp'|'human'|'star'|'auto'|string, markerSize: number, svgClassName: string, svgStyle: object, value: number + } + } + namespace ojSparkChart { + type ItemContext = + { + borderColor: string, color: string, date: Date, high: number, low: number, value: number + } + } + namespace ojSparkChart { + type ReferenceObject = + { + color?: string, high?: number, lineWidth?: number, lineStyle: 'dotted'|'dashed'|'solid', location: 'front'|'back', low?: number, svgClassName?: string, svgStyle?: object, type: 'area'|'line', value?: number + } + } + namespace ojSparkChart { + type TooltipContext = + { + color: string, componentElement: Element, parentElement: Element + } + } + +} +declare namespace oj { + class ojSparkChartItem extends JetElement { + borderColor: string; + color: string; + date: string; + high: number|null; + low: number|null; + markerDisplayed: 'off'|'on'; + markerShape: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'; + markerSize: number; + svgClassName: string; + svgStyle: object; + value: number|null; + onBorderColorChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onDateChanged: (event: CustomEvent)=> any; + onHighChanged: (event: CustomEvent)=> any; + onLowChanged: (event: CustomEvent)=> any; + onMarkerDisplayedChanged: (event: CustomEvent)=> any; + onMarkerShapeChanged: (event: CustomEvent)=> any; + onMarkerSizeChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSparkChartItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojSparkChartItemEventMap extends oj.JetElementEventMap { + 'borderColorChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'dateChanged': CustomEvent; + 'highChanged': CustomEvent; + 'lowChanged': CustomEvent; + 'markerDisplayedChanged': CustomEvent; + 'markerShapeChanged': CustomEvent; + 'markerSizeChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojSparkChartItemSettableProperties extends JetSettableProperties { + borderColor: string; + color: string; + date: string; + high: number|null; + low: number|null; + markerDisplayed: 'off'|'on'; + markerShape: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'; + markerSize: number; + svgClassName: string; + svgStyle: object; + value: number|null; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts b/types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts new file mode 100644 index 0000000000..6972efe009 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts @@ -0,0 +1,47 @@ +/// +declare namespace oj { + class ojCheckboxset extends editableValue, ojCheckboxsetSettableProperties> { + disabled: boolean; + labelledBy: string|null; + required: boolean; + value: Array; + translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + onDisabledChanged: (event: CustomEvent)=> any; + onLabelledByChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojCheckboxset.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojCheckboxset.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojCheckboxsetEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + validate(): Promise; + } + namespace ojCheckboxset { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojCheckboxsetEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojCheckboxset.ojAnimateEnd; + 'ojAnimateStart': oj.ojCheckboxset.ojAnimateStart; + 'disabledChanged': CustomEvent; + 'labelledByChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojCheckboxsetSettableProperties extends editableValueSettableProperties> { + disabled: boolean; + labelledBy: string|null; + required: boolean; + value: Array; + translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts b/types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts new file mode 100644 index 0000000000..4784d83c1c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts @@ -0,0 +1,52 @@ +/// +declare namespace oj { + class ojCollapsible extends baseComponent { + disabled: boolean; + expandArea: 'header'|'disclosureIcon'; + expanded: boolean; + onDisabledChanged: (event: CustomEvent)=> any; + onExpandAreaChanged: (event: CustomEvent)=> any; + onExpandedChanged: (event: CustomEvent)=> any; + onOjBeforeCollapse: (event: oj.ojCollapsible.ojBeforeCollapse)=> any; + onOjBeforeExpand: (event: oj.ojCollapsible.ojBeforeExpand)=> any; + onOjCollapse: (event: oj.ojCollapsible.ojCollapse)=> any; + onOjExpand: (event: oj.ojCollapsible.ojExpand)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojCollapsibleEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + } + namespace ojCollapsible { + class ojBeforeCollapse extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { + + } + + class ojBeforeExpand extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { + + } + + class ojCollapse extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { + + } + + class ojExpand extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { + + } + } + interface ojCollapsibleEventMap extends oj.baseComponentEventMap { + 'ojBeforeCollapse': oj.ojCollapsible.ojBeforeCollapse; + 'ojBeforeExpand': oj.ojCollapsible.ojBeforeExpand; + 'ojCollapse': oj.ojCollapsible.ojCollapse; + 'ojExpand': oj.ojCollapsible.ojExpand; + 'disabledChanged': CustomEvent; + 'expandAreaChanged': CustomEvent; + 'expandedChanged': CustomEvent; + } + interface ojCollapsibleSettableProperties extends baseComponentSettableProperties { + disabled: boolean; + expandArea: 'header'|'disclosureIcon'; + expanded: boolean; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts new file mode 100644 index 0000000000..08bd5b25c8 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts @@ -0,0 +1,17 @@ +/// +declare namespace oj { + class CollectionDataProvider implements DataProvider { + constructor(collection: oj.Collection); + addEventListener(eventType: string, listener: EventListener): void + containsKeys(params: FetchByKeysParameters): Promise> + dispatchEvent(evt: Event): boolean + fetchByKeys(params: FetchByKeysParameters): Promise> + fetchByOffset(params: FetchByOffsetParameters): Promise> + fetchFirst>(params?: FetchListParameters): AsyncIterable + getCapability(capabilityName?: string): any + getTotalSize(): Promise; + isEmpty(): 'yes'|'no'|'unknown'; + removeEventListener(eventType: string, listener: EventListener): void + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcolor/index.d.ts b/types/@oracle/oraclejet/ojs/ojcolor/index.d.ts new file mode 100644 index 0000000000..0c8397621c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcolor/index.d.ts @@ -0,0 +1,179 @@ +declare namespace oj { + class Color { + static ALICEBLUE: oj.Color; + static ANTIQUEWHITE: oj.Color; + static AQUA: oj.Color; + static AQUAMARINE: oj.Color; + static AZURE: oj.Color; + static BEIGE: oj.Color; + static BISQUE: oj.Color; + static BLACK: oj.Color; + static BLANCHEDALMOND: oj.Color; + static BLUE: oj.Color; + static BLUEVIOLET: oj.Color; + static BROWN: oj.Color; + static BURLYWOOD: oj.Color; + static CADETBLUE: oj.Color; + static CHARTREUSE: oj.Color; + static CHOCOLATE: oj.Color; + static CORAL: oj.Color; + static CORNFLOWERBLUE: oj.Color; + static CORNSILK: oj.Color; + static CRIMSON: oj.Color; + static CYAN: oj.Color; + static DARKBLUE: oj.Color; + static DARKCYAN: oj.Color; + static DARKGOLDENROD: oj.Color; + static DARKGRAY: oj.Color; + static DARKGREEN: oj.Color; + static DARKGREY: oj.Color; + static DARKKHAKI: oj.Color; + static DARKMAGENTA: oj.Color; + static DARKOLIVEGREEN: oj.Color; + static DARKORANGE: oj.Color; + static DARKORCHID: oj.Color; + static DARKRED: oj.Color; + static DARKSALMON: oj.Color; + static DARKSEAGREEN: oj.Color; + static DARKSLATEBLUE: oj.Color; + static DARKSLATEGRAY: oj.Color; + static DARKSLATEGREY: oj.Color; + static DARKTURQUOISE: oj.Color; + static DARKVIOLET: oj.Color; + static DEEPPINK: oj.Color; + static DEEPSKYBLUE: oj.Color; + static DIMGRAY: oj.Color; + static DIMGREY: oj.Color; + static DODGERBLUE: oj.Color; + static FIREBRICK: oj.Color; + static FLORALWHITE: oj.Color; + static FORESTGREEN: oj.Color; + static FUCHSIA: oj.Color; + static GAINSBORO: oj.Color; + static GHOSTWHITE: oj.Color; + static GOLD: oj.Color; + static GOLDENROD: oj.Color; + static GRAY: oj.Color; + static GREEN: oj.Color; + static GREENYELLOW: oj.Color; + static GREY: oj.Color; + static HONEYDEW: oj.Color; + static HOTPINK: oj.Color; + static INDIANRED: oj.Color; + static INDIGO: oj.Color; + static IVORY: oj.Color; + static KHAKI: oj.Color; + static LAVENDER: oj.Color; + static LAVENDERBLUSH: oj.Color; + static LAWNGREEN: oj.Color; + static LEMONCHIFFON: oj.Color; + static LIGHTBLUE: oj.Color; + static LIGHTCORAL: oj.Color; + static LIGHTCYAN: oj.Color; + static LIGHTGOLDENRODYELLOW: oj.Color; + static LIGHTGRAY: oj.Color; + static LIGHTGREEN: oj.Color; + static LIGHTGREY: oj.Color; + static LIGHTPINK: oj.Color; + static LIGHTSALMON: oj.Color; + static LIGHTSEAGREEN: oj.Color; + static LIGHTSKYBLUE: oj.Color; + static LIGHTSLATEGRAY: oj.Color; + static LIGHTSLATEGREY: oj.Color; + static LIGHTSTEELBLUE: oj.Color; + static LIGHTYELLOW: oj.Color; + static LIME: oj.Color; + static LIMEGREEN: oj.Color; + static LINEN: oj.Color; + static MAGENTA: oj.Color; + static MAROON: oj.Color; + static MEDIUMAQUAMARINE: oj.Color; + static MEDIUMBLUE: oj.Color; + static MEDIUMORCHID: oj.Color; + static MEDIUMPURPLE: oj.Color; + static MEDIUMSEAGREEN: oj.Color; + static MEDIUMSLATEBLUE: oj.Color; + static MEDIUMSPRINGGREEN: oj.Color; + static MEDIUMTURQUOISE: oj.Color; + static MEDIUMVIOLETRED: oj.Color; + static MIDNIGHTBLUE: oj.Color; + static MINTCREAM: oj.Color; + static MISTYROSE: oj.Color; + static MOCCASIN: oj.Color; + static NAVAJOWHITE: oj.Color; + static NAVY: oj.Color; + static OLDLACE: oj.Color; + static OLIVE: oj.Color; + static OLIVEDRAB: oj.Color; + static ORANGE: oj.Color; + static ORANGERED: oj.Color; + static ORCHID: oj.Color; + static PALEGOLDENROD: oj.Color; + static PALEGREEN: oj.Color; + static PALETURQUOISE: oj.Color; + static PALEVIOLETRED: oj.Color; + static PAPAYAWHIP: oj.Color; + static PEACHPUFF: oj.Color; + static PERU: oj.Color; + static PINK: oj.Color; + static PLUM: oj.Color; + static POWDERBLUE: oj.Color; + static PURPLE: oj.Color; + static REBECCAPURPLE: oj.Color; + static RED: oj.Color; + static ROSYBROWN: oj.Color; + static ROYALBLUE: oj.Color; + static SADDLEBROWN: oj.Color; + static SALMON: oj.Color; + static SANDYBROWN: oj.Color; + static SEAGREEN: oj.Color; + static SEASHELL: oj.Color; + static SIENNA: oj.Color; + static SILVER: oj.Color; + static SKYBLUE: oj.Color; + static SLATEBLUE: oj.Color; + static SLATEGRAY: oj.Color; + static SLATEGREY: oj.Color; + static SNOW: oj.Color; + static SPRINGGREEN: oj.Color; + static STEELBLUE: oj.Color; + static TAN: oj.Color; + static TEAL: oj.Color; + static THISTLE: oj.Color; + static TOMATO: oj.Color; + static TRANSPARENT: oj.Color; + static TURQUOISE: oj.Color; + static VIOLET: oj.Color; + static WHEAT: oj.Color; + static WHITE: oj.Color; + static WHITESMOKE: oj.Color; + static YELLOW: oj.Color; + static YELLOWGREEN: oj.Color; + constructor(color: string|oj.Color.RGBA|oj.Color.HSLA|oj.Color.HSVA); + getAlpha(): number; + getBlue(doNotRound?: boolean): number; + getGreen(doNotRound?: boolean): number; + getRed(doNotRound?: boolean): number; + isEqual(color: oj.Color): boolean; + toString(): string; + } + namespace Color { + type HSLA = + { + h: number, s: number, l: number, a?: number + } + } + namespace Color { + type HSVA = + { + h: number, s: number, v: number, a?: number + } + } + namespace Color { + type RGBA = + { + r: number, g: number, b: number, a?: number + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts b/types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts new file mode 100644 index 0000000000..34aaa0e23e --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts @@ -0,0 +1,56 @@ +/// +declare namespace oj { + class ojColorPalette extends editableValue { + labelDisplay: 'auto'|'off'; + labelledBy: string|null; + layout: 'grid'|'list'; + palette: Array<{color: oj.Color, label?: string}>; + swatchSize: 'xs'|'sm'|'lg'; + value: oj.Color; + translations: {labelNone?: string}; + onLabelDisplayChanged: (event: CustomEvent)=> any; + onLabelledByChanged: (event: CustomEvent)=> any; + onLayoutChanged: (event: CustomEvent)=> any; + onPaletteChanged: (event: CustomEvent)=> any; + onSwatchSizeChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojColorPalette.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojColorPalette.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojColorPaletteEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + setProperties(properties: object): any; + setProperty(property: string, value: any): any; + } + namespace ojColorPalette { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojColorPaletteEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojColorPalette.ojAnimateEnd; + 'ojAnimateStart': oj.ojColorPalette.ojAnimateStart; + 'labelDisplayChanged': CustomEvent; + 'labelledByChanged': CustomEvent; + 'layoutChanged': CustomEvent; + 'paletteChanged': CustomEvent; + 'swatchSizeChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojColorPaletteSettableProperties extends editableValueSettableProperties { + labelDisplay: 'auto'|'off'; + labelledBy: string|null; + layout: 'grid'|'list'; + palette: Array<{color: oj.Color, label?: string}>; + swatchSize: 'xs'|'sm'|'lg'; + value: oj.Color; + translations: {labelNone?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts b/types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts new file mode 100644 index 0000000000..f5e8308c9c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts @@ -0,0 +1,44 @@ +/// +declare namespace oj { + class ojColorSpectrum extends editableValue { + labelledBy: string|null; + readonly transientValue: oj.Color; + value: oj.Color; + translations: {labelHue?: string, labelOpacity?: string, labelSatLum?: string, labelThumbDesc?: string}; + onLabelledByChanged: (event: CustomEvent)=> any; + onTransientValueChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojColorSpectrum.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojColorSpectrum.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojColorSpectrumEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + setProperties(properties: object): any; + setProperty(property: string, value: any): any; + } + namespace ojColorSpectrum { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojColorSpectrumEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojColorSpectrum.ojAnimateEnd; + 'ojAnimateStart': oj.ojColorSpectrum.ojAnimateStart; + 'labelledByChanged': CustomEvent; + 'transientValueChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojColorSpectrumSettableProperties extends editableValueSettableProperties { + labelledBy: string|null; + readonly transientValue: oj.Color; + value: oj.Color; + translations: {labelHue?: string, labelOpacity?: string, labelSatLum?: string, labelThumbDesc?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts b/types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts new file mode 100644 index 0000000000..0bb4197939 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts @@ -0,0 +1,31 @@ +declare namespace oj { + abstract class baseComponent extends JetElement { + translations: object|null; + + onTranslationsChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: baseComponentEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + refresh(): void; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface baseComponentEventMap extends oj.JetElementEventMap { + 'translationsChanged': CustomEvent; + } + interface baseComponentSettableProperties extends JetSettableProperties { + translations: object|null; + } + +} +declare namespace oj { + class Components { + static subtreeAttached(node: Element): void; + static subtreeDetached(node: Element): void; + static subtreeHidden(node: Element): void; + static subtreeShown(node: Element, options?: {initialRender: boolean}): void; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts b/types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts new file mode 100644 index 0000000000..aeb13c443b --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts @@ -0,0 +1,31 @@ +declare namespace oj { + namespace Composite { + function getComponentMetadata(name: string): oj.Composite.Metadata|null; + function register(name: string, descriptor: {metadata: oj.Composite.Metadata, view: string, viewModel: ((param0: oj.Composite.ViewModelContext)=> void|object), parseFunction: ((value: string, name: string, meta: Object, defaultParseFunction: (value: string)=> any)=>any)}): void; + } + namespace Composite { + type Metadata = + { + name: string, version: string, jetVersion: string, properties?: object, methods?: object, events?: object, slots?: object + } + } + namespace Composite { + type PropertyChangedContext = + { + property: string, value: any, previousValue: any, updatedFrom: 'external'|'internal', subproperty?: {path: string, value: any, previousValue: any} + } + } + namespace Composite { + type ViewModel = + { + activated: ((param0: oj.Composite.ViewModelContext)=> Promise|void), connected: ((param0: oj.Composite.ViewModelContext)=> void), bindingsApplied: ((param0: oj.Composite.ViewModelContext)=> void), propertyChanged: ((param0: oj.Composite.PropertyChangedContext)=> void), disconnected: ((param0: Element)=> void) + } + } + namespace Composite { + type ViewModelContext = + { + element: Element, properties: object, slotCounts: object, unique: string, uniqueId: string + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts b/types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts new file mode 100644 index 0000000000..f7463f449e --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts @@ -0,0 +1,23 @@ +/// +declare namespace oj { + class ojConveyorBelt extends baseComponent { + contentParent: string|null; + orientation: 'horizontal'|'vertical'; + onContentParentChanged: (event: CustomEvent)=> any; + onOrientationChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojConveyorBeltEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + } + interface ojConveyorBeltEventMap extends oj.baseComponentEventMap { + 'contentParentChanged': CustomEvent; + 'orientationChanged': CustomEvent; + } + interface ojConveyorBeltSettableProperties extends baseComponentSettableProperties { + contentParent: string|null; + orientation: 'horizontal'|'vertical'; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojcore/index.d.ts b/types/@oracle/oraclejet/ojs/ojcore/index.d.ts new file mode 100644 index 0000000000..2d23485157 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojcore/index.d.ts @@ -0,0 +1,123 @@ +declare namespace oj { + class BusyContext { + static applicationBootstrapComplete(): undefined; + static setDefaultTimeout(timeout: number): undefined; + addBusyState(options: {description: object|(()=> string)}): (()=> void); + clear(): undefined; + dump(message?: string): undefined; + getBusyStates(): Array<{id:string, description:string}>; + isReady(): boolean; + toString(): string; + whenReady(timeout?: number): Promise<(boolean|Error)>; + } + +} +declare namespace oj { + class Config { + static getAutomationMode(): string; + static getDeviceType(): 'phone'|'tablet'|'others'; + static getLocale(): string; + static getResourceUrl(relativePath: string): string; + static getVersionInfo(): string; + static logVersionInfo(): undefined; + static setAutomationMode(mode: string): undefined; + static setLocale(locale: string, callback?: (()=> void)): undefined; + static setResourceBaseUrl(baseUrl: string): undefined; + } + +} +declare namespace oj { + class Context { + static getContext(node: Element): oj.Context; + static getPageContext(): oj.Context; + getBusyContext(): oj.BusyContext; + } + +} +declare namespace oj { + class Logger { + static readonly LEVEL_ERROR: number; + static readonly LEVEL_INFO: number; + static readonly LEVEL_LOG: number; + static readonly LEVEL_NONE: number; + static readonly LEVEL_WARN: number; + static error(...args: (object|string|number)[]): void; + static info(...args: (object|string|number)[]): void; + static log(...args: (object|string|number)[]): void; + static option(key?: object|string, value?: any): any; + static warn(...args: (object|string|number)[]): void; + } + +} +declare namespace oj { + class Object { + constructor(); + static compareValues(obj1: any, obj2: any): boolean; + static copyPropertiesForClass(targetClass: object, source: object): void; + static createCallback(obj: object, func: object): ()=>any; + static createSubclass(extendingClass: object, baseClass: object, typeName?: string): void; + static ensureClassInitialization(clazz: object): void; + static getTypeName(): string; + static isEmpty(): boolean; + clone(): object; + equals(object: object): boolean; + getClass(otherInstance?: object): object; + getTypeName(clazz: object|null): string; + Init(): void; + toDebugString(): string; + toString(): string; + } + +} +declare namespace oj { + class ResponsiveUtils { + static compare(size1: oj.ResponsiveUtils.SCREEN_RANGE, size2: oj.ResponsiveUtils.SCREEN_RANGE): number; + static getFrameworkQuery(frameworkQueryKey: oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY): string|null; + } + namespace ResponsiveUtils { + enum FRAMEWORK_QUERY_KEY { + SM_UP = "sm-up", + MD_UP = "md-up", + LG_UP = "lg-up", + XL_UP = "xl-up", + XXL_UP = "xxl-up", + SM_ONLY = "sm-only", + MD_ONLY = "md-only", + LG_ONLY = "lg-only", + XL_ONLY = "xl-only", + MD_DOWN = "md-down", + LG_DOWN = "lg-down", + XL_DOWN = "xl-down", + HIGH_RESOLUTION = "high-resolution", + } + enum SCREEN_RANGE { + SM = "sm", + MD = "md", + LG = "lg", + XL = "xl", + XXL = "xxl", + } + } + + +} +declare namespace oj { + class ThemeUtils { + constructor(); + static clearCache(): void; + static getThemeName(): string|null; + static getThemeTargetPlatform(): string|null; + static parseJSONFromFontFamily(selector: string): any; + } + +} +declare namespace oj { + class Translations { + static applyParameters(pattern: string, parameters: object|Array): string|null; + static getComponentTranslations(componentName: string): object; + static getResource(key: string): object|string|null; + static getTranslatedString(key: string, ...var_args: (string|object|Array)[]): string; + static setBundle(bundle: object): void; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts new file mode 100644 index 0000000000..45cd10f459 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts @@ -0,0 +1,254 @@ +declare namespace oj { + interface AttributeFilterOperator { + attribute: string; + op: oj.AttributeFilterOperator.AttributeOperator; + value: any; + } + namespace AttributeFilterOperator { + enum AttributeOperator { + $co, + $eq, + $ew, + $pr, + $gt, + $ge, + $lt, + $le, + $ne, + $regex, + $sw, + } + } + + +} +declare namespace oj { + interface CompoundFilterOperator { + criteria: FilterOperator[]; + op: oj.CompoundFilterOperator.CompoundOperator; + } + namespace CompoundFilterOperator { + enum CompoundOperator { + $and, + $or, + } + } + + +} +declare namespace oj { + interface ContainsKeysResults { + containsParameters: FetchByKeysParameters; + results: Set; + } + +} +declare namespace oj { + interface DataMapping { + mapFields: (item: Item) => Item; + mapFilterCriterion?: (filterCriterion: FilterOperator[]) => FilterOperator[]; + mapSortCriteria?: (sortCriteria: SortCriterion[]) => SortCriterion[]; + unmapSortCriteria?: (sortCriteria: SortCriterion[]) => SortCriterion[]; + } + +} +declare namespace oj { + interface DataProvider extends EventTarget { + containsKeys(parameters : FetchByKeysParameters) : Promise> + fetchByKeys(parameters : FetchByKeysParameters) : Promise> + fetchByOffset(parameters: FetchByOffsetParameters): Promise> + fetchFirst(FetchListParameters?): AsyncIterable> + getCapability(capabilityName: string): any + getTotalSize(): Promise; + isEmpty(): 'yes' | 'no' | 'unknown' + } + +} +declare namespace oj { + interface DataProviderAddOperationEventDetail extends DataProviderOperationEventDetail { + afterKeys?: Set; + } + +} +declare namespace oj { + class DataProviderMutationEvent implements Event { + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; + NONE: number; + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + composed: boolean; + currentTarget: EventTarget; + deepPath: () => EventTarget[]; + defaultPrevented: boolean; + detail: DataProviderMutationEventDetail; + eventPhase: number; + initEvent: (eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean) => void; + isTrusted: boolean; + preventDefault: () => void; + returnValue: boolean; + scoped: boolean; + srcElement: Element|null; + stopImmediatePropagation: () => void; + stopPropagation: () => void; + target: EventTarget; + timeStamp: number; + type: string; + constructor(detail: DataProviderMutationEventDetail); + } + +} +declare namespace oj { + interface DataProviderMutationEventDetail { + add?: DataProviderAddOperationEventDetail; + remove?: DataProviderOperationEventDetail; + update?: DataProviderOperationEventDetail; + } + +} +declare namespace oj { + interface DataProviderOperationEventDetail { + data?: D[]; + indexes?: number[]; + keys: Set; + metadata?: ItemMetadata[]; + } + +} +declare namespace oj { + class DataProviderRefreshEvent implements Event { + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; + NONE: number; + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + composed: boolean; + currentTarget: EventTarget; + deepPath: () => EventTarget[]; + defaultPrevented: boolean; + eventPhase: number; + initEvent: (eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean) => void; + isTrusted: boolean; + preventDefault: () => void; + returnValue: boolean; + scoped: boolean; + srcElement: Element|null; + stopImmediatePropagation: () => void; + stopPropagation: () => void; + target: EventTarget; + timeStamp: number; + type: string; + constructor(); + } + +} +declare namespace oj { + interface FetchByKeysCapability { + implementation: 'iteration'|'lookup'; + } + +} +declare namespace oj { + class FetchByKeysMixin { + static applyMixin(derivedCtor: Function): any; + } + +} +declare namespace oj { + interface FetchByKeysParameters { + keys: Set; + } + +} +declare namespace oj { + interface FetchByKeysResults { + fetchParameters: FetchByKeysParameters; + results: Map>; + } + +} +declare namespace oj { + interface FetchByOffsetCapability { + implementation: 'iteration'|'randomAccess'; + } + +} +declare namespace oj { + class FetchByOffsetMixin { + static applyMixin(derivedCtor: Function): any; + } + +} +declare namespace oj { + interface FetchByOffsetParameters extends FetchListParameters { + offset: number; + } + +} +declare namespace oj { + interface FetchByOffsetResults { + done: boolean; + fetchParameters: FetchByOffsetParameters; + results: Array>; + } + +} +declare namespace oj { + interface FetchListParameters { + filterCriterion?: FilterOperator; + size: number; + sortCriteria?: SortCriterion[]; + } + +} +declare namespace oj { + interface FetchListResult { + data: D[]; + fetchParameters: FetchListParameters; + metadata: ItemMetadata[]; + } + +} +declare namespace oj { + interface FilterCapability { + operators: Array; + } + +} +declare namespace oj { + interface FilterOperator { + op: oj.AttributeFilterOperator.AttributeOperator|oj.CompoundFilterOperator.CompoundOperator; + filter(data: Array): Array; + } + +} +declare namespace oj { + interface Item { + data: D; + metadata: ItemMetadata; + } + +} +declare namespace oj { + interface ItemMetadata { + key: K; + } + +} +declare namespace oj { + interface SortCapability { + attributes: 'none'|'single'|'multiple'; + } + +} +declare namespace oj { + interface SortCriterion { + attribute: keyof D; + direction: string; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts b/types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts new file mode 100644 index 0000000000..707a963de7 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts @@ -0,0 +1,308 @@ +/// +/// +/// +declare namespace oj { + class ojDatePicker extends ojInputDate { + keyboardEdit: 'disabled'; + max: string|null; + min: string|null; + renderMode: 'jet'; + value: string; + onKeyboardEditChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onRenderModeChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojDatePicker.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojDatePicker.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDatePickerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojDatePicker { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojDatePickerEventMap extends oj.ojInputDateEventMap { + 'ojAnimateEnd': oj.ojDatePicker.ojAnimateEnd; + 'ojAnimateStart': oj.ojDatePicker.ojAnimateStart; + 'keyboardEditChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'renderModeChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojDatePickerSettableProperties extends ojInputDateSettableProperties { + keyboardEdit: 'disabled'; + max: string|null; + min: string|null; + renderMode: 'jet'; + value: string; + } + +} +declare namespace oj { + class ojDateTimePicker extends ojInputDateTime { + keyboardEdit: 'disabled'; + max: string|null; + min: string|null; + renderMode: 'jet'; + value: string; + onKeyboardEditChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onRenderModeChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojDateTimePicker.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojDateTimePicker.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDateTimePickerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojDateTimePicker { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojDateTimePickerEventMap extends oj.ojInputDateTimeEventMap { + 'ojAnimateEnd': oj.ojDateTimePicker.ojAnimateEnd; + 'ojAnimateStart': oj.ojDateTimePicker.ojAnimateStart; + 'keyboardEditChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'renderModeChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojDateTimePickerSettableProperties extends ojInputDateTimeSettableProperties { + keyboardEdit: 'disabled'; + max: string|null; + min: string|null; + renderMode: 'jet'; + value: string; + } + +} +declare namespace oj { + class ojInputDate extends inputBase { + converter: oj.Converter|oj.Validation.RegisteredConverter; + datePicker: {changeMonth: 'select'|'none', changeYear: 'select'|'none', currentMonthPos: number, daysOutsideMonth: 'hidden'|'visible'|'selectable', footerLayout: ''|'today', numberOfMonths: number, showOn: 'focus'|'image', stepBigMonths: number, stepMonths: 'numberOfMonths'|number, weekDisplay: 'number'|'none', yearRange: string}; + dayFormatter: (param: oj.ojInputDate.DayFormatterInput)=> (null|'all'|oj.ojInputDate.DayFormatterOutput); + dayMetaData: {[key:string]: {[key:string]: {[key:string]: {disabled?: boolean, className?: string, tooltip?: string}}}}; + keyboardEdit: 'enabled'|'disabled'; + max: string|null; + min: string|null; + pickerAttributes: {style?: string, class?: string}; + renderMode: 'jet'|'native'; + validators: Array|oj.Validation.RegisteredValidator>; + value: string; + translations: {currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; + onConverterChanged: (event: CustomEvent)=> any; + onDatePickerChanged: (event: CustomEvent)=> any; + onDayFormatterChanged: (event: CustomEvent)=> any; + onDayMetaDataChanged: (event: CustomEvent)=> any; + onKeyboardEditChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onPickerAttributesChanged: (event: CustomEvent)=> any; + onRenderModeChanged: (event: CustomEvent)=> any; + onValidatorsChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojInputDate.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojInputDate.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputDateEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + hide(): void; + refresh(): void; + show(): void; + } + namespace ojInputDate { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojInputDateEventMap extends oj.inputBaseEventMap { + 'ojAnimateEnd': oj.ojInputDate.ojAnimateEnd; + 'ojAnimateStart': oj.ojInputDate.ojAnimateStart; + 'converterChanged': CustomEvent; + 'datePickerChanged': CustomEvent; + 'dayFormatterChanged': CustomEvent; + 'dayMetaDataChanged': CustomEvent; + 'keyboardEditChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'pickerAttributesChanged': CustomEvent; + 'renderModeChanged': CustomEvent; + 'validatorsChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojInputDateSettableProperties extends inputBaseSettableProperties { + converter: oj.Converter|oj.Validation.RegisteredConverter; + datePicker: {changeMonth: 'select'|'none', changeYear: 'select'|'none', currentMonthPos: number, daysOutsideMonth: 'hidden'|'visible'|'selectable', footerLayout: ''|'today', numberOfMonths: number, showOn: 'focus'|'image', stepBigMonths: number, stepMonths: 'numberOfMonths'|number, weekDisplay: 'number'|'none', yearRange: string}; + dayFormatter: (param: oj.ojInputDate.DayFormatterInput)=> (null|'all'|oj.ojInputDate.DayFormatterOutput); + dayMetaData: {[key:string]: {[key:string]: {[key:string]: {disabled?: boolean, className?: string, tooltip?: string}}}}; + keyboardEdit: 'enabled'|'disabled'; + max: string|null; + min: string|null; + pickerAttributes: {style?: string, class?: string}; + renderMode: 'jet'|'native'; + validators: Array|oj.Validation.RegisteredValidator>; + value: string; + translations: {currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; + } + namespace ojInputDate { + type DayFormatterInput = + { + fullYear: number, month: number, date: number + } + } + namespace ojInputDate { + type DayFormatterOutput = + { + disabled?: boolean, className?: string, tooltip?: string + } + } + +} +declare namespace oj { + class ojInputDateTime extends ojInputDate { + converter: oj.Converter|oj.Validation.RegisteredConverter; + max: string|null; + min: string|null; + renderMode: 'jet'|'native'; + timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; + validators: Array|oj.Validation.RegisteredValidator>; + value: string; + translations: {cancel?: string, currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, done?: string, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; + onConverterChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onRenderModeChanged: (event: CustomEvent)=> any; + onTimePickerChanged: (event: CustomEvent)=> any; + onValidatorsChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojInputDateTime.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojInputDateTime.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputDateTimeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + hideTimePicker(): void; + show(): void; + showTimePicker(): void; + } + namespace ojInputDateTime { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojInputDateTimeEventMap extends oj.ojInputDateEventMap { + 'ojAnimateEnd': oj.ojInputDateTime.ojAnimateEnd; + 'ojAnimateStart': oj.ojInputDateTime.ojAnimateStart; + 'converterChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'renderModeChanged': CustomEvent; + 'timePickerChanged': CustomEvent; + 'validatorsChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojInputDateTimeSettableProperties extends ojInputDateSettableProperties { + converter: oj.Converter|oj.Validation.RegisteredConverter; + max: string|null; + min: string|null; + renderMode: 'jet'|'native'; + timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; + validators: Array|oj.Validation.RegisteredValidator>; + value: string; + translations: {cancel?: string, currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, done?: string, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; + } + +} +declare namespace oj { + class ojInputTime extends inputBase { + converter: oj.Converter|oj.Validation.RegisteredConverter; + keyboardEdit: 'enabled'|'disabled'; + max: string|null; + min: string|null; + pickerAttributes: {style?: string, class?: string}; + renderMode: 'jet'|'native'; + timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; + validators: Array|oj.Validation.RegisteredValidator>; + value: string; + translations: {ampmWheelLabel?: string, cancelText?: string, currentTimeText?: string, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, hourWheelLabel?: string, minuteWheelLabel?: string, okText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipTime?: string, tooltipTimeDisabled?: string}; + onConverterChanged: (event: CustomEvent)=> any; + onKeyboardEditChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onPickerAttributesChanged: (event: CustomEvent)=> any; + onRenderModeChanged: (event: CustomEvent)=> any; + onTimePickerChanged: (event: CustomEvent)=> any; + onValidatorsChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojInputTime.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojInputTime.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputTimeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + hide(): void; + refresh(): void; + show(): void; + } + namespace ojInputTime { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojInputTimeEventMap extends oj.inputBaseEventMap { + 'ojAnimateEnd': oj.ojInputTime.ojAnimateEnd; + 'ojAnimateStart': oj.ojInputTime.ojAnimateStart; + 'converterChanged': CustomEvent; + 'keyboardEditChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'pickerAttributesChanged': CustomEvent; + 'renderModeChanged': CustomEvent; + 'timePickerChanged': CustomEvent; + 'validatorsChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojInputTimeSettableProperties extends inputBaseSettableProperties { + converter: oj.Converter|oj.Validation.RegisteredConverter; + keyboardEdit: 'enabled'|'disabled'; + max: string|null; + min: string|null; + pickerAttributes: {style?: string, class?: string}; + renderMode: 'jet'|'native'; + timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; + validators: Array|oj.Validation.RegisteredValidator>; + value: string; + translations: {ampmWheelLabel?: string, cancelText?: string, currentTimeText?: string, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, hourWheelLabel?: string, minuteWheelLabel?: string, okText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipTime?: string, tooltipTimeDisabled?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojdefer/index.d.ts b/types/@oracle/oraclejet/ojs/ojdefer/index.d.ts new file mode 100644 index 0000000000..7672ac8a35 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojdefer/index.d.ts @@ -0,0 +1,13 @@ +declare namespace oj { + class ojDefer extends JetElement { + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDeferEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojDeferEventMap extends oj.JetElementEventMap { + } + interface ojDeferSettableProperties extends JetSettableProperties { + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts new file mode 100644 index 0000000000..0df017ec3c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts @@ -0,0 +1,17 @@ +/// +declare namespace oj { + class DeferredDataProvider implements DataProvider { + constructor(dataProvider: Promise>[], capabilityFunc: Function); + addEventListener(eventType: string, listener: EventListener): any; + containsKeys(params: FetchByKeysParameters): Promise> + dispatchEvent(evt: Event): boolean; + fetchByKeys(params: FetchByKeysParameters): Promise> + fetchByOffset(params: FetchByOffsetParameters): Promise> + fetchFirst>(params?: FetchListParameters): AsyncIterable + getCapability(capabilityName: string): object; + getTotalSize(): Promise; + isEmpty(): 'yes'|'no'|'unknown'; + removeEventListener(eventType: string, listener: EventListener): any; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojdialog/index.d.ts b/types/@oracle/oraclejet/ojs/ojdialog/index.d.ts new file mode 100644 index 0000000000..85ea4be39c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojdialog/index.d.ts @@ -0,0 +1,127 @@ +/// +declare namespace oj { + class ojDialog extends baseComponent { + cancelBehavior: 'icon'|'escape'|'none'; + dragAffordance: 'title-bar'|'none'; + initialVisibility: 'hide'|'show'; + modality: 'modal'|'modeless'; + position: oj.ojDialog.Position; + resizeBehavior: 'resizable'|'none'; + role: string; + translations: {labelCloseIcon?: string}; + onCancelBehaviorChanged: (event: CustomEvent)=> any; + onDragAffordanceChanged: (event: CustomEvent)=> any; + onInitialVisibilityChanged: (event: CustomEvent)=> any; + onModalityChanged: (event: CustomEvent)=> any; + onPositionChanged: (event: CustomEvent)=> any; + onResizeBehaviorChanged: (event: CustomEvent)=> any; + onRoleChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojDialog.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojDialog.ojAnimateStart)=> any; + onOjBeforeClose: (event: oj.ojDialog.ojBeforeClose)=> any; + onOjBeforeOpen: (event: oj.ojDialog.ojBeforeOpen)=> any; + onOjClose: (event: oj.ojDialog.ojClose)=> any; + onOjFocus: (event: oj.ojDialog.ojFocus)=> any; + onOjOpen: (event: oj.ojDialog.ojOpen)=> any; + onOjResize: (event: oj.ojDialog.ojResize)=> any; + onOjResizeStart: (event: oj.ojDialog.ojResizeStart)=> any; + onOjResizeStop: (event: oj.ojDialog.ojResizeStop)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDialogEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + close(): void; + isOpen(): boolean; + open(): void; + refresh(): void; + } + namespace ojDialog { + class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: 'open'|'close', element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeClose extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojBeforeOpen extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojClose extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojFocus extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojOpen extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojResize extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojResizeStart extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojResizeStop extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + } + interface ojDialogEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.ojDialog.ojAnimateEnd; + 'ojAnimateStart': oj.ojDialog.ojAnimateStart; + 'ojBeforeClose': oj.ojDialog.ojBeforeClose; + 'ojBeforeOpen': oj.ojDialog.ojBeforeOpen; + 'ojClose': oj.ojDialog.ojClose; + 'ojFocus': oj.ojDialog.ojFocus; + 'ojOpen': oj.ojDialog.ojOpen; + 'ojResize': oj.ojDialog.ojResize; + 'ojResizeStart': oj.ojDialog.ojResizeStart; + 'ojResizeStop': oj.ojDialog.ojResizeStop; + 'cancelBehaviorChanged': CustomEvent; + 'dragAffordanceChanged': CustomEvent; + 'initialVisibilityChanged': CustomEvent; + 'modalityChanged': CustomEvent; + 'positionChanged': CustomEvent; + 'resizeBehaviorChanged': CustomEvent; + 'roleChanged': CustomEvent; + } + interface ojDialogSettableProperties extends baseComponentSettableProperties { + cancelBehavior: 'icon'|'escape'|'none'; + dragAffordance: 'title-bar'|'none'; + initialVisibility: 'hide'|'show'; + modality: 'modal'|'modeless'; + position: oj.ojDialog.Position; + resizeBehavior: 'resizable'|'none'; + role: string; + translations: {labelCloseIcon?: string}; + } + namespace ojDialog { + type Position = + { + my?: oj.ojDialog.PositionAlign, at?: oj.ojDialog.PositionAlign, offset?: oj.ojDialog.PositionPoint, of?: string|oj.ojDialog.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'none' + } + } + namespace ojDialog { + type PositionAlign = + { + vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' + } + } + namespace ojDialog { + type PositionPoint = + { + x?: number, y?: number + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts b/types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts new file mode 100644 index 0000000000..9624749ed1 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts @@ -0,0 +1,20 @@ +/// +declare namespace oj { + abstract class dvtBaseComponent extends baseComponent { + trackResize: 'on'|'off'; + translations: {labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onTrackResizeChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: dvtBaseComponentEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface dvtBaseComponentEventMap extends oj.baseComponentEventMap { + 'trackResizeChanged': CustomEvent; + } + interface dvtBaseComponentSettableProperties extends baseComponentSettableProperties { + trackResize: 'on'|'off'; + translations: {labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts b/types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts new file mode 100644 index 0000000000..63176945d9 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts @@ -0,0 +1,67 @@ +/// +/// +declare namespace oj { + abstract class editableValue, SV= V, RV= V> extends baseComponent { + describedBy: string|null; + disabled: boolean; + displayOptions: {converterHint: Array<'placeholder'|'notewindow'|'none'>|'placeholder'|'notewindow'|'none', helpInstruction: Array<'notewindow'|'none'>|'notewindow'|'none', messages: Array<'inline'|'notewindow'|'none'>|'inline'|'notewindow'|'none', validatorHint: Array<'notewindow'|'none'>|'notewindow'|'none'}; + help: {instruction?: string}; + helpHints: {definition?: string, source?: string}; + labelHint: string; + messagesCustom: Array; + readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; + value: V; + onDescribedByChanged: (event: CustomEvent)=> any; + onDisabledChanged: (event: CustomEvent)=> any; + onDisplayOptionsChanged: (event: CustomEvent)=> any; + onHelpChanged: (event: CustomEvent)=> any; + onHelpHintsChanged: (event: CustomEvent)=> any; + onLabelHintChanged: (event: CustomEvent)=> any; + onMessagesCustomChanged: (event: CustomEvent)=> any; + onValidChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.editableValue.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.editableValue.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: editableValueEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + reset(): void; + showMessages(): void; + } + namespace editableValue { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface editableValueEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.editableValue.ojAnimateEnd; + 'ojAnimateStart': oj.editableValue.ojAnimateStart; + 'describedByChanged': CustomEvent; + 'disabledChanged': CustomEvent; + 'displayOptionsChanged': CustomEvent; + 'helpChanged': CustomEvent; + 'helpHintsChanged': CustomEvent; + 'labelHintChanged': CustomEvent; + 'messagesCustomChanged': CustomEvent; + 'validChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface editableValueSettableProperties extends baseComponentSettableProperties { + describedBy: string|null; + disabled: boolean; + displayOptions: {converterHint: Array<'placeholder'|'notewindow'|'none'>|'placeholder'|'notewindow'|'none', helpInstruction: Array<'notewindow'|'none'>|'notewindow'|'none', messages: Array<'inline'|'notewindow'|'none'>|'inline'|'notewindow'|'none', validatorHint: Array<'notewindow'|'none'>|'notewindow'|'none'}; + help: {instruction?: string}; + helpHints: {definition?: string, source?: string}; + labelHint: string; + messagesCustom: Array; + readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; + value: SV; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts b/types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts new file mode 100644 index 0000000000..dbcfec3632 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts @@ -0,0 +1,44 @@ +/// +/// +declare namespace oj { + interface FileUploadTransport { + flush(): void; + queue(fileList: FileList): Array; + } + +} +declare namespace oj { + class ojFilePicker extends JetElement { + accept: Array|null; + selectOn: 'auto'|'click'|'drop'|'clickAndDrop'; + selectionMode: 'multiple'|'single'; + onAcceptChanged: (event: CustomEvent)=> any; + onSelectOnChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onOjSelect: (event: oj.ojFilePicker.ojSelect)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojFilePickerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + namespace ojFilePicker { + class ojSelect extends CustomEvent<{files: FileList, [propName: string]: any}> { + + } + } + interface ojFilePickerEventMap extends oj.JetElementEventMap { + 'ojSelect': oj.ojFilePicker.ojSelect; + 'acceptChanged': CustomEvent; + 'selectOnChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + } + interface ojFilePickerSettableProperties extends JetSettableProperties { + accept: Array|null; + selectOn: 'auto'|'click'|'drop'|'clickAndDrop'; + selectionMode: 'multiple'|'single'; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts b/types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts new file mode 100644 index 0000000000..5287e1be53 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts @@ -0,0 +1,42 @@ +/// +declare namespace oj { + class ojFilmStrip extends baseComponent { + arrowPlacement: 'adjacent'|'overlay'; + arrowVisibility: 'visible'|'hidden'|'hover'|'auto'; + currentItem: {id?: string, index?: number}; + looping: 'off'|'page'; + maxItemsPerPage: number; + orientation: 'horizontal'|'vertical'; + translations: {labelAccArrowNextPage?: string, labelAccArrowPreviousPage?: string, labelAccFilmStrip?: string, tipArrowNextPage?: string, tipArrowPreviousPage?: string}; + onArrowPlacementChanged: (event: CustomEvent)=> any; + onArrowVisibilityChanged: (event: CustomEvent)=> any; + onCurrentItemChanged: (event: CustomEvent)=> any; + onLoopingChanged: (event: CustomEvent)=> any; + onMaxItemsPerPageChanged: (event: CustomEvent)=> any; + onOrientationChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojFilmStripEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getItemsPerPage(): number; + refresh(): void; + } + interface ojFilmStripEventMap extends oj.baseComponentEventMap { + 'arrowPlacementChanged': CustomEvent; + 'arrowVisibilityChanged': CustomEvent; + 'currentItemChanged': CustomEvent; + 'loopingChanged': CustomEvent; + 'maxItemsPerPageChanged': CustomEvent; + 'orientationChanged': CustomEvent; + } + interface ojFilmStripSettableProperties extends baseComponentSettableProperties { + arrowPlacement: 'adjacent'|'overlay'; + arrowVisibility: 'visible'|'hidden'|'hover'|'auto'; + currentItem: {id?: string, index?: number}; + looping: 'off'|'page'; + maxItemsPerPage: number; + orientation: 'horizontal'|'vertical'; + translations: {labelAccArrowNextPage?: string, labelAccArrowPreviousPage?: string, labelAccFilmStrip?: string, tipArrowNextPage?: string, tipArrowPreviousPage?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts b/types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts new file mode 100644 index 0000000000..4487a1baa7 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts @@ -0,0 +1,37 @@ +declare namespace oj { + class ojFormLayout extends JetElement { + direction: 'column'|'row'; + labelEdge: 'start'|'top'; + labelWidth: string; + labelWrapping: 'truncate'|'wrap'; + maxColumns: number; + onDirectionChanged: (event: CustomEvent)=> any; + onLabelEdgeChanged: (event: CustomEvent)=> any; + onLabelWidthChanged: (event: CustomEvent)=> any; + onLabelWrappingChanged: (event: CustomEvent)=> any; + onMaxColumnsChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojFormLayoutEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + refresh(): void; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojFormLayoutEventMap extends oj.JetElementEventMap { + 'directionChanged': CustomEvent; + 'labelEdgeChanged': CustomEvent; + 'labelWidthChanged': CustomEvent; + 'labelWrappingChanged': CustomEvent; + 'maxColumnsChanged': CustomEvent; + } + interface ojFormLayoutSettableProperties extends JetSettableProperties { + direction: 'column'|'row'; + labelEdge: 'start'|'top'; + labelWidth: string; + labelWrapping: 'truncate'|'wrap'; + maxColumns: number; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojgantt/index.d.ts b/types/@oracle/oraclejet/ojs/ojgantt/index.d.ts new file mode 100644 index 0000000000..86b2f26147 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojgantt/index.d.ts @@ -0,0 +1,286 @@ +/// +/// +declare namespace oj { + class ojGantt extends dvtTimeComponent> { + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + as: string; + axisPosition: 'bottom'|'top'; + dependencyData?: (oj.DataProvider); + dnd: {move?: {tasks?: 'disabled'|'enabled'}}; + end: string; + gridlines: {horizontal?: 'hidden'|'visible'|'auto', vertical?: 'hidden'|'visible'|'auto'}; + majorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; + minorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; + referenceObjects: Array; + rowAxis: {label?: {renderer: ((context: oj.ojGantt.RowAxisLabelRendererContext) => ({insert: Element}))}, maxWidth?: string, rendered?: 'on'|'off', width?: string}; + rowDefaults: {height?: number}; + scrollPosition: {offsetY?: number, rowIndex?: number, y?: number}; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + start: string; + taskData?: (oj.DataProvider); + taskDefaults: {baseline?: {borderRadius?: string, height?: number, svgClassName?: string, svgStyle?: object}, borderRadius?: string, height?: number, labelPosition?: (string|Array), progress?: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object}, svgClassName?: string, svgStyle?: object, type?: 'normal'|'milestone'|'summary'|'auto'}; + tooltip: {renderer: ((context: oj.ojGantt.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + valueFormats: {baselineDate?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineEnd?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineStart?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, date?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, end?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, label?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, progress?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, row?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, start?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}}; + viewportEnd: string; + viewportStart: string; + translations: {accessibleDependencyInfo?: string, accessiblePredecessorInfo?: string, accessibleSuccessorInfo?: string, accessibleTaskTypeMilestone?: string, accessibleTaskTypeSummary?: string, componentName?: string, finishFinishDependencyAriaDesc?: string, finishStartDependencyAriaDesc?: string, labelAndValue?: string, labelBaselineDate?: string, labelBaselineEnd?: string, labelBaselineStart?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelEnd?: string, labelInvalidData?: string, labelLabel?: string, labelMoveBy?: string, labelNoData?: string, labelProgress?: string, labelRow?: string, labelStart?: string, startFinishDependencyAriaDesc?: string, startStartDependencyAriaDesc?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, taskMoveCancelled?: string, taskMoveFinalized?: string, taskMoveInitiated?: string, taskMoveInitiatedInstruction?: string, taskMoveSelectionInfo?: string, tooltipZoomIn?: string, tooltipZoomOut?: string}; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onAxisPositionChanged: (event: CustomEvent)=> any; + onDependencyDataChanged: (event: CustomEvent)=> any; + onDndChanged: (event: CustomEvent)=> any; + onEndChanged: (event: CustomEvent)=> any; + onGridlinesChanged: (event: CustomEvent)=> any; + onMajorAxisChanged: (event: CustomEvent)=> any; + onMinorAxisChanged: (event: CustomEvent)=> any; + onReferenceObjectsChanged: (event: CustomEvent)=> any; + onRowAxisChanged: (event: CustomEvent)=> any; + onRowDefaultsChanged: (event: CustomEvent)=> any; + onScrollPositionChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onStartChanged: (event: CustomEvent)=> any; + onTaskDataChanged: (event: CustomEvent)=> any; + onTaskDefaultsChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onValueFormatsChanged: (event: CustomEvent)=> any; + onViewportEndChanged: (event: CustomEvent)=> any; + onViewportStartChanged: (event: CustomEvent)=> any; + onOjMove: (event: oj.ojGantt.ojMove)=> any; + onOjViewportChange: (event: oj.ojGantt.ojViewportChange)=> any; + + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojGanttEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): {subId: 'oj-gantt-row-label', index: number} | {subId: 'oj-gantt-taskbar', rowIndex: number, index: number} | null; + } + namespace ojGantt { + class ojMove extends CustomEvent<{taskContexts: Array<{data: oj.ojGantt.RowTask, rowData: oj.ojGantt.Row, itemData: D2|null, color: string}>, value: string, start: string, end: string, baselineStart: string, baselineEnd: string, rowContext: {rowData: oj.ojGantt.Row, componentElement: Element}, [propName: string]: any}> { + + } + + class ojViewportChange extends CustomEvent<{viewportStart: string, viewportEnd: string, majorAxisScale: string, minorAxisScale: string, [propName: string]: any}> { + + } + } + interface ojGanttEventMap extends oj.dvtTimeComponentEventMap { + 'ojMove': oj.ojGantt.ojMove; + 'ojViewportChange': oj.ojGantt.ojViewportChange; + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'asChanged': CustomEvent; + 'axisPositionChanged': CustomEvent; + 'dependencyDataChanged': CustomEvent; + 'dndChanged': CustomEvent; + 'endChanged': CustomEvent; + 'gridlinesChanged': CustomEvent; + 'majorAxisChanged': CustomEvent; + 'minorAxisChanged': CustomEvent; + 'referenceObjectsChanged': CustomEvent; + 'rowAxisChanged': CustomEvent; + 'rowDefaultsChanged': CustomEvent; + 'scrollPositionChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'startChanged': CustomEvent; + 'taskDataChanged': CustomEvent; + 'taskDefaultsChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'valueFormatsChanged': CustomEvent; + 'viewportEndChanged': CustomEvent; + 'viewportStartChanged': CustomEvent; + } + interface ojGanttSettableProperties extends dvtTimeComponentSettableProperties { + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + as: string; + axisPosition: 'bottom'|'top'; + dependencyData?: (oj.DataProvider); + dnd: {move?: {tasks?: 'disabled'|'enabled'}}; + end: string; + gridlines: {horizontal?: 'hidden'|'visible'|'auto', vertical?: 'hidden'|'visible'|'auto'}; + majorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; + minorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; + referenceObjects: Array; + rowAxis: {label?: {renderer: ((context: oj.ojGantt.RowAxisLabelRendererContext) => ({insert: Element}))}, maxWidth?: string, rendered?: 'on'|'off', width?: string}; + rowDefaults: {height?: number}; + scrollPosition: {offsetY?: number, rowIndex?: number, y?: number}; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + start: string; + taskData?: (oj.DataProvider); + taskDefaults: {baseline?: {borderRadius?: string, height?: number, svgClassName?: string, svgStyle?: object}, borderRadius?: string, height?: number, labelPosition?: (string|Array), progress?: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object}, svgClassName?: string, svgStyle?: object, type?: 'normal'|'milestone'|'summary'|'auto'}; + tooltip: {renderer: ((context: oj.ojGantt.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + valueFormats: {baselineDate?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineEnd?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineStart?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, date?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, end?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, label?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, progress?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, row?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, start?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}}; + viewportEnd: string; + viewportStart: string; + translations: {accessibleDependencyInfo?: string, accessiblePredecessorInfo?: string, accessibleSuccessorInfo?: string, accessibleTaskTypeMilestone?: string, accessibleTaskTypeSummary?: string, componentName?: string, finishFinishDependencyAriaDesc?: string, finishStartDependencyAriaDesc?: string, labelAndValue?: string, labelBaselineDate?: string, labelBaselineEnd?: string, labelBaselineStart?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelEnd?: string, labelInvalidData?: string, labelLabel?: string, labelMoveBy?: string, labelNoData?: string, labelProgress?: string, labelRow?: string, labelStart?: string, startFinishDependencyAriaDesc?: string, startStartDependencyAriaDesc?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, taskMoveCancelled?: string, taskMoveFinalized?: string, taskMoveInitiated?: string, taskMoveInitiatedInstruction?: string, taskMoveSelectionInfo?: string, tooltipZoomIn?: string, tooltipZoomOut?: string}; + } + namespace ojGantt { + type Dependency = + { + id: K1, predecessorTaskId: K2, shortDesc?: string, successorTaskId: K2, svgClassName?: string, svgStyle?: object, type?: 'startStart'|'startFinish'|'finishFinish'|'finishStart' + } + } + namespace ojGantt { + type ReferenceObject = + { + svgClassName?: string, svgStyle?: object, value?: string + } + } + namespace ojGantt { + type Row = + { + id?: any, label?: string, labelStyle?: object, tasks?: Array> + } + } + namespace ojGantt { + type RowAxisLabelRendererContext = + { + parentElement: Element, rowData: oj.ojGantt.Row, itemData: Array, componentElement: Element, maxWidth: number, maxHeight: number + } + } + namespace ojGantt { + type RowTask = + { + borderRadius?: string, end?: string, height?: number, id: K2, label?: string, labelPosition?: string|Array, labelStyle?: object, start?: string, shortDesc?: string, svgClassName?: string, svgStyle?: object, type?: 'normal'|'milestone'|'summary'|'auto', progress?: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object, value?: number}, baseline?: {borderRadius?: string, end?: string, height?: number, start?: string, svgClassName?: string, svgStyle?: object} + } + } + namespace ojGantt { + type TooltipContext = + { + parentElement: Element, data: oj.ojGantt.RowTask, rowData: oj.ojGantt.Row, itemData: D2, componentElement: Element, color: string + } + } + +} +declare namespace oj { + class ojGanttDependency extends JetElement { + predecessorTaskId: any; + shortDesc: string|null; + successorTaskId: any; + svgClassName: string; + svgStyle: object; + type: 'finishStart'|'finishFinish'|'startStart'|'startFinish'; + onPredecessorTaskIdChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSuccessorTaskIdChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttDependencyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojGanttDependencyEventMap extends oj.JetElementEventMap { + 'predecessorTaskIdChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'successorTaskIdChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'typeChanged': CustomEvent; + } + interface ojGanttDependencySettableProperties extends JetSettableProperties { + predecessorTaskId: any; + shortDesc: string|null; + successorTaskId: any; + svgClassName: string; + svgStyle: object; + type: 'finishStart'|'finishFinish'|'startStart'|'startFinish'; + } + +} +declare namespace oj { + class ojGanttRow extends JetElement { + label: string; + labelStyle: object; + onLabelChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttRowEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojGanttRowEventMap extends oj.JetElementEventMap { + 'labelChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + } + interface ojGanttRowSettableProperties extends JetSettableProperties { + label: string; + labelStyle: object; + } + +} +declare namespace oj { + class ojGanttTask extends JetElement { + baseline: {borderRadius?: string, end?: string, height?: number, start?: string, svgClassName?: string, svgStyle?: object}; + borderRadius: string; + end: string; + height: number|null; + label: string; + labelPosition: 'start'|'innerCenter'|'innerStart'|'innerEnd'|'end'|'none'; + labelStyle: object; + progress: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object, value?: number}; + rowId?: any; + shortDesc: string|null; + start: string; + svgClassName: string; + svgStyle: object; + type: 'normal'|'milestone'|'summary'|'auto'; + onBaselineChanged: (event: CustomEvent)=> any; + onBorderRadiusChanged: (event: CustomEvent)=> any; + onEndChanged: (event: CustomEvent)=> any; + onHeightChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onLabelPositionChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + onProgressChanged: (event: CustomEvent)=> any; + onRowIdChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onStartChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttTaskEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojGanttTaskEventMap extends oj.JetElementEventMap { + 'baselineChanged': CustomEvent; + 'borderRadiusChanged': CustomEvent; + 'endChanged': CustomEvent; + 'heightChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'labelPositionChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + 'progressChanged': CustomEvent; + 'rowIdChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'startChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'typeChanged': CustomEvent; + } + interface ojGanttTaskSettableProperties extends JetSettableProperties { + baseline: {borderRadius?: string, end?: string, height?: number, start?: string, svgClassName?: string, svgStyle?: object}; + borderRadius: string; + end: string; + height: number|null; + label: string; + labelPosition: 'start'|'innerCenter'|'innerStart'|'innerEnd'|'end'|'none'; + labelStyle: object; + progress: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object, value?: number}; + rowId?: any; + shortDesc: string|null; + start: string; + svgClassName: string; + svgStyle: object; + type: 'normal'|'milestone'|'summary'|'auto'; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojgauge/index.d.ts b/types/@oracle/oraclejet/ojs/ojgauge/index.d.ts new file mode 100644 index 0000000000..0c3efab804 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojgauge/index.d.ts @@ -0,0 +1,347 @@ +/// +declare namespace oj { + abstract class dvtBaseGauge extends dvtBaseComponent { + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + + addEventListener(type: T, listener: (this: HTMLElement, ev: dvtBaseGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface dvtBaseGaugeEventMap extends oj.dvtBaseComponentEventMap { + } + interface dvtBaseGaugeSettableProperties extends dvtBaseComponentSettableProperties { + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + +} +declare namespace oj { + class ojLedGauge extends dvtBaseGauge { + borderColor: string; + color: string; + label: {style?: object, text?: string}; + max: number; + metricLabel: {converter?: Converter, rendered?: 'on'|'off', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; + min: number; + rotation: 90|180|270|0; + size: number; + svgClassName: string; + svgStyle: object; + thresholds: Array; + tooltip: {renderer: ((context: oj.ojLedGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + type: 'arrow'|'diamond'|'square'|'rectangle'|'triangle'|'star'|'human'|'circle'; + value: number|null; + visualEffects: 'none'|'auto'; + onBorderColorChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMetricLabelChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onRotationChanged: (event: CustomEvent)=> any; + onSizeChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onThresholdsChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onVisualEffectsChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLedGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getMetricLabel(): string; + } + interface ojLedGaugeEventMap extends oj.dvtBaseGaugeEventMap { + 'borderColorChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'metricLabelChanged': CustomEvent; + 'minChanged': CustomEvent; + 'rotationChanged': CustomEvent; + 'sizeChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'thresholdsChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'typeChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'visualEffectsChanged': CustomEvent; + } + interface ojLedGaugeSettableProperties extends dvtBaseGaugeSettableProperties { + borderColor: string; + color: string; + label: {style?: object, text?: string}; + max: number; + metricLabel: {converter?: Converter, rendered?: 'on'|'off', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; + min: number; + rotation: 90|180|270|0; + size: number; + svgClassName: string; + svgStyle: object; + thresholds: Array; + tooltip: {renderer: ((context: oj.ojLedGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + type: 'arrow'|'diamond'|'square'|'rectangle'|'triangle'|'star'|'human'|'circle'; + value: number|null; + visualEffects: 'none'|'auto'; + } + namespace ojLedGauge { + type Threshold = + { + borderColor?: string, color?: string, max?: number, shortDesc?: string + } + } + namespace ojLedGauge { + type TooltipContext = + { + color: string, componentElement: Element, label: string, parentElement: Element + } + } + +} +declare namespace oj { + class ojRatingGauge extends dvtBaseGauge { + changed: boolean; + changedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + hoverState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + max: number; + min: number; + orientation: 'vertical'|'horizontal'; + preserveAspectRatio: 'none'|'meet'; + readonly: boolean; + selectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + step: 0.5|1; + thresholds: Array; + tooltip: {renderer: ((context: oj.ojRatingGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + readonly transientValue: number|null; + unselectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + value: number|null; + visualEffects: 'none'|'auto'; + onChangedChanged: (event: CustomEvent)=> any; + onChangedStateChanged: (event: CustomEvent)=> any; + onHoverStateChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onOrientationChanged: (event: CustomEvent)=> any; + onPreserveAspectRatioChanged: (event: CustomEvent)=> any; + onReadonlyChanged: (event: CustomEvent)=> any; + onSelectedStateChanged: (event: CustomEvent)=> any; + onStepChanged: (event: CustomEvent)=> any; + onThresholdsChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTransientValueChanged: (event: CustomEvent)=> any; + onUnselectedStateChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onVisualEffectsChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojRatingGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojRatingGaugeEventMap extends oj.dvtBaseGaugeEventMap { + 'changedChanged': CustomEvent; + 'changedStateChanged': CustomEvent; + 'hoverStateChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'orientationChanged': CustomEvent; + 'preserveAspectRatioChanged': CustomEvent; + 'readonlyChanged': CustomEvent; + 'selectedStateChanged': CustomEvent; + 'stepChanged': CustomEvent; + 'thresholdsChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'transientValueChanged': CustomEvent; + 'unselectedStateChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'visualEffectsChanged': CustomEvent; + } + interface ojRatingGaugeSettableProperties extends dvtBaseGaugeSettableProperties { + changed: boolean; + changedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + hoverState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + max: number; + min: number; + orientation: 'vertical'|'horizontal'; + preserveAspectRatio: 'none'|'meet'; + readonly: boolean; + selectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + step: 0.5|1; + thresholds: Array; + tooltip: {renderer: ((context: oj.ojRatingGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + readonly transientValue: number|null; + unselectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; + value: number|null; + visualEffects: 'none'|'auto'; + } + namespace ojRatingGauge { + type Threshold = + { + borderColor?: string, color?: string, max?: number, shortDesc?: string + } + } + namespace ojRatingGauge { + type TooltipContext = + { + color: string, componentElement: Element, label: string, parentElement: Element + } + } + +} +declare namespace oj { + class ojStatusMeterGauge extends dvtBaseGauge { + angleExtent: number; + animationDuration?: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + borderColor: string; + borderRadius: string; + center: {renderer: ((context: oj.ojStatusMeterGauge.CenterContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + color: string; + indicatorSize: number; + innerRadius: number; + label: {position?: 'center'|'start'|'auto', style?: object, text?: string}; + max: number; + metricLabel: {converter?: Converter, position?: 'center'|'insideIndicatorEdge'|'outsideIndicatorEdge'|'outsidePlotArea'|'withLabel'|'auto', rendered?: 'on'|'off'|'auto', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; + min: number; + orientation: 'circular'|'vertical'|'horizontal'; + plotArea: {borderColor?: string, borderRadius?: string, color?: string, rendered?: 'on'|'off'|'auto', svgClassName?: string, svgStyle?: object}; + readonly: boolean; + referenceLines: Array; + startAngle: number; + step: number|null; + svgClassName: string; + svgStyle: object; + thresholdDisplay: 'currentOnly'|'all'|'onIndicator'; + thresholds: Array; + tooltip: {renderer: ((context: oj.ojStatusMeterGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + readonly transientValue: number|null; + value: number|null; + visualEffects: 'none'|'auto'; + onAngleExtentChanged: (event: CustomEvent)=> any; + onAnimationDurationChanged: (event: CustomEvent)=> any; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onBorderColorChanged: (event: CustomEvent)=> any; + onBorderRadiusChanged: (event: CustomEvent)=> any; + onCenterChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onIndicatorSizeChanged: (event: CustomEvent)=> any; + onInnerRadiusChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMetricLabelChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onOrientationChanged: (event: CustomEvent)=> any; + onPlotAreaChanged: (event: CustomEvent)=> any; + onReadonlyChanged: (event: CustomEvent)=> any; + onReferenceLinesChanged: (event: CustomEvent)=> any; + onStartAngleChanged: (event: CustomEvent)=> any; + onStepChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onThresholdDisplayChanged: (event: CustomEvent)=> any; + onThresholdsChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTransientValueChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onVisualEffectsChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojStatusMeterGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getMetricLabel(): string; + } + interface ojStatusMeterGaugeEventMap extends oj.dvtBaseGaugeEventMap { + 'angleExtentChanged': CustomEvent; + 'animationDurationChanged': CustomEvent; + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'borderColorChanged': CustomEvent; + 'borderRadiusChanged': CustomEvent; + 'centerChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'indicatorSizeChanged': CustomEvent; + 'innerRadiusChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'metricLabelChanged': CustomEvent; + 'minChanged': CustomEvent; + 'orientationChanged': CustomEvent; + 'plotAreaChanged': CustomEvent; + 'readonlyChanged': CustomEvent; + 'referenceLinesChanged': CustomEvent; + 'startAngleChanged': CustomEvent; + 'stepChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'thresholdDisplayChanged': CustomEvent; + 'thresholdsChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'transientValueChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'visualEffectsChanged': CustomEvent; + } + interface ojStatusMeterGaugeSettableProperties extends dvtBaseGaugeSettableProperties { + angleExtent: number; + animationDuration?: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + borderColor: string; + borderRadius: string; + center: {renderer: ((context: oj.ojStatusMeterGauge.CenterContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + color: string; + indicatorSize: number; + innerRadius: number; + label: {position?: 'center'|'start'|'auto', style?: object, text?: string}; + max: number; + metricLabel: {converter?: Converter, position?: 'center'|'insideIndicatorEdge'|'outsideIndicatorEdge'|'outsidePlotArea'|'withLabel'|'auto', rendered?: 'on'|'off'|'auto', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; + min: number; + orientation: 'circular'|'vertical'|'horizontal'; + plotArea: {borderColor?: string, borderRadius?: string, color?: string, rendered?: 'on'|'off'|'auto', svgClassName?: string, svgStyle?: object}; + readonly: boolean; + referenceLines: Array; + startAngle: number; + step: number|null; + svgClassName: string; + svgStyle: object; + thresholdDisplay: 'currentOnly'|'all'|'onIndicator'; + thresholds: Array; + tooltip: {renderer: ((context: oj.ojStatusMeterGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + readonly transientValue: number|null; + value: number|null; + visualEffects: 'none'|'auto'; + } + namespace ojStatusMeterGauge { + type Bounds = + { + x: number, y: number, width: number, height: number + } + } + namespace ojStatusMeterGauge { + type CenterContext = + { + componentElement: Element, innerBounds: oj.ojStatusMeterGauge.Bounds, metricLabel: string, outerBounds: oj.ojStatusMeterGauge.Bounds + } + } + namespace ojStatusMeterGauge { + type ReferenceLine = + { + color?: string, value?: number + } + } + namespace ojStatusMeterGauge { + type Threshold = + { + borderColor?: string, color?: string, max?: number, shortDesc?: string + } + } + namespace ojStatusMeterGauge { + type TooltipContext = + { + color: string, componentElement: Element, label: string, parentElement: Element + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojindexer/index.d.ts b/types/@oracle/oraclejet/ojs/ojindexer/index.d.ts new file mode 100644 index 0000000000..49b10e2bfa --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojindexer/index.d.ts @@ -0,0 +1,13 @@ +declare namespace oj { + interface IndexerModel { + getIndexableSections(): Array|Array; + getMissingSections(): Array|Array; + setSection(section: string|object): Promise|Promise; + } + var IndexerModel: { + prototype: IndexerModel; + + SECTION_OTHERS: {id: string, label: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts b/types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts new file mode 100644 index 0000000000..ea03d4c8d3 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts @@ -0,0 +1,95 @@ +/// +/// +/// +declare namespace oj { + class ojInputNumber extends editableValue { + asyncValidators: Array>; + autocomplete: 'on'|'off'|string; + autofocus: boolean; + converter: oj.Converter|oj.Validation.RegisteredConverter; + max: number|null; + min: number|null; + name: string; + placeholder: string|null; + readonly rawValue: string; + readonly: boolean|null; + required: boolean; + step: number|null; + validators: Array|oj.Validation.RegisteredValidator>; + value: number|null; + virtualKeyboard: 'auto'|'number'|'text'; + translations: {numberRange?: {hint?: {exact?: string, inRange?: string, max?: string, min?: string}, messageDetail?: {exact?: string, rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipDecrement?: string, tooltipIncrement?: string}; + onAsyncValidatorsChanged: (event: CustomEvent)=> any; + onAutocompleteChanged: (event: CustomEvent)=> any; + onAutofocusChanged: (event: CustomEvent)=> any; + onConverterChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onNameChanged: (event: CustomEvent)=> any; + onPlaceholderChanged: (event: CustomEvent)=> any; + onRawValueChanged: (event: CustomEvent)=> any; + onReadonlyChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onStepChanged: (event: CustomEvent)=> any; + onValidatorsChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onVirtualKeyboardChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojInputNumber.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojInputNumber.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputNumberEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + stepDown(steps?: number): void; + stepUp(steps?: number): void; + validate(): Promise; + } + namespace ojInputNumber { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojInputNumberEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojInputNumber.ojAnimateEnd; + 'ojAnimateStart': oj.ojInputNumber.ojAnimateStart; + 'asyncValidatorsChanged': CustomEvent; + 'autocompleteChanged': CustomEvent; + 'autofocusChanged': CustomEvent; + 'converterChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'nameChanged': CustomEvent; + 'placeholderChanged': CustomEvent; + 'rawValueChanged': CustomEvent; + 'readonlyChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'stepChanged': CustomEvent; + 'validatorsChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'virtualKeyboardChanged': CustomEvent; + } + interface ojInputNumberSettableProperties extends editableValueSettableProperties { + asyncValidators: Array>; + autocomplete: 'on'|'off'|string; + autofocus: boolean; + converter: oj.Converter|oj.Validation.RegisteredConverter; + max: number|null; + min: number|null; + name: string; + placeholder: string|null; + readonly rawValue: string; + readonly: boolean|null; + required: boolean; + step: number|null; + validators: Array|oj.Validation.RegisteredValidator>; + value: number|null; + virtualKeyboard: 'auto'|'number'|'text'; + translations: {numberRange?: {hint?: {exact?: string, inRange?: string, max?: string, min?: string}, messageDetail?: {exact?: string, rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipDecrement?: string, tooltipIncrement?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts b/types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts new file mode 100644 index 0000000000..248bf14f58 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts @@ -0,0 +1,178 @@ +/// +/// +/// +/// +declare namespace oj { + abstract class inputBase, SV= V, RV= V> extends editableValue { + asyncValidators: Array>; + autocomplete: 'on'|'off'|string; + autofocus: boolean; + name: string; + placeholder: string; + readonly rawValue: RV; + readonly: boolean; + required: boolean; + validators: Array|oj.Validation.RegisteredValidator>|null; + translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + onAsyncValidatorsChanged: (event: CustomEvent)=> any; + onAutocompleteChanged: (event: CustomEvent)=> any; + onAutofocusChanged: (event: CustomEvent)=> any; + onNameChanged: (event: CustomEvent)=> any; + onPlaceholderChanged: (event: CustomEvent)=> any; + onRawValueChanged: (event: CustomEvent)=> any; + onReadonlyChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onValidatorsChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.inputBase.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.inputBase.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: inputBaseEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + validate(): Promise<'valid'|'invalid'>; + } + namespace inputBase { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface inputBaseEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.inputBase.ojAnimateEnd; + 'ojAnimateStart': oj.inputBase.ojAnimateStart; + 'asyncValidatorsChanged': CustomEvent; + 'autocompleteChanged': CustomEvent; + 'autofocusChanged': CustomEvent; + 'nameChanged': CustomEvent; + 'placeholderChanged': CustomEvent; + 'rawValueChanged': CustomEvent; + 'readonlyChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'validatorsChanged': CustomEvent; + } + interface inputBaseSettableProperties extends editableValueSettableProperties { + asyncValidators: Array>; + autocomplete: 'on'|'off'|string; + autofocus: boolean; + name: string; + placeholder: string; + readonly rawValue: RV; + readonly: boolean; + required: boolean; + validators: Array|oj.Validation.RegisteredValidator>|null; + translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + } + +} +declare namespace oj { + class ojInputPassword extends inputBase { + value: string|null; + translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojInputPassword.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojInputPassword.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputPasswordEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojInputPassword { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojInputPasswordEventMap extends oj.inputBaseEventMap { + 'ojAnimateEnd': oj.ojInputPassword.ojAnimateEnd; + 'ojAnimateStart': oj.ojInputPassword.ojAnimateStart; + 'valueChanged': CustomEvent; + } + interface ojInputPasswordSettableProperties extends inputBaseSettableProperties { + value: string|null; + translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + } + +} +declare namespace oj { + class ojInputText extends inputBase { + clearIcon: 'never'|'always'|'conditional'; + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + list: string; + virtualKeyboard: 'auto'|'email'|'number'|'search'|'tel'|'text'|'url'; + onClearIconChanged: (event: CustomEvent)=> any; + onConverterChanged: (event: CustomEvent)=> any; + onListChanged: (event: CustomEvent)=> any; + onVirtualKeyboardChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojInputText.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojInputText.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputTextEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojInputText { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojInputTextEventMap extends oj.inputBaseEventMap { + 'ojAnimateEnd': oj.ojInputText.ojAnimateEnd; + 'ojAnimateStart': oj.ojInputText.ojAnimateStart; + 'clearIconChanged': CustomEvent; + 'converterChanged': CustomEvent; + 'listChanged': CustomEvent; + 'virtualKeyboardChanged': CustomEvent; + } + interface ojInputTextSettableProperties extends inputBaseSettableProperties { + clearIcon: 'never'|'always'|'conditional'; + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + list: string; + virtualKeyboard: 'auto'|'email'|'number'|'search'|'tel'|'text'|'url'; + } + +} +declare namespace oj { + class ojTextArea extends inputBase { + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + rows: number; + onConverterChanged: (event: CustomEvent)=> any; + onRowsChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojTextArea.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojTextArea.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTextAreaEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojTextArea { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojTextAreaEventMap extends oj.inputBaseEventMap { + 'ojAnimateEnd': oj.ojTextArea.ojAnimateEnd; + 'ojAnimateStart': oj.ojTextArea.ojAnimateStart; + 'converterChanged': CustomEvent; + 'rowsChanged': CustomEvent; + } + interface ojTextAreaSettableProperties extends inputBaseSettableProperties { + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + rows: number; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts b/types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts new file mode 100644 index 0000000000..f6608c7f7d --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts @@ -0,0 +1,32 @@ +export class ExpandAllKeySet extends KeySet { + constructor(); + add(keys: Set|Array): ExpandAllKeySet + addAll(): ExpandAllKeySet + clear(): ExpandedKeySet + delete(keys: Set|Array): ExpandAllKeySet + deletedValues(): Set; + has(): ExpandAllKeySet + isAddAll(): boolean; + } + +export class ExpandedKeySet extends KeySet { + constructor(keys?: Set|Array); + add(keys: Set|Array): ExpandedKeySet + addAll(): ExpandAllKeySet + clear(): ExpandedKeySet + delete(keys: Set|Array): ExpandedKeySet + has(key: K): boolean; + isAddAll(): boolean; + values(): Set; + } + +export abstract class KeySet { + abstract add>(keys: Set|Array): KS + abstract addAll>(): KS + abstract clear>(): KS + abstract delete>(keys: Set|Array): KS + abstract has(key: K): boolean; + abstract isAddAll(): boolean; + } + + export as namespace KeySet; diff --git a/types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts b/types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts new file mode 100644 index 0000000000..71d1945a6c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts @@ -0,0 +1,9 @@ +/// +export class ObservableExpandedKeySet { + constructor(initialValue?: KeySet.ExpandedKeySet|KeySet.ExpandAllKeySet); + add(keys: Set|Array): ObservableExpandedKeySet; + addAll(): ObservableExpandedKeySet; + clear(): ObservableExpandedKeySet; + delete(keys: Set|Array): ObservableExpandedKeySet; + } + diff --git a/types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts b/types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts new file mode 100644 index 0000000000..21bf95f0dc --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts @@ -0,0 +1,7 @@ +/// +declare namespace oj { + class KnockoutUtils { + static map(m: object, callback?: ((param0: object)=> void), array?: boolean): Array>|KnockoutObservableArray; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojknockout/index.d.ts b/types/@oracle/oraclejet/ojs/ojknockout/index.d.ts new file mode 100644 index 0000000000..f388d46c92 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojknockout/index.d.ts @@ -0,0 +1,14 @@ +/// +declare namespace oj { + namespace KnockoutTemplateUtils { + function getRenderer(template: string, bReplaceNode?: boolean): ((param0: object)=> void); + } + +} +declare namespace oj { + class ResponsiveKnockoutUtils { + static createMediaQueryObservable(queryString: string): KnockoutObservable; + static createScreenRangeObservable(): KnockoutObservable; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojlabel/index.d.ts b/types/@oracle/oraclejet/ojs/ojlabel/index.d.ts new file mode 100644 index 0000000000..c10e0daf17 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojlabel/index.d.ts @@ -0,0 +1,33 @@ +/// +declare namespace oj { + class ojLabel extends baseComponent { + for: string|null; + help: {definition?: string|null, source?: string|null}; + labelId: string|null; + showRequired: boolean|null; + translations: {tooltipHelp?: string, tooltipRequired?: string}; + onForChanged: (event: CustomEvent)=> any; + onHelpChanged: (event: CustomEvent)=> any; + onLabelIdChanged: (event: CustomEvent)=> any; + onShowRequiredChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLabelEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + } + interface ojLabelEventMap extends oj.baseComponentEventMap { + 'forChanged': CustomEvent; + 'helpChanged': CustomEvent; + 'labelIdChanged': CustomEvent; + 'showRequiredChanged': CustomEvent; + } + interface ojLabelSettableProperties extends baseComponentSettableProperties { + for: string|null; + help: {definition?: string|null, source?: string|null}; + labelId: string|null; + showRequired: boolean|null; + translations: {tooltipHelp?: string, tooltipRequired?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts b/types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts new file mode 100644 index 0000000000..c1649bedd7 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts @@ -0,0 +1,25 @@ +declare namespace oj { + class ojLabelValue extends JetElement { + labelEdge: 'start'|'top'|'inherit'; + labelWidth: string; + onLabelEdgeChanged: (event: CustomEvent)=> any; + onLabelWidthChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLabelValueEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + refresh(): void; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojLabelValueEventMap extends oj.JetElementEventMap { + 'labelEdgeChanged': CustomEvent; + 'labelWidthChanged': CustomEvent; + } + interface ojLabelValueSettableProperties extends JetSettableProperties { + labelEdge: 'start'|'top'|'inherit'; + labelWidth: string; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojlegend/index.d.ts b/types/@oracle/oraclejet/ojs/ojlegend/index.d.ts new file mode 100644 index 0000000000..36f940f25c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojlegend/index.d.ts @@ -0,0 +1,230 @@ +/// +/// +declare namespace oj { + class ojLegend extends dvtBaseComponent> { + as: string; + data: oj.DataProvider|null; + drilling: 'on'|'off'; + expanded: KeySet.KeySet|null; + halign: 'center'|'end'|'start'; + hiddenCategories: Array; + hideAndShowBehavior: 'on'|'off'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + orientation: 'horizontal'|'vertical'; + scrolling: 'off'|'asNeeded'; + symbolHeight: number; + symbolWidth: number; + textStyle?: object; + valign: 'middle'|'bottom'|'top'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onAsChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onExpandedChanged: (event: CustomEvent)=> any; + onHalignChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHideAndShowBehaviorChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; + onOrientationChanged: (event: CustomEvent)=> any; + onScrollingChanged: (event: CustomEvent)=> any; + onSymbolHeightChanged: (event: CustomEvent)=> any; + onSymbolWidthChanged: (event: CustomEvent)=> any; + onTextStyleChanged: (event: CustomEvent)=> any; + onValignChanged: (event: CustomEvent)=> any; + onOjDrill: (event: oj.ojLegend.ojDrill)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojLegend.NodeContext|null; + getItem(subIdPath: Array): oj.ojLegend.ItemContext|null; + getPreferredSize(): oj.ojLegend.PreferredSize|null; + getSection(subIdPath: Array): oj.ojLegend.SectionContext|null; + } + namespace ojLegend { + class ojDrill extends CustomEvent<{id: any, [propName: string]: any}> { + + } + } + interface ojLegendEventMap extends oj.dvtBaseComponentEventMap { + 'ojDrill': oj.ojLegend.ojDrill; + 'asChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'expandedChanged': CustomEvent; + 'halignChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'hideAndShowBehaviorChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'hoverBehaviorDelayChanged': CustomEvent; + 'orientationChanged': CustomEvent; + 'scrollingChanged': CustomEvent; + 'symbolHeightChanged': CustomEvent; + 'symbolWidthChanged': CustomEvent; + 'textStyleChanged': CustomEvent; + 'valignChanged': CustomEvent; + } + interface ojLegendSettableProperties extends dvtBaseComponentSettableProperties { + as: string; + data: oj.DataProvider|null; + drilling: 'on'|'off'; + expanded: KeySet.KeySet|null; + halign: 'center'|'end'|'start'; + hiddenCategories: Array; + hideAndShowBehavior: 'on'|'off'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + orientation: 'horizontal'|'vertical'; + scrolling: 'off'|'asNeeded'; + symbolHeight: number; + symbolWidth: number; + textStyle?: object; + valign: 'middle'|'bottom'|'top'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + namespace ojLegend { + type ItemContext = + { + text: string + } + } + namespace ojLegend { + type NodeContext = + { + itemIndex: number, sectionIndexPath: Array, subId: string + } + } + namespace ojLegend { + type PreferredSize = + { + width: number, height: number + } + } + namespace ojLegend { + type SectionContext = + { + title: string, sections: Array, items: Array, getSection: {title: string, sections: string, items: boolean}, getItems: {text: string} + } + } + +} +declare namespace oj { + class ojLegendItem extends JetElement { + borderColor?: string; + categories?: Array; + categoryVisibility?: 'hidden'|'visible'; + color?: string; + drilling?: 'on'|'off'|'inherit'; + lineStyle?: 'dotted'|'dashed'|'solid'; + lineWidth?: number; + markerColor?: string; + markerShape: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; + markerSvgClassName?: string; + markerSvgStyle?: object; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; + shortDesc?: string; + source?: string; + svgClassName?: string; + svgStyle?: object; + symbolType?: 'line'|'lineWithMarker'|'image'|'marker'; + text: string; + onBorderColorChanged: (event: CustomEvent)=> any; + onCategoriesChanged: (event: CustomEvent)=> any; + onCategoryVisibilityChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onLineStyleChanged: (event: CustomEvent)=> any; + onLineWidthChanged: (event: CustomEvent)=> any; + onMarkerColorChanged: (event: CustomEvent)=> any; + onMarkerShapeChanged: (event: CustomEvent)=> any; + onMarkerSvgClassNameChanged: (event: CustomEvent)=> any; + onMarkerSvgStyleChanged: (event: CustomEvent)=> any; + onPatternChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSourceChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onSymbolTypeChanged: (event: CustomEvent)=> any; + onTextChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojLegendItemEventMap extends oj.JetElementEventMap { + 'borderColorChanged': CustomEvent; + 'categoriesChanged': CustomEvent; + 'categoryVisibilityChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'lineStyleChanged': CustomEvent; + 'lineWidthChanged': CustomEvent; + 'markerColorChanged': CustomEvent; + 'markerShapeChanged': CustomEvent; + 'markerSvgClassNameChanged': CustomEvent; + 'markerSvgStyleChanged': CustomEvent; + 'patternChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'sourceChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'symbolTypeChanged': CustomEvent; + 'textChanged': CustomEvent; + } + interface ojLegendItemSettableProperties extends JetSettableProperties { + borderColor?: string; + categories?: Array; + categoryVisibility?: 'hidden'|'visible'; + color?: string; + drilling?: 'on'|'off'|'inherit'; + lineStyle?: 'dotted'|'dashed'|'solid'; + lineWidth?: number; + markerColor?: string; + markerShape: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; + markerSvgClassName?: string; + markerSvgStyle?: object; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; + shortDesc?: string; + source?: string; + svgClassName?: string; + svgStyle?: object; + symbolType?: 'line'|'lineWithMarker'|'image'|'marker'; + text: string; + } + +} +declare namespace oj { + class ojLegendSection extends JetElement { + collapsible?: 'on'|'off'; + text?: string; + textHalign?: 'center'|'end'|'start'; + textStyle?: object; + onCollapsibleChanged: (event: CustomEvent)=> any; + onTextChanged: (event: CustomEvent)=> any; + onTextHalignChanged: (event: CustomEvent)=> any; + onTextStyleChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendSectionEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojLegendSectionEventMap extends oj.JetElementEventMap { + 'collapsibleChanged': CustomEvent; + 'textChanged': CustomEvent; + 'textHalignChanged': CustomEvent; + 'textStyleChanged': CustomEvent; + } + interface ojLegendSectionSettableProperties extends JetSettableProperties { + collapsible?: 'on'|'off'; + text?: string; + textHalign?: 'center'|'end'|'start'; + textStyle?: object; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts b/types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts new file mode 100644 index 0000000000..ed2b3d981f --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts @@ -0,0 +1,21 @@ +/// +declare namespace oj { + class ListDataProviderView implements DataProvider { + dataMapping: DataMapping; + from: any; + offset: number; + sortCriteria: SortCriterion[]; + constructor(dataProvider: DataProvider, options?: {from?: object, offset?: number, sortCriteria?: SortCriterion[], dataMapping?: DataMapping}); + addEventListener(eventType: string, listener: EventListener): void + containsKeys(params: FetchByKeysParameters): Promise> + dispatchEvent(evt: Event): boolean + fetchByKeys(params: FetchByKeysParameters): Promise> + fetchByOffset(params: FetchByOffsetParameters): Promise> + fetchFirst>(params?: FetchListParameters): AsyncIterable + getCapability(capabilityName: string) + getTotalSize(): Promise; + isEmpty(): 'yes'|'no'|'unknown'; + removeEventListener(eventType: string, listener: EventListener): void + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojlistview/index.d.ts b/types/@oracle/oraclejet/ojs/ojlistview/index.d.ts new file mode 100644 index 0000000000..cb4289b6ea --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojlistview/index.d.ts @@ -0,0 +1,167 @@ +/// +/// +/// +declare namespace oj { + class ojListView extends baseComponent> { + as: string; + currentItem: K; + data: oj.DataProvider; + dnd: {drag?: {items: {dataTypes?: string|Array, drag?: ((param0: Event)=> void), dragEnd?: ((param0: Event)=> void), dragStart?: ((param0: Event, param1: {items:Array})=> void)}}, drop?: {items: {dataTypes?: string|Array, dragEnter?: ((param0: Event, param1: {item:Element})=> void), dragLeave?: ((param0: Event, param1: {item:Element})=> void), dragOver?: ((param0: Event, param1: {item:Element})=> void), drop?: ((param0: Event, param1: oj.ojListView.ItemsDropContext)=> void)}}, reorder: {items: 'enabled'|'disabled'}}; + drillMode: 'collapsible'|'none'; + expanded: KeySet.KeySet; + readonly firstSelectedItem: {key: K, data: D}; + groupHeaderPosition: 'static'|'sticky'; + item: {focusable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean, renderer?: ((param0: oj.ojListView.ItemContext) => {insert: Element|string}|undefined)|null, selectable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean}; + scrollPolicy: 'auto'|'loadMoreOnScroll'; + scrollPolicyOptions: {fetchSize?: number, maxCount?: number, scroller?: Element}; + scrollPosition: {x?: number, y?: number, index?: number, parent?: K, key?: K, offsetX?: number, offsetY?: number}; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + selectionRequired: boolean; + translations: {accessibleNavigateSkipItems?: string, accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderInsideItem?: string, accessibleReorderTouchInstructionText?: string, indexerCharacters?: string, labelCopy?: string, labelCut?: string, labelPaste?: string, labelPasteAfter?: string, labelPasteBefore?: string, msgFetchingData?: string, msgNoData?: string}; + onAsChanged: (event: CustomEvent)=> any; + onCurrentItemChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDndChanged: (event: CustomEvent)=> any; + onDrillModeChanged: (event: CustomEvent)=> any; + onExpandedChanged: (event: CustomEvent)=> any; + onFirstSelectedItemChanged: (event: CustomEvent)=> any; + onGroupHeaderPositionChanged: (event: CustomEvent)=> any; + onItemChanged: (event: CustomEvent)=> any; + onScrollPolicyChanged: (event: CustomEvent)=> any; + onScrollPolicyOptionsChanged: (event: CustomEvent)=> any; + onScrollPositionChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onSelectionRequiredChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojListView.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojListView.ojAnimateStart)=> any; + onOjBeforeCollapse: (event: oj.ojListView.ojBeforeCollapse)=> any; + onOjBeforeCurrentItem: (event: oj.ojListView.ojBeforeCurrentItem)=> any; + onOjBeforeExpand: (event: oj.ojListView.ojBeforeExpand)=> any; + onOjCollapse: (event: oj.ojListView.ojCollapse)=> any; + onOjCopy: (event: oj.ojListView.ojCopy)=> any; + onOjCut: (event: oj.ojListView.ojCut)=> any; + onOjExpand: (event: oj.ojListView.ojExpand)=> any; + onOjPaste: (event: oj.ojListView.ojPaste)=> any; + onOjReorder: (event: oj.ojListView.ojReorder)=> any; + + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojListViewEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojListView.ContextByNode|null; + getDataForVisibleItem(context: {key?: K, index?: number, parent?: Element}): D; + refresh(): void; + scrollToItem(item: {key: K}): void; + } + namespace ojListView { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeCollapse extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { + + } + + class ojBeforeCurrentItem extends CustomEvent<{previousKey: K, previousItem: Element, key: K, item: Element, [propName: string]: any}> { + + } + + class ojBeforeExpand extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { + + } + + class ojCollapse extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { + + } + + class ojCopy extends CustomEvent<{items: Array, [propName: string]: any}> { + + } + + class ojCut extends CustomEvent<{items: Array, [propName: string]: any}> { + + } + + class ojExpand extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { + + } + + class ojPaste extends CustomEvent<{item: Element, [propName: string]: any}> { + + } + + class ojReorder extends CustomEvent<{items: Array, position: string, reference: Element, [propName: string]: any}> { + + } + } + interface ojListViewEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.ojListView.ojAnimateEnd; + 'ojAnimateStart': oj.ojListView.ojAnimateStart; + 'ojBeforeCollapse': oj.ojListView.ojBeforeCollapse; + 'ojBeforeCurrentItem': oj.ojListView.ojBeforeCurrentItem; + 'ojBeforeExpand': oj.ojListView.ojBeforeExpand; + 'ojCollapse': oj.ojListView.ojCollapse; + 'ojCopy': oj.ojListView.ojCopy; + 'ojCut': oj.ojListView.ojCut; + 'ojExpand': oj.ojListView.ojExpand; + 'ojPaste': oj.ojListView.ojPaste; + 'ojReorder': oj.ojListView.ojReorder; + 'asChanged': CustomEvent; + 'currentItemChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'dndChanged': CustomEvent; + 'drillModeChanged': CustomEvent; + 'expandedChanged': CustomEvent; + 'firstSelectedItemChanged': CustomEvent; + 'groupHeaderPositionChanged': CustomEvent; + 'itemChanged': CustomEvent; + 'scrollPolicyChanged': CustomEvent; + 'scrollPolicyOptionsChanged': CustomEvent; + 'scrollPositionChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'selectionRequiredChanged': CustomEvent; + } + interface ojListViewSettableProperties extends baseComponentSettableProperties { + as: string; + currentItem: K; + data: oj.DataProvider; + dnd: {drag?: {items: {dataTypes?: string|Array, drag?: ((param0: Event)=> void), dragEnd?: ((param0: Event)=> void), dragStart?: ((param0: Event, param1: {items:Array})=> void)}}, drop?: {items: {dataTypes?: string|Array, dragEnter?: ((param0: Event, param1: {item:Element})=> void), dragLeave?: ((param0: Event, param1: {item:Element})=> void), dragOver?: ((param0: Event, param1: {item:Element})=> void), drop?: ((param0: Event, param1: oj.ojListView.ItemsDropContext)=> void)}}, reorder: {items: 'enabled'|'disabled'}}; + drillMode: 'collapsible'|'none'; + expanded: KeySet.KeySet; + readonly firstSelectedItem: {key: K, data: D}; + groupHeaderPosition: 'static'|'sticky'; + item: {focusable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean, renderer?: ((param0: oj.ojListView.ItemContext) => {insert: Element|string}|undefined)|null, selectable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean}; + scrollPolicy: 'auto'|'loadMoreOnScroll'; + scrollPolicyOptions: {fetchSize?: number, maxCount?: number, scroller?: Element}; + scrollPosition: {x?: number, y?: number, index?: number, parent?: K, key?: K, offsetX?: number, offsetY?: number}; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + selectionRequired: boolean; + translations: {accessibleNavigateSkipItems?: string, accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderInsideItem?: string, accessibleReorderTouchInstructionText?: string, indexerCharacters?: string, labelCopy?: string, labelCut?: string, labelPaste?: string, labelPasteAfter?: string, labelPasteBefore?: string, msgFetchingData?: string, msgNoData?: string}; + } + namespace ojListView { + type ContextByNode = + { + subId: string, key: K, index: number, parent?: Element, group?: boolean + } + } + namespace ojListView { + type ItemContext = + { + datasource: oj.DataProvider, index: number, key: K, data: D, parentElement: Element, depth?: number, parentKey?: K, leaf?: boolean + } + } + namespace ojListView { + type ItemsDropContext = + { + item: Element, position: 'before'|'after'|'inside', reorder: boolean + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts b/types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts new file mode 100644 index 0000000000..f355ffc77b --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts @@ -0,0 +1,85 @@ +/// +declare namespace oj { + class ojMasonryLayout extends baseComponent { + reorderHandle: string|null; + translations: {labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string}; + onReorderHandleChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojMasonryLayout.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojMasonryLayout.ojAnimateStart)=> any; + onOjBeforeInsert: (event: oj.ojMasonryLayout.ojBeforeInsert)=> any; + onOjBeforeRemove: (event: oj.ojMasonryLayout.ojBeforeRemove)=> any; + onOjBeforeReorder: (event: oj.ojMasonryLayout.ojBeforeReorder)=> any; + onOjBeforeResize: (event: oj.ojMasonryLayout.ojBeforeResize)=> any; + onOjInsert: (event: oj.ojMasonryLayout.ojInsert)=> any; + onOjRemove: (event: oj.ojMasonryLayout.ojRemove)=> any; + onOjReorder: (event: oj.ojMasonryLayout.ojReorder)=> any; + onOjResize: (event: oj.ojMasonryLayout.ojResize)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMasonryLayoutEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + insertTile(selector: string, index: number): void; + refresh(): void; + removeTile(selector: string): void; + resizeTile(selector: string, sizeStyleClass: string): void; + } + namespace ojMasonryLayout { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeInsert extends CustomEvent<{tile: Element, index: number, [propName: string]: any}> { + + } + + class ojBeforeRemove extends CustomEvent<{tile: Element, [propName: string]: any}> { + + } + + class ojBeforeReorder extends CustomEvent<{tile: Element, fromIndex: number, [propName: string]: any}> { + + } + + class ojBeforeResize extends CustomEvent<{tile: Element, previousSizeStyleClass: string, sizeStyleClass: string, [propName: string]: any}> { + + } + + class ojInsert extends CustomEvent<{tile: Element, index: number, [propName: string]: any}> { + + } + + class ojRemove extends CustomEvent<{tile: Element, [propName: string]: any}> { + + } + + class ojReorder extends CustomEvent<{tile: Element, fromIndex: number, toIndex: number, [propName: string]: any}> { + + } + + class ojResize extends CustomEvent<{tile: Element, previousSizeStyleClass: string, sizeStyleClass: string, [propName: string]: any}> { + + } + } + interface ojMasonryLayoutEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.ojMasonryLayout.ojAnimateEnd; + 'ojAnimateStart': oj.ojMasonryLayout.ojAnimateStart; + 'ojBeforeInsert': oj.ojMasonryLayout.ojBeforeInsert; + 'ojBeforeRemove': oj.ojMasonryLayout.ojBeforeRemove; + 'ojBeforeReorder': oj.ojMasonryLayout.ojBeforeReorder; + 'ojBeforeResize': oj.ojMasonryLayout.ojBeforeResize; + 'ojInsert': oj.ojMasonryLayout.ojInsert; + 'ojRemove': oj.ojMasonryLayout.ojRemove; + 'ojReorder': oj.ojMasonryLayout.ojReorder; + 'ojResize': oj.ojMasonryLayout.ojResize; + 'reorderHandleChanged': CustomEvent; + } + interface ojMasonryLayoutSettableProperties extends baseComponentSettableProperties { + reorderHandle: string|null; + translations: {labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmenu/index.d.ts b/types/@oracle/oraclejet/ojs/ojmenu/index.d.ts new file mode 100644 index 0000000000..cd2c08461c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmenu/index.d.ts @@ -0,0 +1,87 @@ +/// +declare namespace oj { + class ojMenu extends baseComponent { + disabled: boolean; + openOptions: oj.ojMenu.OpenOptions; + translations: {ariaFocusSkipLink?: string, labelCancel?: string}; + onDisabledChanged: (event: CustomEvent)=> any; + onOpenOptionsChanged: (event: CustomEvent)=> any; + onOjAction: (event: oj.ojMenu.ojAction)=> any; + onOjAnimateEnd: (event: oj.ojMenu.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojMenu.ojAnimateStart)=> any; + onOjBeforeOpen: (event: oj.ojMenu.ojBeforeOpen)=> any; + onOjClose: (event: oj.ojMenu.ojClose)=> any; + onOjOpen: (event: oj.ojMenu.ojOpen)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + open(event?: object, openOptions?: oj.ojMenu.OpenOptions): void; + refresh(): void; + } + namespace ojMenu { + class ojAction extends CustomEvent<{ [propName: string]: any}> { + + } + + class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: 'open'|'close', element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeOpen extends CustomEvent<{ [propName: string]: any}> { + + } + + class ojClose extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + + class ojOpen extends CustomEvent<{event: Event, [propName: string]: any}> { + + } + } + interface ojMenuEventMap extends oj.baseComponentEventMap { + 'ojAction': oj.ojMenu.ojAction; + 'ojAnimateEnd': oj.ojMenu.ojAnimateEnd; + 'ojAnimateStart': oj.ojMenu.ojAnimateStart; + 'ojBeforeOpen': oj.ojMenu.ojBeforeOpen; + 'ojClose': oj.ojMenu.ojClose; + 'ojOpen': oj.ojMenu.ojOpen; + 'disabledChanged': CustomEvent; + 'openOptionsChanged': CustomEvent; + } + interface ojMenuSettableProperties extends baseComponentSettableProperties { + disabled: boolean; + openOptions: oj.ojMenu.OpenOptions; + translations: {ariaFocusSkipLink?: string, labelCancel?: string}; + } + namespace ojMenu { + type OpenOptions = + { + display?: string, initialFocus?: string, launcher?: string|Element, position?: oj.ojMenu.Position + } + } + namespace ojMenu { + type Position = + { + my?: oj.ojMenu.PositionAlign, at?: oj.ojMenu.PositionAlign, offset?: oj.ojMenu.PositionPoint, of?: string|oj.ojMenu.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'flipcenter'|'none' + } + } + namespace ojMenu { + type PositionAlign = + { + vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' + } + } + namespace ojMenu { + type PositionPoint = + { + x?: number, y?: number + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts b/types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts new file mode 100644 index 0000000000..0f380df2f2 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts @@ -0,0 +1,36 @@ +/// +/// +declare namespace oj { + class ojMenuSelectMany extends JetElement { + disabled: boolean; + options: Array|oj.DataProvider|null; + value: Array; + onDisabledChanged: (event: CustomEvent)=> any; + onOptionsChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuSelectManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojMenuSelectManyEventMap extends oj.JetElementEventMap { + 'disabledChanged': CustomEvent; + 'optionsChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojMenuSelectManySettableProperties extends JetSettableProperties { + disabled: boolean; + options: Array|oj.DataProvider|null; + value: Array; + } + namespace ojMenuSelectMany { + type Option = + { + id?: string, disabled?: boolean, label: string, value: any + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmessage/index.d.ts b/types/@oracle/oraclejet/ojs/ojmessage/index.d.ts new file mode 100644 index 0000000000..8be478bd06 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmessage/index.d.ts @@ -0,0 +1,51 @@ +declare namespace oj { + class ojMessage extends JetElement { + message: oj.ojMessage.Message; + translations: {categories?: {confirmation?: string, error?: string, info?: string, warning?: string}, labelCloseIcon?: string}; + onMessageChanged: (event: CustomEvent)=> any; + + onTranslationsChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojMessage.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojMessage.ojAnimateStart)=> any; + onOjClose: (event: oj.ojMessage.ojClose)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMessageEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + close(): void; + getProperty(property: string): any; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + namespace ojMessage { + class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{element: Element, action: 'open'|'close', endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojClose extends CustomEvent<{message: object, [propName: string]: any}> { + + } + } + interface ojMessageEventMap extends oj.JetElementEventMap { + 'ojAnimateEnd': oj.ojMessage.ojAnimateEnd; + 'ojAnimateStart': oj.ojMessage.ojAnimateStart; + 'ojClose': oj.ojMessage.ojClose; + 'messageChanged': CustomEvent; + 'translationsChanged': CustomEvent; + } + interface ojMessageSettableProperties extends JetSettableProperties { + message: oj.ojMessage.Message; + translations: {categories?: {confirmation?: string, error?: string, info?: string, warning?: string}, labelCloseIcon?: string}; + } + namespace ojMessage { + type Message = + { + icon?: string, category?: string, severity?: 'error'|'warning'|'confirmation'|'info'|'none', timestamp?: string, summary?: string, detail?: string, autoTimeout?: number, closeAffordance?: 'none'|'defaults', sound?: string + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmessages/index.d.ts b/types/@oracle/oraclejet/ojs/ojmessages/index.d.ts new file mode 100644 index 0000000000..3246de390f --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmessages/index.d.ts @@ -0,0 +1,55 @@ +/// +/// +declare namespace oj { + class ojMessages extends JetElement { + display: 'general'|'notification'; + messages: Array | null | oj.DataProvider; + position: oj.ojMessages.Position|null; + translations: {ariaLiveRegion?: {navigationFromKeyboard?: string, navigationToKeyboard?: string, navigationToTouch?: string, newMessage?: string}, labelLandmark?: string}; + onDisplayChanged: (event: CustomEvent)=> any; + onMessagesChanged: (event: CustomEvent)=> any; + onPositionChanged: (event: CustomEvent)=> any; + + onTranslationsChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMessagesEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + close(associated: object): void; + closeAll(closeFilter?: (message: oj.ojMessage.Message) => boolean): void; + getProperty(property: string): any; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojMessagesEventMap extends oj.JetElementEventMap { + 'displayChanged': CustomEvent; + 'messagesChanged': CustomEvent; + 'positionChanged': CustomEvent; + 'translationsChanged': CustomEvent; + } + interface ojMessagesSettableProperties extends JetSettableProperties { + display: 'general'|'notification'; + messages: Array | null | oj.DataProvider; + position: oj.ojMessages.Position|null; + translations: {ariaLiveRegion?: {navigationFromKeyboard?: string, navigationToKeyboard?: string, navigationToTouch?: string, newMessage?: string}, labelLandmark?: string}; + } + namespace ojMessages { + type Position = + { + my?: oj.ojMessages.PositionAlign, at?: oj.ojMessages.PositionAlign, offset?: oj.ojMessages.PositionPoint, of?: string|oj.ojMessages.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'none' + } + } + namespace ojMessages { + type PositionAlign = + { + vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' + } + } + namespace ojMessages { + type PositionPoint = + { + x?: number, y?: number + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts b/types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts new file mode 100644 index 0000000000..e65a3ddcc3 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts @@ -0,0 +1,30 @@ +declare namespace oj { + class Message { + detail: string; + severity: string|number; + summary: string; + constructor(summary: string, detail: string, severity?: number|string); + static getMaxSeverity(messages?: Array): number; + static getSeverityLevel(severity?: string|number|undefined): number; + static getSeverityType(level?: string|number|undefined): string; + static isValid(messages: Array): boolean; + } + namespace Message { + enum SEVERITY_LEVEL { + FATAL = "5", + ERROR = "4", + WARNING = "3", + INFO = "2", + CONFIRMATION = "1", + } + enum SEVERITY_TYPE { + CONFIRMATION = "confirmation", + INFO = "info", + WARNING = "warning", + ERROR = "error", + FATAL = "fatal", + } + } + + +} diff --git a/types/@oracle/oraclejet/ojs/ojmodel/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodel/index.d.ts new file mode 100644 index 0000000000..6e3ebe4118 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmodel/index.d.ts @@ -0,0 +1,169 @@ +declare namespace oj { + class Collection { + changes: Array; + comparator: null|string|((param0: oj.Model, param1?: oj.Model)=> number); + customPagingOptions: ((response: object)=> oj.Collection.CustomPagingOptionsReturn|null)|null; + customURL: ((param0: string, param1: oj.Collection, param2: object)=> string|Object|null)|null; + fetchSize: number; + hasMore: boolean; + lastFetchCount: number; + lastFetchSize: number; + length: number; + model: object; + modelLimit: number; + models: Array; + offset: number; + omitLanguageHeader: boolean; + parse: ((param0: object)=> Object); + sortDirection: number; + totalResults: number; + url: null|string|(()=> string); + constructor(models?: Array, options?: object); + static extend(properties?: {parse?: (data: any)=> any, model?: oj.Model, url?: string, initialize?: (models: Array, options: Object)=> void, comparator?: null|string|((model1: oj.Model, model2?: oj.Model)=> number), fetchSize?: number, modelLimit?: number, [propName: string]: any}, classProperties?: object): any; + abort(): Promise; + add(m: oj.Model|object|Array|Array, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): Promise>|Array; + any(iterator: ((param0: object)=> void), context?: object): boolean; + at(index: number, options?: {fetchSize?: number, deferred?: boolean, [propName: string]: any}): oj.Model|Promise|null; + clone(): oj.Collection; + contains(model: object, options?: object): boolean|Promise; + create(attributes?: object, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): oj.Model|boolean|Promise; + difference(...var_args: (Array)[]): Array; + each(iterator: ((param0: oj.Model)=> void), context?: object): undefined; + fetch(options?: {success?: (collection: oj.Collection, response: Object, options: Object)=> void, error?: (collection: oj.Collection, xhr: Object, options: Object)=> void, add?: boolean, set?: boolean, startIndex?: number, startID?: Object, since?: Object, until?: Object, fetchSize?: number, [propName: string]: any}): object; + filter(iterator: ((param0: oj.Model)=> void), context?: object): Array; + findWhere(attrs: object|Array, options?: {deferred?: boolean, [propName: string]: any}): oj.Model|Promise; + first(n?: number, options?: object): Array|null|Promise; + get(id: object|string, options?: object): oj.Model|null|Promise; + getByCid(clientId: string): oj.Model|null; + groupBy(iterator: string|((param0: oj.Model)=> object), context?: object): object; + include(model: object, options?: object): boolean|Promise; + indexBy(iterator: string|((param0: oj.Model)=> void), context?: object): object; + indexOf(model: object, options?: object): number|Promise; + initial(n?: number): Array; + isEmpty(): boolean; + isRangeLocal(start: number, count: number): boolean; + last(n?: number, options?: object): Promise|Array|null; + lastIndexOf(model: oj.Model, fromIndex?: number): number; + listenTo(otherObj: object, eventType: string, callback: Function): undefined; + listenToOnce(otherObj: object, eventType: string, callback: Function): undefined; + map(iterator: ((param0: oj.Model)=> object), context?: object): Array; + max(iterator: ((param0: oj.Model)=> object), context?: object): object; + min(iterator: ((param0: object)=> void), context?: object): object; + modelId(attrs: object): null|string; + next(n: number, options?: {success?: (collection: oj.Collection, response: Object, options: Object)=> void, error?: (collection: oj.Collection, xhr: Object, options: Object)=> void, [propName: string]: any}): object|null; + off(eventType?: string|object, callback?: Function, context?: object): undefined; + on(eventType: string|object, callback: Function, context?: object): undefined; + once(eventType: string, callback: Function, context?: object): undefined; + pluck(attr: string): Array; + pop(options?: {silent?: boolean, deferred?: boolean, [propName: string]: any}): oj.Model|Promise; + previous(n: number, options?: {success?: (collection: oj.Collection, response: Object, options: Object)=> void, error?: (collection: oj.Collection, xhr: Object, options: Object)=> void, [propName: string]: any}): object; + push(m: oj.Model|object, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): Promise>|undefined; + refresh(options?: {silent?: boolean, startIndex?: number, [propName: string]: any}): Promise; + remove(m: oj.Model|Array, options?: object): Array|object; + reset(data?: object, options?: {silent?: boolean, [propName: string]: any}): oj.Model|Array; + rest(n?: number, options?: object): Array|Promise; + set(models: object, options?: {add?: boolean, remove?: boolean, merge?: boolean, silent?: boolean, deferred?: boolean, [propName: string]: any}): Promise|null; + setFetchSize(n: number): undefined; + setModelLimit(n: number): undefined; + setRangeLocal(start: number, count: number): Promise; + shift(options?: object): oj.Model|Promise|null; + size(): number; + slice(start: number, end?: number, options?: object): Promise>|Array; + sort(options?: {silent?: boolean, startIndex?: number, [propName: string]: any}): Promise|null; + sortBy(iterator: string|((param0: oj.Model)=> object), context?: object): Array; + sortedIndex(comparator: string|((param0: oj.Model, param1?: oj.Model)=> object)): number; + stopListening(otherObj?: object, eventType?: string, callback?: Function): undefined; + sync(method: string, collection: oj.Collection, options?: {success?: (json?: Array)=> void, error?: (xhr: Object, status: Object, error: Object)=> void, [propName: string]: any}): object; + toJSON(): Array; + trigger(eventType: string): undefined; + unshift(m: object, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): Promise>|Array; + whenReady(): Promise; + where(attrs: object|Array, options?: object): Promise>|Array; + whereToCollection(attrs: object|Array, options?: object): oj.Collection|Promise; + without(...var_args: (oj.Model)[]): Array; + } + namespace Collection { + type CustomPagingOptionsReturn = + { + totalResults?: number, limit?: number, count?: number, offset?: number, hasMore?: boolean + } + } + namespace Collection { + type SetRangeLocalPromise = + { + start: number, count: number, models: Array + } + } + +} +declare namespace oj { + class Model { + attributes: object; + customURL: ((param0: string, param1: oj.Model, param2: object)=> string|Object|null)|null; + defaults: object; + id: string|null; + idAttribute: string|null; + omitLanguageHeader: boolean; + parse: ((param0: object)=> Object); + parseSave: ((param0: object)=> Object); + urlRoot: string|null; + validate: ((param0: object, param1: Object)=> string|Object|null)|null; + validationError: string|object|null; + constructor(attributes?: object, options?: object); + static extend(properties?: {parse?: (data: any)=> any, parseSave?: (data: any)=> any, urlRoot?: string, initialize?: (models: Array, options: Object)=> void, validate?: null|object|string|((attributes: Object, options?: oj.Model)=> number), [propName: string]: any}, classProperties?: object): any; + changedAttributes(attributes?: object): object|boolean; + clear(options?: object): oj.Model|boolean; + clone(): oj.Model; + destroy(options?: {success?: (model: oj.Model, response: Object, options: Object)=> void, error?: (model: oj.Model, xhr: Object, options: Object)=> void, wait?: boolean, [propName: string]: any}): boolean; + fetch(options?: {success?: (model: oj.Model, response: Object, options: Object)=> void, error?: (model: oj.Model, xhr: Object, options: Object)=> void, [propName: string]: any}): object; + get(property: string): object; + has(property: string): boolean; + hasChanged(attribute?: string): boolean; + invert(): object; + isNew(): boolean; + isValid(): boolean; + keys(): Array; + listenTo(otherObj: object, eventType: string, callback: Function): undefined; + listenToOnce(otherObj: object, eventType: string, callback: Function): undefined; + matches(attrs: object): ((param0: oj.Model)=> boolean); + off(eventType?: string|object, callback?: Function, context?: object): undefined; + omit(keys: Array|object): object; + on(eventType: string|object, callback: Function, context?: object): undefined; + once(eventType: string, callback: Function, context?: object): undefined; + pairs(): object; + pick(keys: Array|object): object; + previous(attr: string): object; + previousAttributes(): object; + save(attributes?: object, options?: {success?: (model: oj.Model, response: Object, options: Object)=> void, error?: (model: oj.Model, xhr: Object, options: Object)=> void, contentType?: string, valdiate?: boolean, wait?: boolean, patch?: boolean, attrs?: Object, [propName: string]: any}): object|boolean; + set(property: string|object, value?: object, options?: object): oj.Model|boolean; + stopListening(otherObj?: object, eventType?: string, callback?: Function): undefined; + sync(method: string, model: oj.Model, options?: object): object; + toJSON(): object; + trigger(eventType: string): undefined; + unset(property: string, options?: object): boolean; + url(): string|null; + values(): Array; + } + +} +declare namespace oj { + class OAuth { + constructor(attributes: object, header: string); + cleanAccessTokenRequest(): undefined; + cleanAccessTokenResponse(): undefined; + clientCredentialGrant(): undefined; + getAccessTokenRequest(): object; + getAccessTokenResponse(): object; + getHeader(): object; + isInitialized(): boolean; + setAccessTokenRequest(data: object): undefined; + setAccessTokenResponse(data: object): undefined; + } + +} +declare namespace oj { + class URLError { + constructor(); + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts new file mode 100644 index 0000000000..f2b9b3db7c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts @@ -0,0 +1,3 @@ +export class ModuleElementUtils { + } + diff --git a/types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts new file mode 100644 index 0000000000..5129c36e5a --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts @@ -0,0 +1,54 @@ +declare namespace oj { + interface ModuleElementAnimation { + animate(context: {node: Node, isInitial: boolean, oldViewModel: object, newViewModel: object, newViewParent: Node, oldViewParent: Node, removeOldView: Function, insertNewView: Function, oldDomNodes: Array}): Promise; + canAnimate(context: {node: Node, isInitial: boolean, oldViewModel: object, newViewModel: object}): boolean; + prepareAnimation(context: {node: Node, isInitial: boolean, oldViewModel: object, newViewModel: object}): object; + } + +} +declare namespace oj { + class ojModule { + animation: object; + config: {cleanupMode: 'onDisconnect'|'none', view: Array, viewModel: object}; + onAnimationChanged: (event: CustomEvent)=> any; + onConfigChanged: (event: CustomEvent)=> any; + onOjTransitionEnd: (event: oj.ojModule.ojTransitionEnd)=> any; + onOjTransitionStart: (event: oj.ojModule.ojTransitionStart)=> any; + onOjViewConnected: (event: oj.ojModule.ojViewConnected)=> any; + onOjViewDisconnected: (event: oj.ojModule.ojViewDisconnected)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojModuleEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojModule { + class ojTransitionEnd extends CustomEvent<{viewModel: object, [propName: string]: any}> { + + } + + class ojTransitionStart extends CustomEvent<{viewModel: object, [propName: string]: any}> { + + } + + class ojViewConnected extends CustomEvent<{viewModel: object, [propName: string]: any}> { + + } + + class ojViewDisconnected extends CustomEvent<{viewModel: object, view: Array, [propName: string]: any}> { + + } + } + interface ojModuleEventMap extends oj.JetElementEventMap { + 'ojTransitionEnd': oj.ojModule.ojTransitionEnd; + 'ojTransitionStart': oj.ojModule.ojTransitionStart; + 'ojViewConnected': oj.ojModule.ojViewConnected; + 'ojViewDisconnected': oj.ojModule.ojViewDisconnected; + 'animationChanged': CustomEvent; + 'configChanged': CustomEvent; + } + interface ojModuleSettableProperties extends JetSettableProperties { + animation: object; + config: {cleanupMode: 'onDisconnect'|'none', view: Array, viewModel: object}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojmodule/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodule/index.d.ts new file mode 100644 index 0000000000..3cf1b7ee7e --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmodule/index.d.ts @@ -0,0 +1,24 @@ +/// +declare namespace oj { + namespace ModuleBinding { + var defaults: {viewPath: string, viewSuffix: string, modelPath: string, initializeMethod: string, disposeMethod: string, activatedHandler: string, attachedHandler: string, detachedHandler: string, bindingsAppliedHandler: string, deactivatedHandler: string, transitionCompletedHandler: string}; + } + +} +declare namespace oj.ModuleBinding { + interface ConventionMethods { + dispose(info: {element: Node, valueAccessor: Function}): void; + handleActivated(info: {element: Node, valueAccessor: Function}): Promise|undefined; + handleAttached(info: {element: Node, valueAccessor: Function, fromCache: boolean}): void; + handleBindingsApplied(info: {element: Node, valueAccessor: Function}): void; + handleDeactivated(info: {element: Node, valueAccessor: Function}): void; + handleDetached(info: {element: Node, valueAccessor: Function, cachedNodes: Array}): void; + handleTransitionCompleted(info: {element: Node, valueAccessor: Function}): void; + initialize(info: {element: Node, valueAccessor: Function}): object|undefined; + } + +} +declare namespace ojModule { + var Options: {view: Promise|string|Array|DocumentFragment, viewModel: Promise|Function|object, name: string, viewName: string, require: Function|{instance: any, viewPath: string, modelPath: string}, viewModelFactory: object, params: object, createViewFunction: string, cacheKey: string, lifecycleListener: object, animation: object}; + } + diff --git a/types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts b/types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts new file mode 100644 index 0000000000..6d0592dbea --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts @@ -0,0 +1,30 @@ +/// +declare namespace oj { + namespace ModuleAnimations { + var coverStart: oj.ModuleElementAnimation; + var coverUp: oj.ModuleElementAnimation; + var fade: oj.ModuleElementAnimation; + var navChild: oj.ModuleElementAnimation; + var navParent: oj.ModuleElementAnimation; + var navSiblingEarlier: oj.ModuleElementAnimation; + var navSiblingLater: oj.ModuleElementAnimation; + var pushEnd: oj.ModuleElementAnimation; + var pushStart: oj.ModuleElementAnimation; + var revealDown: oj.ModuleElementAnimation; + var revealEnd: oj.ModuleElementAnimation; + var zoomIn: oj.ModuleElementAnimation; + var zoomOut: oj.ModuleElementAnimation; + function createAnimation(oldViewEffect: {effect: oj.AnimationUtils.AnimationMethods, [key:string]: any}|oj.AnimationUtils.AnimationMethods|null, newViewEffect: {effect: oj.AnimationUtils.AnimationMethods, [key:string]: any}|oj.AnimationUtils.AnimationMethods|null, newViewOnTop: boolean): oj.ModuleElementAnimation; + function switcher(callback: (param0: oj.ModuleAnimations.SwitcherCallBackParam) => oj.ModuleAnimations.Animations): oj.ModuleElementAnimation; + } + namespace ModuleAnimations { + type Animations = 'coverStart'|'coverUp'|'fade'|'navChild'|'navParent'|'navSiblingEarlier'|'navSiblingLater'|'pushEnd'|'pushStart'|'revealDown'|'revealEnd'|'zoomIn'|'zoomOut'; + } + namespace ModuleAnimations { + type SwitcherCallBackParam = + { + node: Element, valueAccessor: (()=> any), isInitial: boolean, oldViewModel: any, newViewModel: any + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts b/types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts new file mode 100644 index 0000000000..9d1c348467 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts @@ -0,0 +1,253 @@ +/// +/// +/// +declare namespace oj { + class ojNavigationList extends baseComponent> { + as: string; + currentItem: K; + data: oj.DataProvider|null; + display: 'all'|'icons'; + drillMode: 'none'|'collapsible'|'sliding'; + edge: 'top'|'start'; + expanded: KeySet.KeySet; + hierarchyMenuThreshold: number; + item: {renderer?: (((context: oj.ojNavigationList.ItemContext) => void)|null), selectable?: (((context: oj.ojNavigationList.ItemContext) => boolean)|boolean)}; + overflow: 'popup'|'hidden'; + rootLabel: string|null; + selection: K; + translations: {defaultRootLabel?: string, hierMenuBtnLabel?: string, previousIcon?: string}; + onAsChanged: (event: CustomEvent)=> any; + onCurrentItemChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDisplayChanged: (event: CustomEvent)=> any; + onDrillModeChanged: (event: CustomEvent)=> any; + onEdgeChanged: (event: CustomEvent)=> any; + onExpandedChanged: (event: CustomEvent)=> any; + onHierarchyMenuThresholdChanged: (event: CustomEvent)=> any; + onItemChanged: (event: CustomEvent)=> any; + onOverflowChanged: (event: CustomEvent)=> any; + onRootLabelChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojNavigationList.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojNavigationList.ojAnimateStart)=> any; + onOjBeforeCollapse: (event: oj.ojNavigationList.ojBeforeCollapse)=> any; + onOjBeforeCurrentItem: (event: oj.ojNavigationList.ojBeforeCurrentItem)=> any; + onOjBeforeExpand: (event: oj.ojNavigationList.ojBeforeExpand)=> any; + onOjBeforeSelect: (event: oj.ojNavigationList.ojBeforeSelect)=> any; + onOjCollapse: (event: oj.ojNavigationList.ojCollapse)=> any; + onOjExpand: (event: oj.ojNavigationList.ojExpand)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojNavigationListEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojNavigationList.NodeContext|null; + refresh(): void; + } + namespace ojNavigationList { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeCollapse extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { + + } + + class ojBeforeCurrentItem extends CustomEvent<{previousKey: any, previousItem: Element, key: any, item: Element, [propName: string]: any}> { + + } + + class ojBeforeExpand extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { + + } + + class ojBeforeSelect extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { + + } + + class ojCollapse extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { + + } + + class ojExpand extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { + + } + } + interface ojNavigationListEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.ojNavigationList.ojAnimateEnd; + 'ojAnimateStart': oj.ojNavigationList.ojAnimateStart; + 'ojBeforeCollapse': oj.ojNavigationList.ojBeforeCollapse; + 'ojBeforeCurrentItem': oj.ojNavigationList.ojBeforeCurrentItem; + 'ojBeforeExpand': oj.ojNavigationList.ojBeforeExpand; + 'ojBeforeSelect': oj.ojNavigationList.ojBeforeSelect; + 'ojCollapse': oj.ojNavigationList.ojCollapse; + 'ojExpand': oj.ojNavigationList.ojExpand; + 'asChanged': CustomEvent; + 'currentItemChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'displayChanged': CustomEvent; + 'drillModeChanged': CustomEvent; + 'edgeChanged': CustomEvent; + 'expandedChanged': CustomEvent; + 'hierarchyMenuThresholdChanged': CustomEvent; + 'itemChanged': CustomEvent; + 'overflowChanged': CustomEvent; + 'rootLabelChanged': CustomEvent; + 'selectionChanged': CustomEvent; + } + interface ojNavigationListSettableProperties extends baseComponentSettableProperties { + as: string; + currentItem: K; + data: oj.DataProvider|null; + display: 'all'|'icons'; + drillMode: 'none'|'collapsible'|'sliding'; + edge: 'top'|'start'; + expanded: KeySet.KeySet; + hierarchyMenuThreshold: number; + item: {renderer?: (((context: oj.ojNavigationList.ItemContext) => void)|null), selectable?: (((context: oj.ojNavigationList.ItemContext) => boolean)|boolean)}; + overflow: 'popup'|'hidden'; + rootLabel: string|null; + selection: K; + translations: {defaultRootLabel?: string, hierMenuBtnLabel?: string, previousIcon?: string}; + } + namespace ojNavigationList { + type ItemContext = + { + componentElement: Element, datasource?: oj.DataProvider, index: number, key: any, data: any, parentElement: Element + } + } + namespace ojNavigationList { + type NodeContext = + { + subId: string, index: number, key: K, group: boolean, parent?: Element + } + } + +} +declare namespace oj { + class ojTabBar extends baseComponent> { + as: string; + currentItem: any; + data: oj.DataProvider|null; + display: 'all'|'icons'; + edge: 'top'|'bottom'|'start'|'end'; + item: {renderer?: (((context: oj.ojTabBar.ItemContext) => void)|null), selectable?: (((context: oj.ojTabBar.ItemContext) => boolean)|boolean)}; + overflow: 'popup'|'hidden'; + reorderable: 'enabled'|'disabled'; + selection: any; + truncation: 'none'|'progressive'; + translations: {accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderTouchInstructionText?: string, labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string, labelRemove?: string, msgFetchingData?: string, msgNoData?: string, overflowItemLabel?: string, removeCueText?: string, selectedLabel?: string}; + onAsChanged: (event: CustomEvent)=> any; + onCurrentItemChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDisplayChanged: (event: CustomEvent)=> any; + onEdgeChanged: (event: CustomEvent)=> any; + onItemChanged: (event: CustomEvent)=> any; + onOverflowChanged: (event: CustomEvent)=> any; + onReorderableChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onTruncationChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojTabBar.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojTabBar.ojAnimateStart)=> any; + onOjBeforeCurrentItem: (event: oj.ojTabBar.ojBeforeCurrentItem)=> any; + onOjBeforeDeselect: (event: oj.ojTabBar.ojBeforeDeselect)=> any; + onOjBeforeRemove: (event: oj.ojTabBar.ojBeforeRemove)=> any; + onOjBeforeSelect: (event: oj.ojTabBar.ojBeforeSelect)=> any; + onOjDeselect: (event: oj.ojTabBar.ojDeselect)=> any; + onOjRemove: (event: oj.ojTabBar.ojRemove)=> any; + onOjReorder: (event: oj.ojTabBar.ojReorder)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTabBarEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojTabBar.NodeContext|null; + refresh(): void; + } + namespace ojTabBar { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeCurrentItem extends CustomEvent<{previousKey: any, previousItem: Element, key: any, item: Element, [propName: string]: any}> { + + } + + class ojBeforeDeselect extends CustomEvent<{fromKey: any, fromItem: Element, toKey: any, toItem: Element, [propName: string]: any}> { + + } + + class ojBeforeRemove extends CustomEvent<{item: Element, key: any, [propName: string]: any}> { + + } + + class ojBeforeSelect extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { + + } + + class ojDeselect extends CustomEvent<{fromKey: any, fromItem: Element, toKey: any, toItem: Element, [propName: string]: any}> { + + } + + class ojRemove extends CustomEvent<{item: Element, key: any, [propName: string]: any}> { + + } + + class ojReorder extends CustomEvent<{item: Element, position: 'before'|'after', reference: Element, [propName: string]: any}> { + + } + } + interface ojTabBarEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.ojTabBar.ojAnimateEnd; + 'ojAnimateStart': oj.ojTabBar.ojAnimateStart; + 'ojBeforeCurrentItem': oj.ojTabBar.ojBeforeCurrentItem; + 'ojBeforeDeselect': oj.ojTabBar.ojBeforeDeselect; + 'ojBeforeRemove': oj.ojTabBar.ojBeforeRemove; + 'ojBeforeSelect': oj.ojTabBar.ojBeforeSelect; + 'ojDeselect': oj.ojTabBar.ojDeselect; + 'ojRemove': oj.ojTabBar.ojRemove; + 'ojReorder': oj.ojTabBar.ojReorder; + 'asChanged': CustomEvent; + 'currentItemChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'displayChanged': CustomEvent; + 'edgeChanged': CustomEvent; + 'itemChanged': CustomEvent; + 'overflowChanged': CustomEvent; + 'reorderableChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'truncationChanged': CustomEvent; + } + interface ojTabBarSettableProperties extends baseComponentSettableProperties { + as: string; + currentItem: any; + data: oj.DataProvider|null; + display: 'all'|'icons'; + edge: 'top'|'bottom'|'start'|'end'; + item: {renderer?: (((context: oj.ojTabBar.ItemContext) => void)|null), selectable?: (((context: oj.ojTabBar.ItemContext) => boolean)|boolean)}; + overflow: 'popup'|'hidden'; + reorderable: 'enabled'|'disabled'; + selection: any; + truncation: 'none'|'progressive'; + translations: {accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderTouchInstructionText?: string, labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string, labelRemove?: string, msgFetchingData?: string, msgNoData?: string, overflowItemLabel?: string, removeCueText?: string, selectedLabel?: string}; + } + namespace ojTabBar { + type ItemContext = + { + componentElement: Element, datasource?: oj.DataProvider, index: number, key: K, data: D, parentElement: Element + } + } + namespace ojTabBar { + type NodeContext = + { + subId: string, index: number, key: K + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojnbox/index.d.ts b/types/@oracle/oraclejet/ojs/ojnbox/index.d.ts new file mode 100644 index 0000000000..454774c4bc --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojnbox/index.d.ts @@ -0,0 +1,251 @@ +/// +/// +declare namespace oj { + class ojNBox extends dvtBaseComponent> { + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + as: string; + cellContent: 'counts'|'auto'; + cellMaximize: 'off'|'on'; + cells: Promise>|null; + columns: Promise>|null; + columnsTitle: string; + countLabel: ((context: oj.ojNBox.CountLabelContext) => (string|null)); + data: oj.DataProvider|null; + groupAttributes: 'color'|'indicatorColor'|'indicatorIconColor'|'indicatorIconPattern'|'indicatorIconShape'; + groupBehavior: 'acrossCells'|'none'|'withinCell'; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + labelTruncation: 'ifRequired'|'on'; + maximizedColumn: string; + maximizedRow: string; + otherColor: string; + otherThreshold: number; + rows: Promise>|null; + rowsTitle: string; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + styleDefaults: {animationDuration: number, cellDefaults: {labelHalign: 'center'|'end'|'start', labelStyle: object, maximizedSvgStyle: object, minimizedSvgStyle: object, showCount: 'on'|'off'|'auto', svgStyle: object}, columnLabelStyle: object, columnsTitleStyle: object, hoverBehaviorDelay: number, nodeDefaults: {borderColor: string, borderWidth: number, color: string, iconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, indicatorColor: string, indicatorIconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, labelStyle: object, secondaryLabelStyle: object}, rowLabelStyle: object, rowsTitleStyle: object}; + tooltip: {renderer: ((context: oj.ojNBox.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, highlightedCount?: string, labelAdditionalData?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelGroup?: string, labelInvalidData?: string, labelNoData?: string, labelOther?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onCellContentChanged: (event: CustomEvent)=> any; + onCellMaximizeChanged: (event: CustomEvent)=> any; + onCellsChanged: (event: CustomEvent)=> any; + onColumnsChanged: (event: CustomEvent)=> any; + onColumnsTitleChanged: (event: CustomEvent)=> any; + onCountLabelChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onGroupAttributesChanged: (event: CustomEvent)=> any; + onGroupBehaviorChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHighlightMatchChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onLabelTruncationChanged: (event: CustomEvent)=> any; + onMaximizedColumnChanged: (event: CustomEvent)=> any; + onMaximizedRowChanged: (event: CustomEvent)=> any; + onOtherColorChanged: (event: CustomEvent)=> any; + onOtherThresholdChanged: (event: CustomEvent)=> any; + onRowsChanged: (event: CustomEvent)=> any; + onRowsTitleChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onStyleDefaultsChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTouchResponseChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojNBoxEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getCell(rowValue: string, columnValue: string): object|null; + getColumn(columnValue: string): object|null; + getColumnCount(): number; + getColumnsTitle(): string; + getContextByNode(node: Element): object|null; + getDialog(): object|null; + getGroupBehavior(): string; + getGroupNode(groupCategory: string): object|null; + getRow(rowValue: string): object|null; + getRowCount(): number; + getRowsTitle(): string; + } + interface ojNBoxEventMap extends oj.dvtBaseComponentEventMap { + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'asChanged': CustomEvent; + 'cellContentChanged': CustomEvent; + 'cellMaximizeChanged': CustomEvent; + 'cellsChanged': CustomEvent; + 'columnsChanged': CustomEvent; + 'columnsTitleChanged': CustomEvent; + 'countLabelChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'groupAttributesChanged': CustomEvent; + 'groupBehaviorChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'highlightMatchChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'labelTruncationChanged': CustomEvent; + 'maximizedColumnChanged': CustomEvent; + 'maximizedRowChanged': CustomEvent; + 'otherColorChanged': CustomEvent; + 'otherThresholdChanged': CustomEvent; + 'rowsChanged': CustomEvent; + 'rowsTitleChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'styleDefaultsChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'touchResponseChanged': CustomEvent; + } + interface ojNBoxSettableProperties extends dvtBaseComponentSettableProperties { + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + as: string; + cellContent: 'counts'|'auto'; + cellMaximize: 'off'|'on'; + cells: Array|Promise>|null; + columns: Array|Promise>|null; + columnsTitle: string; + countLabel: ((context: oj.ojNBox.CountLabelContext) => (string|null)); + data: oj.DataProvider|null; + groupAttributes: 'color'|'indicatorColor'|'indicatorIconColor'|'indicatorIconPattern'|'indicatorIconShape'; + groupBehavior: 'acrossCells'|'none'|'withinCell'; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + labelTruncation: 'ifRequired'|'on'; + maximizedColumn: string; + maximizedRow: string; + otherColor: string; + otherThreshold: number; + rows: Array|Promise>|null; + rowsTitle: string; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + styleDefaults: {animationDuration: number, cellDefaults: {labelHalign: 'center'|'end'|'start', labelStyle: object, maximizedSvgStyle: object, minimizedSvgStyle: object, showCount: 'on'|'off'|'auto', svgStyle: object}, columnLabelStyle: object, columnsTitleStyle: object, hoverBehaviorDelay: number, nodeDefaults: {borderColor: string, borderWidth: number, color: string, iconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, indicatorColor: string, indicatorIconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, labelStyle: object, secondaryLabelStyle: object}, rowLabelStyle: object, rowsTitleStyle: object}; + tooltip: {renderer: ((context: oj.ojNBox.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, highlightedCount?: string, labelAdditionalData?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelGroup?: string, labelInvalidData?: string, labelNoData?: string, labelOther?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + namespace ojNBox { + type Cell = + { + label?: string, column: string, labelHalign?: string, labelStyle?: object, svgClassName?: string, svgStyle?: object, maximizedSvgStyle?: object, maximizedSvgClassName?: string, minimizedSvgStyle?: object, minimizedSvgClassName?: string, row: string, showCount?: 'on'|'off'|'auto'|string, shortDesc?: string + } + } + namespace ojNBox { + type Column = + { + id: string, label?: string, labelStyle?: object + } + } + namespace ojNBox { + type CountLabelContext = + { + row: string, column: string, nodeCount: number, totalNodeCount: number, highlightedNodeCount: number + } + } + namespace ojNBox { + type Row = + { + id: string, label?: string, labelStyle?: object + } + } + namespace ojNBox { + type TooltipContext = + { + parentElement: Element, id: K, label: string, secondaryLabel: string, row: string, column: string, color: string, indicatorColor: string, componentElement: Element + } + } + +} +declare namespace oj { + class ojNBoxNode extends JetElement { + borderColor: string; + borderWidth: number; + categories: Array; + color?: string; + column: string; + groupCategory?: string; + icon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'mallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string, svgClassName: string, svgStyle?: object, width?: number|null}; + indicatorColor?: string; + indicatorIcon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string|null, svgClassName: string, svgStyle?: object|null, width?: number|null}; + label: string; + row: string; + secondaryLabel: string; + shortDesc: string; + svgClassName: string; + svgStyle: object|null; + xPercentage?: number|null; + yPercentage?: number|null; + onBorderColorChanged: (event: CustomEvent)=> any; + onBorderWidthChanged: (event: CustomEvent)=> any; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onColumnChanged: (event: CustomEvent)=> any; + onGroupCategoryChanged: (event: CustomEvent)=> any; + onIconChanged: (event: CustomEvent)=> any; + onIndicatorColorChanged: (event: CustomEvent)=> any; + onIndicatorIconChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onRowChanged: (event: CustomEvent)=> any; + onSecondaryLabelChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onXPercentageChanged: (event: CustomEvent)=> any; + onYPercentageChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojNBoxNodeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojNBoxNodeEventMap extends oj.JetElementEventMap { + 'borderColorChanged': CustomEvent; + 'borderWidthChanged': CustomEvent; + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'columnChanged': CustomEvent; + 'groupCategoryChanged': CustomEvent; + 'iconChanged': CustomEvent; + 'indicatorColorChanged': CustomEvent; + 'indicatorIconChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'rowChanged': CustomEvent; + 'secondaryLabelChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'xPercentageChanged': CustomEvent; + 'yPercentageChanged': CustomEvent; + } + interface ojNBoxNodeSettableProperties extends JetSettableProperties { + borderColor: string; + borderWidth: number; + categories: Array; + color?: string; + column: string; + groupCategory?: string; + icon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'mallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string, svgClassName: string, svgStyle?: object, width?: number|null}; + indicatorColor?: string; + indicatorIcon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string|null, svgClassName: string, svgStyle?: object|null, width?: number|null}; + label: string; + row: string; + secondaryLabel: string; + shortDesc: string; + svgClassName: string; + svgStyle: object|null; + xPercentage?: number|null; + yPercentage?: number|null; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts b/types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts new file mode 100644 index 0000000000..eab2775d88 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts @@ -0,0 +1,13 @@ +declare namespace oj { + class OffcanvasUtils { + constructor(); + static close(offcanvas: {selector: string}): Promise; + static open(offcanvas: {selector: string, content: string, edge: string, displayMode: string, autoDismiss: string, size: string, modality: string}): Promise; + static setupPanToReveal(offcanvas: {selector: string, edge?: string, size?: string}): void; + static setupResponsive(offcanvas: {selector: string, edge: string, query: string}): void; + static tearDownPanToReveal(offcanvas: {selector: string}): void; + static tearDownResponsive(offcanvas: {selector: string}): void; + static toggle(offcanvas: {selector: string, content: string, edge: string, displayMode: string, autoDismiss: string, size: string, modality: string}): Promise; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts b/types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts new file mode 100644 index 0000000000..335cee2990 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts @@ -0,0 +1,25 @@ +declare namespace oj { + class ojOptgroup extends JetElement { + disabled: boolean; + label: string; + onDisabledChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojOptgroupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + refresh(): void; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojOptgroupEventMap extends oj.JetElementEventMap { + 'disabledChanged': CustomEvent; + 'labelChanged': CustomEvent; + } + interface ojOptgroupSettableProperties extends JetSettableProperties { + disabled: boolean; + label: string; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojoption/index.d.ts b/types/@oracle/oraclejet/ojs/ojoption/index.d.ts new file mode 100644 index 0000000000..012cb7a4cc --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojoption/index.d.ts @@ -0,0 +1,25 @@ +declare namespace oj { + class ojOption extends JetElement { + disabled: boolean; + value: any; + onDisabledChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojOptionEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + refresh(): void; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojOptionEventMap extends oj.JetElementEventMap { + 'disabledChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojOptionSettableProperties extends JetSettableProperties { + disabled: boolean; + value: any; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts b/types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts new file mode 100644 index 0000000000..ec1496377f --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts @@ -0,0 +1,206 @@ +/// +/// +declare namespace oj { + class ojPictoChart extends dvtBaseComponent> { + animationDuration?: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'popIn'|'alphaFade'|'zoom'|'none'; + as: string; + columnCount: number|null; + columnWidth: number|null; + data: oj.DataProvider|null; + drilling: 'on'|'off'; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + layout: 'vertical'|'horizontal'; + layoutOrigin: 'topEnd'|'bottomStart'|'bottomEnd'|'topStart'; + rowCount: number|null; + rowHeight: number|null; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + tooltip: {renderer: ((context: oj.ojPictoChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onAnimationDurationChanged: (event: CustomEvent)=> any; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onColumnCountChanged: (event: CustomEvent)=> any; + onColumnWidthChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHighlightMatchChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; + onLayoutChanged: (event: CustomEvent)=> any; + onLayoutOriginChanged: (event: CustomEvent)=> any; + onRowCountChanged: (event: CustomEvent)=> any; + onRowHeightChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onOjDrill: (event: oj.ojPictoChart.ojDrill)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojPictoChartEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojPictoChart.NodeContext|null; + getItem(index: number): oj.ojPictoChart.ItemContext|null; + getItemCount(): number; + } + namespace ojPictoChart { + class ojDrill extends CustomEvent<{id: any, [propName: string]: any}> { + + } + } + interface ojPictoChartEventMap extends oj.dvtBaseComponentEventMap { + 'ojDrill': oj.ojPictoChart.ojDrill; + 'animationDurationChanged': CustomEvent; + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'asChanged': CustomEvent; + 'columnCountChanged': CustomEvent; + 'columnWidthChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'highlightMatchChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'hoverBehaviorDelayChanged': CustomEvent; + 'layoutChanged': CustomEvent; + 'layoutOriginChanged': CustomEvent; + 'rowCountChanged': CustomEvent; + 'rowHeightChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + } + interface ojPictoChartSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration?: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'popIn'|'alphaFade'|'zoom'|'none'; + as: string; + columnCount: number|null; + columnWidth: number|null; + data: oj.DataProvider|null; + drilling: 'on'|'off'; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + layout: 'vertical'|'horizontal'; + layoutOrigin: 'topEnd'|'bottomStart'|'bottomEnd'|'topStart'; + rowCount: number|null; + rowHeight: number|null; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + tooltip: {renderer: ((context: oj.ojPictoChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + namespace ojPictoChart { + type ItemContext = + { + color: string, count: number, id: K, name: string, selected: boolean, tooltip: string + } + } + namespace ojPictoChart { + type NodeContext = + { + subId: string, index: number + } + } + namespace ojPictoChart { + type TooltipContext = + { + parentElement: Element, id: K, name: string, count: number, color: string, componentElement: Element + } + } + +} +declare namespace oj { + class ojPictoChartItem extends JetElement { + borderColor: string; + borderWidth: number; + categories: Array; + color: string; + columnSpan: number; + count: number; + drilling: 'inherit'|'off'|'on'; + name: string; + rowSpan: number; + shape: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|'none'; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + onBorderColorChanged: (event: CustomEvent)=> any; + onBorderWidthChanged: (event: CustomEvent)=> any; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onColumnSpanChanged: (event: CustomEvent)=> any; + onCountChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onNameChanged: (event: CustomEvent)=> any; + onRowSpanChanged: (event: CustomEvent)=> any; + onShapeChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSourceChanged: (event: CustomEvent)=> any; + onSourceHoverChanged: (event: CustomEvent)=> any; + onSourceHoverSelectedChanged: (event: CustomEvent)=> any; + onSourceSelectedChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojPictoChartItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojPictoChartItemEventMap extends oj.JetElementEventMap { + 'borderColorChanged': CustomEvent; + 'borderWidthChanged': CustomEvent; + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'columnSpanChanged': CustomEvent; + 'countChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'nameChanged': CustomEvent; + 'rowSpanChanged': CustomEvent; + 'shapeChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'sourceChanged': CustomEvent; + 'sourceHoverChanged': CustomEvent; + 'sourceHoverSelectedChanged': CustomEvent; + 'sourceSelectedChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + } + interface ojPictoChartItemSettableProperties extends JetSettableProperties { + borderColor: string; + borderWidth: number; + categories: Array; + color: string; + columnSpan: number; + count: number; + drilling: 'inherit'|'off'|'on'; + name: string; + rowSpan: number; + shape: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|'none'; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojpopup/index.d.ts b/types/@oracle/oraclejet/ojs/ojpopup/index.d.ts new file mode 100644 index 0000000000..c0b076be88 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojpopup/index.d.ts @@ -0,0 +1,105 @@ +/// +declare namespace oj { + class ojPopup extends baseComponent { + autoDismiss: 'none'|'focusLoss'; + chrome: 'default'|'none'; + initialFocus: 'auto'|'none'|'firstFocusable'|'popup'; + modality: 'modeless'|'modal'; + position: oj.ojPopup.Position; + tail: 'none'|'simple'; + translations: {ariaCloseSkipLink?: string, ariaFocusSkipLink?: string, ariaLiveRegionInitialFocusFirstFocusable?: string, ariaLiveRegionInitialFocusFirstFocusableTouch?: string, ariaLiveRegionInitialFocusNone?: string, ariaLiveRegionInitialFocusNoneTouch?: string}; + onAutoDismissChanged: (event: CustomEvent)=> any; + onChromeChanged: (event: CustomEvent)=> any; + onInitialFocusChanged: (event: CustomEvent)=> any; + onModalityChanged: (event: CustomEvent)=> any; + onPositionChanged: (event: CustomEvent)=> any; + onTailChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojPopup.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojPopup.ojAnimateStart)=> any; + onOjBeforeClose: (event: oj.ojPopup.ojBeforeClose)=> any; + onOjBeforeOpen: (event: oj.ojPopup.ojBeforeOpen)=> any; + onOjClose: (event: oj.ojPopup.ojClose)=> any; + onOjFocus: (event: oj.ojPopup.ojFocus)=> any; + onOjOpen: (event: oj.ojPopup.ojOpen)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojPopupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + close(): void; + isOpen(): boolean; + open(launcher: string|Element, position?: oj.ojPopup.Position): void; + refresh(): void; + } + namespace ojPopup { + class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: 'open'|'close', element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeClose extends CustomEvent<{ [propName: string]: any}> { + + } + + class ojBeforeOpen extends CustomEvent<{ [propName: string]: any}> { + + } + + class ojClose extends CustomEvent<{ [propName: string]: any}> { + + } + + class ojFocus extends CustomEvent<{ [propName: string]: any}> { + + } + + class ojOpen extends CustomEvent<{ [propName: string]: any}> { + + } + } + interface ojPopupEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.ojPopup.ojAnimateEnd; + 'ojAnimateStart': oj.ojPopup.ojAnimateStart; + 'ojBeforeClose': oj.ojPopup.ojBeforeClose; + 'ojBeforeOpen': oj.ojPopup.ojBeforeOpen; + 'ojClose': oj.ojPopup.ojClose; + 'ojFocus': oj.ojPopup.ojFocus; + 'ojOpen': oj.ojPopup.ojOpen; + 'autoDismissChanged': CustomEvent; + 'chromeChanged': CustomEvent; + 'initialFocusChanged': CustomEvent; + 'modalityChanged': CustomEvent; + 'positionChanged': CustomEvent; + 'tailChanged': CustomEvent; + } + interface ojPopupSettableProperties extends baseComponentSettableProperties { + autoDismiss: 'none'|'focusLoss'; + chrome: 'default'|'none'; + initialFocus: 'auto'|'none'|'firstFocusable'|'popup'; + modality: 'modeless'|'modal'; + position: oj.ojPopup.Position; + tail: 'none'|'simple'; + translations: {ariaCloseSkipLink?: string, ariaFocusSkipLink?: string, ariaLiveRegionInitialFocusFirstFocusable?: string, ariaLiveRegionInitialFocusFirstFocusableTouch?: string, ariaLiveRegionInitialFocusNone?: string, ariaLiveRegionInitialFocusNoneTouch?: string}; + } + namespace ojPopup { + type Position = + { + my?: oj.ojPopup.PositionAlign, at?: oj.ojPopup.PositionAlign, offset?: oj.ojPopup.PositionPoint, of?: string|oj.ojPopup.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'flipcenter'|'none' + } + } + namespace ojPopup { + type PositionAlign = + { + vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' + } + } + namespace ojPopup { + type PositionPoint = + { + x?: number, y?: number + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojprogress/index.d.ts b/types/@oracle/oraclejet/ojs/ojprogress/index.d.ts new file mode 100644 index 0000000000..66fec85056 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojprogress/index.d.ts @@ -0,0 +1,28 @@ +/// +declare namespace oj { + class ojProgress extends baseComponent { + max: number; + type: 'bar'|'circle'; + value: number; + translations: {ariaIndeterminateProgressText?: string}; + onMaxChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojProgressEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojProgressEventMap extends oj.baseComponentEventMap { + 'maxChanged': CustomEvent; + 'typeChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojProgressSettableProperties extends baseComponentSettableProperties { + max: number; + type: 'bar'|'circle'; + value: number; + translations: {ariaIndeterminateProgressText?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts b/types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts new file mode 100644 index 0000000000..d3b9efbc83 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts @@ -0,0 +1,50 @@ +/// +/// +/// +declare namespace oj { + class ojProgressList extends JetElement { + data: oj.DataProvider|null; + onDataChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojProgressListEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojProgressListEventMap extends oj.JetElementEventMap { + 'dataChanged': CustomEvent; + } + interface ojProgressListSettableProperties extends JetSettableProperties { + data: oj.DataProvider|null; + } + +} +declare namespace oj { + interface ProgressItem { + addEventListener(eventType: oj.ProgressItem.EventType, listener: EventListener): void; + removeEventListener(eventType: oj.ProgressItem.EventType, listener: EventListener): void; + } + namespace ProgressItem { + enum EventType { + LOADSTART = "loadstart", + PROGRESS = "progress", + ABORT = "abort", + ERROR = "error", + LOAD = "load", + TIMEOUT = "timeout", + LOADEND = "loadend", + } + enum Status { + QUEUED = "queued", + LOADSTARTED = "loadstarted", + ABORTED = "aborted", + ERRORED = "errored", + TIMEDOUT = "timedout", + LOADED = "loaded", + } + } + + +} diff --git a/types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts b/types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts new file mode 100644 index 0000000000..7367c03bbd --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts @@ -0,0 +1,7 @@ +declare namespace oj { + class PullToRefreshUtils { + static setupPullToRefresh(element: Element, refreshFunc: (()=> Promise), options?: {threshold?: number, primaryText?: string, secondaryText?: string}): void; + static tearDownPullToRefresh(element: Element): void; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojradioset/index.d.ts b/types/@oracle/oraclejet/ojs/ojradioset/index.d.ts new file mode 100644 index 0000000000..7657b0a18c --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojradioset/index.d.ts @@ -0,0 +1,47 @@ +/// +declare namespace oj { + class ojRadioset extends editableValue { + disabled: boolean|null; + labelledBy: string|null; + required: boolean; + value: any; + translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + onDisabledChanged: (event: CustomEvent)=> any; + onLabelledByChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojRadioset.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojRadioset.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojRadiosetEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + validate(): Promise; + } + namespace ojRadioset { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojRadiosetEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojRadioset.ojAnimateEnd; + 'ojAnimateStart': oj.ojRadioset.ojAnimateStart; + 'disabledChanged': CustomEvent; + 'labelledByChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojRadiosetSettableProperties extends editableValueSettableProperties { + disabled: boolean|null; + labelledBy: string|null; + required: boolean; + value: any; + translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts b/types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts new file mode 100644 index 0000000000..5c2dee4c70 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts @@ -0,0 +1,30 @@ +/// +declare namespace oj { + class ojRefresher extends baseComponent { + refreshContent: (()=> Promise); + target: Element; + text: string; + threshold: number; + onRefreshContentChanged: (event: CustomEvent)=> any; + onTargetChanged: (event: CustomEvent)=> any; + onTextChanged: (event: CustomEvent)=> any; + onThresholdChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojRefresherEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojRefresherEventMap extends oj.baseComponentEventMap { + 'refreshContentChanged': CustomEvent; + 'targetChanged': CustomEvent; + 'textChanged': CustomEvent; + 'thresholdChanged': CustomEvent; + } + interface ojRefresherSettableProperties extends baseComponentSettableProperties { + refreshContent: (()=> Promise); + target: Element; + text: string; + threshold: number; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojrouter/index.d.ts b/types/@oracle/oraclejet/ojs/ojrouter/index.d.ts new file mode 100644 index 0000000000..44c23b8f5d --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojrouter/index.d.ts @@ -0,0 +1,69 @@ +/// +declare namespace oj { + class Router { + readonly currentState: (()=> oj.RouterState|undefined); + readonly currentValue: (()=> string|undefined); + defaultStateId: string|undefined; + static defaults: {urlAdapter?: oj.Router.urlPathAdapter|oj.Router.urlParamAdapter, baseUrl?: string, rootInstanceName?: string}; + readonly direction: string|undefined; + readonly moduleConfig: {name: KnockoutObservable, params: {ojRouter: {parentRouter: oj.Router, direction: string}}, lifecycleListener: {attached: ((param0: string)=> void)}}; + readonly name: string; + readonly observableModuleConfig: KnockoutObservable; + readonly parent: oj.Router|undefined; + static readonly rootInstance: oj.Router; + readonly stateId: ((param0?: string)=> string); + readonly states: Array|null; + static readonly transitionedToState: object; + static sync(): Promise<{hasChanged: boolean}>; + configure(option: {[key:string]: oj.RouterState.ConfigOptions}|((id:string)=> oj.RouterState)): any; + createChildRouter(name: string, parentStateId?: string): oj.Router; + dispose(): undefined; + getChildRouter(name: string): oj.Router|undefined; + getCurrentChildRouter(): oj.Router|undefined; + getState(stateId: string): oj.RouterState|undefined; + go(stateIdPath?: string|Array, options?: {historyUpdate: string}): Promise<{hasChanged: boolean}>; + retrieve(): any; + store(data: object): undefined; + } + namespace Router { + type ModuleConfigType = + { + name: KnockoutObservable, params: {ojRouter: {parentRouter: oj.Router, direction: string, parameters: object}}, lifecycleListener: {attached: ((param0: object)=> void)} + } + } + namespace Router { + class urlParamAdapter { + constructor(); + } +class urlPathAdapter { + constructor(); + } + + + } + + +} +declare namespace oj { + class RouterState { + canEnter: (()=> boolean)|(()=> Promise); + canExit: (()=> boolean)|(()=> Promise); + enter: (()=> void)|(()=> Promise); + exit: (()=> void)|(()=> Promise); + readonly id: string; + label: string|undefined; + parameters: object; + title: string|(()=> string|undefined); + value: any; + constructor(id: string, options?: oj.RouterState.ConfigOptions, router?: oj.Router); + go(): Promise<{hasChanged: boolean}>; + isCurrent(): boolean; + } + namespace RouterState { + type ConfigOptions = + { + label?: string, value?: any, isDefault?: boolean, canEnter?: (()=> boolean)|(()=> Promise), enter?: (()=> void)|(()=> Promise), canExit?: (()=> boolean)|(()=> Promise), exit?: (()=> void)|(()=> Promise) + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts b/types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts new file mode 100644 index 0000000000..d6c2cec4a5 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts @@ -0,0 +1,427 @@ +/// +declare namespace oj { + abstract class ojCombobox, SV=V, RV=V> extends editableValue { + onOjAnimateEnd: (event: oj.ojCombobox.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojCombobox.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojComboboxEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + validate(): Promise; + } + namespace ojCombobox { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojComboboxEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojCombobox.ojAnimateEnd; + 'ojAnimateStart': oj.ojCombobox.ojAnimateStart; + } + interface ojComboboxSettableProperties extends editableValueSettableProperties { + } + namespace ojCombobox { + type Optgroup = + { + disabled?: boolean, label: string, children: Array<(oj.ojCombobox.Option|oj.ojCombobox.Optgroup)> + } + } + namespace ojCombobox { + type Option = + { + disabled?: boolean, label?: string, value: any + } + } + namespace ojCombobox { + type OptionContext = + { + component: Element, parent: Element, index: number, depth: number, leaf: boolean, data: object, parentElement: Element + } + } + namespace ojCombobox { + type OptionsKeys = + { + label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys + } + } + +} +declare namespace oj { + class ojComboboxMany extends ojCombobox, ojComboboxManySettableProperties, Array, string> { + asyncValidators: Array>>; + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + minLength: number; + optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + readonly rawValue: string|null; + required: boolean; + validators: Array>|oj.Validation.RegisteredValidator>|null; + value: Array|null; + valueOptions: Array<{value: any, label?: string}> | null; + translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + onAsyncValidatorsChanged: (event: CustomEvent)=> any; + onConverterChanged: (event: CustomEvent)=> any; + onMinLengthChanged: (event: CustomEvent)=> any; + onOptionRendererChanged: (event: CustomEvent)=> any; + onOptionsChanged: (event: CustomEvent)=> any; + onOptionsKeysChanged: (event: CustomEvent)=> any; + onPickerAttributesChanged: (event: CustomEvent)=> any; + onPlaceholderChanged: (event: CustomEvent)=> any; + onRawValueChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onValidatorsChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onValueOptionsChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojComboboxMany.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojComboboxMany.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojComboboxManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojComboboxMany { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojComboboxManyEventMap extends oj.ojComboboxEventMap { + 'ojAnimateEnd': oj.ojComboboxMany.ojAnimateEnd; + 'ojAnimateStart': oj.ojComboboxMany.ojAnimateStart; + 'asyncValidatorsChanged': CustomEvent; + 'converterChanged': CustomEvent; + 'minLengthChanged': CustomEvent; + 'optionRendererChanged': CustomEvent; + 'optionsChanged': CustomEvent; + 'optionsKeysChanged': CustomEvent; + 'pickerAttributesChanged': CustomEvent; + 'placeholderChanged': CustomEvent; + 'rawValueChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'validatorsChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'valueOptionsChanged': CustomEvent; + } + interface ojComboboxManySettableProperties extends ojComboboxSettableProperties, Array, string> { + asyncValidators: Array>>; + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + minLength: number; + optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + readonly rawValue: string|null; + required: boolean; + validators: Array>|oj.Validation.RegisteredValidator>|null; + value: Array|null; + valueOptions: Array<{value: any, label?: string}> | null; + translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + } + +} +declare namespace oj { + class ojComboboxOne extends ojCombobox, any, string> { + asyncValidators: Array>; + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + filterOnOpen: 'none'|'rawValue'; + minLength: number; + optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + readonly rawValue: string|null; + required: boolean; + validators: Array|oj.Validation.RegisteredValidator>|null; + value: any; + valueOption: {value: any, label?: string}; + translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + onAsyncValidatorsChanged: (event: CustomEvent)=> any; + onConverterChanged: (event: CustomEvent)=> any; + onFilterOnOpenChanged: (event: CustomEvent)=> any; + onMinLengthChanged: (event: CustomEvent)=> any; + onOptionRendererChanged: (event: CustomEvent)=> any; + onOptionsChanged: (event: CustomEvent)=> any; + onOptionsKeysChanged: (event: CustomEvent)=> any; + onPickerAttributesChanged: (event: CustomEvent)=> any; + onPlaceholderChanged: (event: CustomEvent)=> any; + onRawValueChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onValidatorsChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onValueOptionChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojComboboxOne.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojComboboxOne.ojAnimateStart)=> any; + onOjValueUpdated: (event: oj.ojComboboxOne.ojValueUpdated)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojComboboxOneEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojComboboxOne { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojValueUpdated extends CustomEvent<{value: any, previousValue: any, [propName: string]: any}> { + + } + } + interface ojComboboxOneEventMap extends oj.ojComboboxEventMap { + 'ojAnimateEnd': oj.ojComboboxOne.ojAnimateEnd; + 'ojAnimateStart': oj.ojComboboxOne.ojAnimateStart; + 'ojValueUpdated': oj.ojComboboxOne.ojValueUpdated; + 'asyncValidatorsChanged': CustomEvent; + 'converterChanged': CustomEvent; + 'filterOnOpenChanged': CustomEvent; + 'minLengthChanged': CustomEvent; + 'optionRendererChanged': CustomEvent; + 'optionsChanged': CustomEvent; + 'optionsKeysChanged': CustomEvent; + 'pickerAttributesChanged': CustomEvent; + 'placeholderChanged': CustomEvent; + 'rawValueChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'validatorsChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'valueOptionChanged': CustomEvent; + } + interface ojComboboxOneSettableProperties extends ojComboboxSettableProperties { + asyncValidators: Array>; + converter: oj.Converter|oj.Validation.RegisteredConverter|null; + filterOnOpen: 'none'|'rawValue'; + minLength: number; + optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + readonly rawValue: string|null; + required: boolean; + validators: Array|oj.Validation.RegisteredValidator>|null; + value: any; + valueOption: {value: any, label?: string}; + translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; + } + +} +declare namespace oj { + abstract class ojSelect, SV=V> extends editableValue { + onOjAnimateEnd: (event: oj.ojSelect.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojSelect.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSelectEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + validate(): Promise; + } + namespace ojSelect { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojSelectEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojSelect.ojAnimateEnd; + 'ojAnimateStart': oj.ojSelect.ojAnimateStart; + } + interface ojSelectSettableProperties extends editableValueSettableProperties { + } + namespace ojSelect { + type Optgroup = + { + disabled?: boolean, label: string, children: Array<(oj.ojSelect.Option|oj.ojSelect.Optgroup)> + } + } + namespace ojSelect { + type Option = + { + disabled?: boolean, label?: string, value: any + } + } + namespace ojSelect { + type OptionContext = + { + component: Element, parent: Element, index: number, depth: number, leaf: boolean, data: object, parentElement: Element + } + } + namespace ojSelect { + type OptionsKeys = + { + label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys + } + } + +} +declare namespace oj { + class ojSelectMany extends ojSelect, ojSelectManySettableProperties> { + minimumResultsForSearch: number; + optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + renderMode: 'jet'|'native'; + required: boolean; + value: Array|null; + valueOptions: Array<{value: any, label?: string}> | null; + translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; + onMinimumResultsForSearchChanged: (event: CustomEvent)=> any; + onOptionRendererChanged: (event: CustomEvent)=> any; + onOptionsChanged: (event: CustomEvent)=> any; + onOptionsKeysChanged: (event: CustomEvent)=> any; + onPickerAttributesChanged: (event: CustomEvent)=> any; + onPlaceholderChanged: (event: CustomEvent)=> any; + onRenderModeChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onValueOptionsChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojSelectMany.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojSelectMany.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSelectManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojSelectMany { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojSelectManyEventMap extends oj.ojSelectEventMap { + 'ojAnimateEnd': oj.ojSelectMany.ojAnimateEnd; + 'ojAnimateStart': oj.ojSelectMany.ojAnimateStart; + 'minimumResultsForSearchChanged': CustomEvent; + 'optionRendererChanged': CustomEvent; + 'optionsChanged': CustomEvent; + 'optionsKeysChanged': CustomEvent; + 'pickerAttributesChanged': CustomEvent; + 'placeholderChanged': CustomEvent; + 'renderModeChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'valueOptionsChanged': CustomEvent; + } + interface ojSelectManySettableProperties extends ojSelectSettableProperties> { + minimumResultsForSearch: number; + optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + renderMode: 'jet'|'native'; + required: boolean; + value: Array|null; + valueOptions: Array<{value: any, label?: string}> | null; + translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; + } + +} +declare namespace oj { + class ojSelectOne extends ojSelect> { + minimumResultsForSearch: number; + optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + renderMode: 'jet'|'native'; + required: boolean; + value: any; + valueOption: {value: any, label?: string}; + translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; + onMinimumResultsForSearchChanged: (event: CustomEvent)=> any; + onOptionRendererChanged: (event: CustomEvent)=> any; + onOptionsChanged: (event: CustomEvent)=> any; + onOptionsKeysChanged: (event: CustomEvent)=> any; + onPickerAttributesChanged: (event: CustomEvent)=> any; + onPlaceholderChanged: (event: CustomEvent)=> any; + onRenderModeChanged: (event: CustomEvent)=> any; + onRequiredChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onValueOptionChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojSelectOne.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojSelectOne.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSelectOneEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojSelectOne { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojSelectOneEventMap extends oj.ojSelectEventMap { + 'ojAnimateEnd': oj.ojSelectOne.ojAnimateEnd; + 'ojAnimateStart': oj.ojSelectOne.ojAnimateStart; + 'minimumResultsForSearchChanged': CustomEvent; + 'optionRendererChanged': CustomEvent; + 'optionsChanged': CustomEvent; + 'optionsKeysChanged': CustomEvent; + 'pickerAttributesChanged': CustomEvent; + 'placeholderChanged': CustomEvent; + 'renderModeChanged': CustomEvent; + 'requiredChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'valueOptionChanged': CustomEvent; + } + interface ojSelectOneSettableProperties extends ojSelectSettableProperties { + minimumResultsForSearch: number; + optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; + options: Array|oj.DataProvider|null; + optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; + pickerAttributes: {style?: string, class?: string}; + placeholder: string|null; + renderMode: 'jet'|'native'; + required: boolean; + value: any; + valueOption: {value: any, label?: string}; + translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; + } + +} +declare namespace oj { + interface Optgroup { + children: Array<(oj.Option|oj.Optgroup)>; + disabled?: boolean; + label: string; + } + +} +declare namespace oj { + interface Option { + disabled?: boolean; + label?: string; + value: object; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojslider/index.d.ts b/types/@oracle/oraclejet/ojs/ojslider/index.d.ts new file mode 100644 index 0000000000..467073e274 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojslider/index.d.ts @@ -0,0 +1,61 @@ +/// +declare namespace oj { + class ojSlider extends editableValue { + disabled: boolean|null; + max: number|null; + min: number|null; + orientation: 'horizontal'|'vertical'; + step: number|null; + readonly transientValue: number; + type: 'fromMin'|'fromMax'|'single'; + value: number|null; + translations: {invalidStep?: string, maxMin?: string, noValue?: string, optionNum?: string, valueRange?: string}; + onDisabledChanged: (event: CustomEvent)=> any; + onMaxChanged: (event: CustomEvent)=> any; + onMinChanged: (event: CustomEvent)=> any; + onOrientationChanged: (event: CustomEvent)=> any; + onStepChanged: (event: CustomEvent)=> any; + onTransientValueChanged: (event: CustomEvent)=> any; + onTypeChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojSlider.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojSlider.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSliderEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojSlider { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojSliderEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojSlider.ojAnimateEnd; + 'ojAnimateStart': oj.ojSlider.ojAnimateStart; + 'disabledChanged': CustomEvent; + 'maxChanged': CustomEvent; + 'minChanged': CustomEvent; + 'orientationChanged': CustomEvent; + 'stepChanged': CustomEvent; + 'transientValueChanged': CustomEvent; + 'typeChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojSliderSettableProperties extends editableValueSettableProperties { + disabled: boolean|null; + max: number|null; + min: number|null; + orientation: 'horizontal'|'vertical'; + step: number|null; + readonly transientValue: number; + type: 'fromMin'|'fromMax'|'single'; + value: number|null; + translations: {invalidStep?: string, maxMin?: string, noValue?: string, optionNum?: string, valueRange?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts b/types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts new file mode 100644 index 0000000000..6ef93fd030 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts @@ -0,0 +1,270 @@ +/// +declare namespace oj { + class ojSunburst extends dvtBaseComponent> { + animationDuration: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: oj.DataProvider|null; + displayLevels: number; + drilling: 'on'|'off'; + expanded: KeySet.KeySet; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + nodeDefaults: {borderColor: string, borderWidth: number, hoverColor: string, labelDisplay: 'horizontal'|'rotated'|'off'|'auto', labelHalign: 'inner'|'outer'|'center', labelMinLength: number, labelStyle: object, selectedInnerColor: string, selectedOuterColor: string, showDisclosure: 'on'|'off'}; + rootNode: any; + rootNodeContent: {renderer: ((context: oj.ojSunburst.RootNodeContext) => ({insert: Element|string}))}; + rotation: 'off'|'on'; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + sizeLabel: string; + sorting: 'on'|'off'; + startAngle: number; + tooltip: {renderer: ((context: oj.ojSunburst.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipCollapse?: string, tooltipExpand?: string}; + onAnimationDurationChanged: (event: CustomEvent)=> any; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAnimationUpdateColorChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onColorLabelChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDisplayLevelsChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onExpandedChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHighlightMatchChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; + onNodeDefaultsChanged: (event: CustomEvent)=> any; + onRootNodeChanged: (event: CustomEvent)=> any; + onRootNodeContentChanged: (event: CustomEvent)=> any; + onRotationChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onSizeLabelChanged: (event: CustomEvent)=> any; + onSortingChanged: (event: CustomEvent)=> any; + onStartAngleChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTouchResponseChanged: (event: CustomEvent)=> any; + onOjBeforeCollapse: (event: oj.ojSunburst.ojBeforeCollapse)=> any; + onOjBeforeDrill: (event: oj.ojSunburst.ojBeforeDrill)=> any; + onOjBeforeExpand: (event: oj.ojSunburst.ojBeforeExpand)=> any; + onOjCollapse: (event: oj.ojSunburst.ojCollapse)=> any; + onOjDrill: (event: oj.ojSunburst.ojDrill)=> any; + onOjExpand: (event: oj.ojSunburst.ojExpand)=> any; + onOjRotateInput: (event: oj.ojSunburst.ojRotateInput)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSunburstEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojSunburst.NodeContext|null; + getNode(subIdPath: Array): oj.ojSunburst.DataContext|null; + } + namespace ojSunburst { + class ojBeforeCollapse extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + + class ojBeforeDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + + class ojBeforeExpand extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + + class ojCollapse extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + + class ojDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + + class ojExpand extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + + class ojRotateInput extends CustomEvent<{value: number, [propName: string]: any}> { + + } + } + interface ojSunburstEventMap extends oj.dvtBaseComponentEventMap { + 'ojBeforeCollapse': oj.ojSunburst.ojBeforeCollapse; + 'ojBeforeDrill': oj.ojSunburst.ojBeforeDrill; + 'ojBeforeExpand': oj.ojSunburst.ojBeforeExpand; + 'ojCollapse': oj.ojSunburst.ojCollapse; + 'ojDrill': oj.ojSunburst.ojDrill; + 'ojExpand': oj.ojSunburst.ojExpand; + 'ojRotateInput': oj.ojSunburst.ojRotateInput; + 'animationDurationChanged': CustomEvent; + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'animationUpdateColorChanged': CustomEvent; + 'asChanged': CustomEvent; + 'colorLabelChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'displayLevelsChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'expandedChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'highlightMatchChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'hoverBehaviorDelayChanged': CustomEvent; + 'nodeDefaultsChanged': CustomEvent; + 'rootNodeChanged': CustomEvent; + 'rootNodeContentChanged': CustomEvent; + 'rotationChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'sizeLabelChanged': CustomEvent; + 'sortingChanged': CustomEvent; + 'startAngleChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'touchResponseChanged': CustomEvent; + } + interface ojSunburstSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: oj.DataProvider|null; + displayLevels: number; + drilling: 'on'|'off'; + expanded: KeySet.KeySet; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + nodeDefaults: {borderColor: string, borderWidth: number, hoverColor: string, labelDisplay: 'horizontal'|'rotated'|'off'|'auto', labelHalign: 'inner'|'outer'|'center', labelMinLength: number, labelStyle: object, selectedInnerColor: string, selectedOuterColor: string, showDisclosure: 'on'|'off'}; + rootNode: any; + rootNodeContent: {renderer: ((context: oj.ojSunburst.RootNodeContext) => ({insert: Element|string}))}; + rotation: 'off'|'on'; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + sizeLabel: string; + sorting: 'on'|'off'; + startAngle: number; + tooltip: {renderer: ((context: oj.ojSunburst.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipCollapse?: string, tooltipExpand?: string}; + } + namespace ojSunburst { + type DataContext = + { + color: string, label: string, selected: boolean, size: number, tooltip: string + } + } + namespace ojSunburst { + type NodeContext = + { + subId: string, indexPath: Array + } + } + namespace ojSunburst { + type RootNodeContext = + { + outerBounds: {x: number, y: number, width: number, height: number}, innerBounds: {x: number, y: number, width: number, height: number}, id: K, data: object, itemData: D, componentElement: Element + } + } + namespace ojSunburst { + type TooltipContext = + { + parentElement: Element, id: K, label: string, value: number, radius: number, color: string, data: object, itemData: D, componentElement: Element + } + } + +} +declare namespace oj { + class ojSunburstNode extends JetElement { + borderColor?: string; + borderWidth?: number; + categories?: Array; + color?: string; + drilling?: 'on'|'off'|'inherit'; + label?: string; + labelDisplay?: 'horizontal'|'rotated'|'off'|'auto'; + labelHalign?: 'inner'|'outer'|'center'; + labelStyle?: object; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; + radius?: number; + selectable?: 'off'|'auto'; + shortDesc?: string; + showDisclosure?: 'on'|'off'|'inherit'; + svgClassName?: string; + svgStyle?: object; + value: number; + onBorderColorChanged: (event: CustomEvent)=> any; + onBorderWidthChanged: (event: CustomEvent)=> any; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onLabelDisplayChanged: (event: CustomEvent)=> any; + onLabelHalignChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + onPatternChanged: (event: CustomEvent)=> any; + onRadiusChanged: (event: CustomEvent)=> any; + onSelectableChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onShowDisclosureChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSunburstNodeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojSunburstNodeEventMap extends oj.JetElementEventMap { + 'borderColorChanged': CustomEvent; + 'borderWidthChanged': CustomEvent; + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'labelDisplayChanged': CustomEvent; + 'labelHalignChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + 'patternChanged': CustomEvent; + 'radiusChanged': CustomEvent; + 'selectableChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'showDisclosureChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojSunburstNodeSettableProperties extends JetSettableProperties { + borderColor?: string; + borderWidth?: number; + categories?: Array; + color?: string; + drilling?: 'on'|'off'|'inherit'; + label?: string; + labelDisplay?: 'horizontal'|'rotated'|'off'|'auto'; + labelHalign?: 'inner'|'outer'|'center'; + labelStyle?: object; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; + radius?: number; + selectable?: 'off'|'auto'; + shortDesc?: string; + showDisclosure?: 'on'|'off'|'inherit'; + svgClassName?: string; + svgStyle?: object; + value: number; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts b/types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts new file mode 100644 index 0000000000..11ce95700d --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts @@ -0,0 +1,24 @@ +/// +declare namespace oj { + class ojSwipeActions extends baseComponent { + translations: {ariaHideActionsDescription?: string, ariaShowEndActionsDescription?: string, ariaShowStartActionsDescription?: string}; + onOjAction: (event: oj.ojSwipeActions.ojAction)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwipeActionsEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + } + namespace ojSwipeActions { + class ojAction extends CustomEvent<{ [propName: string]: any}> { + + } + } + interface ojSwipeActionsEventMap extends oj.baseComponentEventMap { + 'ojAction': oj.ojSwipeActions.ojAction; + } + interface ojSwipeActionsSettableProperties extends baseComponentSettableProperties { + translations: {ariaHideActionsDescription?: string, ariaShowEndActionsDescription?: string, ariaShowStartActionsDescription?: string}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts b/types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts new file mode 100644 index 0000000000..da94a66d4b --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts @@ -0,0 +1,7 @@ +declare namespace oj { + class SwipeToRevealUtils { + static setupSwipeActions(elem: Element, options?: {threshold?: number}): void; + static tearDownSwipeActions(elem: Element): void; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojswitch/index.d.ts b/types/@oracle/oraclejet/ojs/ojswitch/index.d.ts new file mode 100644 index 0000000000..31f04cc1ee --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojswitch/index.d.ts @@ -0,0 +1,39 @@ +/// +declare namespace oj { + class ojSwitch extends editableValue { + disabled: boolean; + readonly: boolean; + value: boolean; + onDisabledChanged: (event: CustomEvent)=> any; + onReadonlyChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojSwitch.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojSwitch.ojAnimateStart)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwitchEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + namespace ojSwitch { + class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + } + interface ojSwitchEventMap extends oj.editableValueEventMap { + 'ojAnimateEnd': oj.ojSwitch.ojAnimateEnd; + 'ojAnimateStart': oj.ojSwitch.ojAnimateStart; + 'disabledChanged': CustomEvent; + 'readonlyChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojSwitchSettableProperties extends editableValueSettableProperties { + disabled: boolean; + readonly: boolean; + value: boolean; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts b/types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts new file mode 100644 index 0000000000..d99477edf8 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts @@ -0,0 +1,21 @@ +declare namespace oj { + class ojSwitcher extends JetElement { + value: string; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwitcherEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getProperty(property: string): any; + refresh(): void; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + } + interface ojSwitcherEventMap extends oj.JetElementEventMap { + 'valueChanged': CustomEvent; + } + interface ojSwitcherSettableProperties extends JetSettableProperties { + value: string; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtable/index.d.ts b/types/@oracle/oraclejet/ojs/ojtable/index.d.ts new file mode 100644 index 0000000000..5ee54785bd --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtable/index.d.ts @@ -0,0 +1,197 @@ +/// +/// +declare namespace oj { + class ojTable extends baseComponent> { + accessibility: {rowHeader: string}; + as: string; + columns: Array<{className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, id?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}>|null; + columnsDefault: {className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}; + currentRow: oj.ojTable.CurrentRow | null; + data: oj.DataProvider; + display: 'list'|'grid'; + dnd: {drag: {rows: {dataTypes?: string|Array, dragStart?: ((param0: DragEvent, param1: oj.ojTable.DragRowContext)=> void), drag?: ((param0: DragEvent)=> void), dragEnd?: ((param0: DragEvent)=> void)}}, drop: {columns: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void)}, rows: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void)}}, reorder: {columns: 'enabled'|'disabled'}}; + editMode: 'none'|'rowEdit'; + readonly firstSelectedRow: object; + horizontalGridVisible: 'auto'|'enabled'|'disabled'; + rowRenderer: ((context: oj.ojTable.RowRendererContext) => string | HTMLElement | void) | null; + scrollPolicy: 'auto'|'loadMoreOnScroll'; + scrollPolicyOptions: {fetchSize: number, maxCount: number}; + scrollPosition: {x?: number, y?: number, columnIndex?: number, rowIndex?: number, columnKey?: any, rowKey?: any, offsetX?: number, offsetY?: number}; + selection: Array & oj.ojTable.RowSelectionEnd> | Array & oj.ojTable.ColumnSelectionEnd>; + selectionMode: {column: 'single'|'multiple', row: 'single'|'multiple'}; + selectionRequired: boolean; + verticalGridVisible: 'auto'|'enabled'|'disabled'; + translations: {labelAccSelectionAffordanceBottom?: string, labelAccSelectionAffordanceTop?: string, labelDisableNonContiguousSelection?: string, labelEditRow?: string, labelEnableNonContiguousSelection?: string, labelResize?: string, labelResizePopupSpinner?: string, labelResizePopupSubmit?: string, labelSelectAndEditRow?: string, labelSelectColum?: string, labelSelectRow?: string, labelSort?: string, labelSortAsc?: string, labelSortDsc?: string, msgColumnResizeWidthValidation?: string, msgFetchingData?: string, msgInitializing?: string, msgNoData?: string, msgScrollPolicyMaxCountDetail?: string, msgScrollPolicyMaxCountSummary?: string, msgStatusSortAscending?: string, msgStatusSortDescending?: string}; + onAccessibilityChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onColumnsChanged: (event: CustomEvent)=> any; + onColumnsDefaultChanged: (event: CustomEvent)=> any; + onCurrentRowChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDisplayChanged: (event: CustomEvent)=> any; + onDndChanged: (event: CustomEvent)=> any; + onEditModeChanged: (event: CustomEvent)=> any; + onFirstSelectedRowChanged: (event: CustomEvent)=> any; + onHorizontalGridVisibleChanged: (event: CustomEvent)=> any; + onRowRendererChanged: (event: CustomEvent)=> any; + onScrollPolicyChanged: (event: CustomEvent)=> any; + onScrollPolicyOptionsChanged: (event: CustomEvent)=> any; + onScrollPositionChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onSelectionRequiredChanged: (event: CustomEvent)=> any; + onVerticalGridVisibleChanged: (event: CustomEvent)=> any; + onOjAnimateEnd: (event: oj.ojTable.ojAnimateEnd)=> any; + onOjAnimateStart: (event: oj.ojTable.ojAnimateStart)=> any; + onOjBeforeCurrentRow: (event: oj.ojTable.ojBeforeCurrentRow)=> any; + onOjBeforeRowEdit: (event: oj.ojTable.ojBeforeRowEdit)=> any; + onOjBeforeRowEditEnd: (event: oj.ojTable.ojBeforeRowEditEnd)=> any; + onOjSort: (event: oj.ojTable.ojSort)=> any; + + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojTableEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): {subId: 'oj-table-cell', rowIndex: number, columnIndex: number, key:string} | {subId: 'oj-table-footer'|'oj-table-header',index: number}; + getDataForVisibleRow(rowIndex: number) : {data: D, index: number, key: K} | null + refresh(): void; + refreshRow(rowIdx: number): Promise; + } + namespace ojTable { + class ojAnimateEnd extends CustomEvent<{action: 'add'|'remove'|'update', element: Element, [propName: string]: any}> { + + } + + class ojAnimateStart extends CustomEvent<{action: 'add'|'remove'|'update', element: Element, endCallback: (()=> void), [propName: string]: any}> { + + } + + class ojBeforeCurrentRow extends CustomEvent<{currentRow: oj.ojTable.CurrentRow, previousCurrentRow: oj.ojTable.CurrentRow, [propName: string]: any}> { + + } + + class ojBeforeRowEdit extends CustomEvent<{rowContext: object, [propName: string]: any}> { + + } + + class ojBeforeRowEditEnd extends CustomEvent<{rowContext: object, cancelEdit: object, [propName: string]: any}> { + + } + + class ojSort extends CustomEvent<{header: Element, direction: 'ascending'|'descending', [propName: string]: any}> { + + } + } + interface ojTableEventMap extends oj.baseComponentEventMap { + 'ojAnimateEnd': oj.ojTable.ojAnimateEnd; + 'ojAnimateStart': oj.ojTable.ojAnimateStart; + 'ojBeforeCurrentRow': oj.ojTable.ojBeforeCurrentRow; + 'ojBeforeRowEdit': oj.ojTable.ojBeforeRowEdit; + 'ojBeforeRowEditEnd': oj.ojTable.ojBeforeRowEditEnd; + 'ojSort': oj.ojTable.ojSort; + 'accessibilityChanged': CustomEvent; + 'asChanged': CustomEvent; + 'columnsChanged': CustomEvent; + 'columnsDefaultChanged': CustomEvent; + 'currentRowChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'displayChanged': CustomEvent; + 'dndChanged': CustomEvent; + 'editModeChanged': CustomEvent; + 'firstSelectedRowChanged': CustomEvent; + 'horizontalGridVisibleChanged': CustomEvent; + 'rowRendererChanged': CustomEvent; + 'scrollPolicyChanged': CustomEvent; + 'scrollPolicyOptionsChanged': CustomEvent; + 'scrollPositionChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'selectionRequiredChanged': CustomEvent; + 'verticalGridVisibleChanged': CustomEvent; + } + interface ojTableSettableProperties extends baseComponentSettableProperties { + accessibility: {rowHeader: string}; + as: string; + columns: Array<{className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, id?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}>|null; + columnsDefault: {className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}; + currentRow: oj.ojTable.CurrentRow | null; + data: oj.DataProvider|null; + display: 'list'|'grid'; + dnd: {drag: {rows: {dataTypes?: string|Array, dragStart?: ((param0: DragEvent, param1: oj.ojTable.DragRowContext)=> void), drag?: ((param0: DragEvent)=> void), dragEnd?: ((param0: DragEvent)=> void)}}, drop: {columns: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void)}, rows: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void)}}, reorder: {columns: 'enabled'|'disabled'}}; + editMode: 'none'|'rowEdit'; + readonly firstSelectedRow: object; + horizontalGridVisible: 'auto'|'enabled'|'disabled'; + rowRenderer: ((context: oj.ojTable.RowRendererContext) => string | HTMLElement | void) | null; + scrollPolicy: 'auto'|'loadMoreOnScroll'; + scrollPolicyOptions: {fetchSize: number, maxCount: number}; + scrollPosition: {x?: number, y?: number, columnIndex?: number, rowIndex?: number, columnKey?: any, rowKey?: any, offsetX?: number, offsetY?: number}; + selection: Array & oj.ojTable.RowSelectionEnd> | Array & oj.ojTable.ColumnSelectionEnd>; + selectionMode: {column: 'single'|'multiple', row: 'single'|'multiple'}; + selectionRequired: boolean; + verticalGridVisible: 'auto'|'enabled'|'disabled'; + translations: {labelAccSelectionAffordanceBottom?: string, labelAccSelectionAffordanceTop?: string, labelDisableNonContiguousSelection?: string, labelEditRow?: string, labelEnableNonContiguousSelection?: string, labelResize?: string, labelResizePopupSpinner?: string, labelResizePopupSubmit?: string, labelSelectAndEditRow?: string, labelSelectColum?: string, labelSelectRow?: string, labelSort?: string, labelSortAsc?: string, labelSortDsc?: string, msgColumnResizeWidthValidation?: string, msgFetchingData?: string, msgInitializing?: string, msgNoData?: string, msgScrollPolicyMaxCountDetail?: string, msgScrollPolicyMaxCountSummary?: string, msgStatusSortAscending?: string, msgStatusSortDescending?: string}; + } + namespace ojTable { + type ColumnSelectionEnd = {endIndex:{column:number},endKey?:{column:K}}|{endIndex?:{column:number}, endKey:{column:K}}; + } + namespace ojTable { + type ColumnSelectionStart = {startIndex:{column:number}, startKey?:{column:K}}|{startIndex?:{column:number}, startKey:{column:K}}; + } + namespace ojTable { + type ColumnsRendererContext = + { + cellContext: {datasource: oj.DataProvider|null, mode: 'edit'|'navigation', status: oj.ojTable.ContextStatus}, columnIndex: number, componentElement: Element, data: D, parentElement: Element, row: {[name: string]: any} + } + } + namespace ojTable { + type ContextStatus = + { + rowIndex: number, rowKey: K, currentRow: oj.ojTable.CurrentRow + } + } + namespace ojTable { + type CurrentRow = {rowIndex: number, rowKey?: K}|{rowIndex?: number, rowKey: K}; + } + namespace ojTable { + type DragRowContext = + { + rows: Array<{data: D, index: number, key: K}> + } + } + namespace ojTable { + type DropColumnContext = + { + columnIndex: number + } + } + namespace ojTable { + type DropRowContext = + { + rowIndex: number + } + } + namespace ojTable { + type FooterRendererContext = + { + columnIndex: number, componentElement: Element, footerContext: {datasource: oj.DataProvider|null}, parentElement: Element + } + } + namespace ojTable { + type HeaderRendererContext = + { + columnIndex: number, columnHeaderDefaultRenderer: ((param0: object, param1: ((param0: object)=>void))=> void), columnHeaderSortableIconRenderer: ((param0: object, param1: ((param0: Object)=>void))=> void), componentElement: Element, data: string, headerContext: {datasource: oj.DataProvider|null}, parentElement: Element + } + } + namespace ojTable { + type RowRendererContext = + { + componentElement: Element, data: {[name: string]: any}, parentElement: Element, rowContext: {datasource: oj.DataProvider|null, mode: 'edit'|'navigation', status: oj.ojTable.ContextStatus} + } + } + namespace ojTable { + type RowSelectionEnd = {endIndex: {row: number}, endKey?: {row: K}}|{endIndex?:{row: number}, endKey:{row: K}}; + } + namespace ojTable { + type RowSelectionStart = {startIndex: {row: number}, startKey?:{row: K}}|{startIndex?: {row: number}, startKey:{row: K}}; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts b/types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts new file mode 100644 index 0000000000..9400b980f7 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts @@ -0,0 +1,139 @@ +/// +/// +declare namespace oj { + class ojTagCloud extends dvtBaseComponent> { + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + as: string; + data: oj.DataProvider|null; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + layout: 'cloud'|'rectangular'; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + styleDefaults: {animationDuration?: number, hoverBehaviorDelay?: number, svgStyle?: object}; + tooltip: {renderer: ((context: oj.ojTagCloud.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHighlightMatchChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onLayoutChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onStyleDefaultsChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTouchResponseChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTagCloudEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojTagCloud.NodeContext|null; + getItem(index: number): oj.ojTagCloud.ItemContext|null; + getItemCount(): number; + } + interface ojTagCloudEventMap extends oj.dvtBaseComponentEventMap { + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'asChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'highlightMatchChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'layoutChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'styleDefaultsChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'touchResponseChanged': CustomEvent; + } + interface ojTagCloudSettableProperties extends dvtBaseComponentSettableProperties { + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + as: string; + data: oj.DataProvider|null; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + layout: 'cloud'|'rectangular'; + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + styleDefaults: {animationDuration?: number, hoverBehaviorDelay?: number, svgStyle?: object}; + tooltip: {renderer: ((context: oj.ojTagCloud.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + namespace ojTagCloud { + type ItemContext = + { + color: string, label: string, selected: boolean, tooltip: string, value: number + } + } + namespace ojTagCloud { + type NodeContext = + { + subId: string, index: number + } + } + namespace ojTagCloud { + type TooltipContext = + { + color: string, componentElement: Element, id: K, label: string, parentElement: Element, value: number + } + } + +} +declare namespace oj { + class ojTagCloudItem extends JetElement { + categories: Array; + color?: string; + label: string; + shortDesc: string; + svgClassName: string; + svgStyle: object; + url: string; + value: number|null; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onUrlChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTagCloudItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojTagCloudItemEventMap extends oj.JetElementEventMap { + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'urlChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojTagCloudItemSettableProperties extends JetSettableProperties { + categories: Array; + color?: string; + label: string; + shortDesc: string; + svgClassName: string; + svgStyle: object; + url: string; + value: number|null; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts b/types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts new file mode 100644 index 0000000000..81c012ce6d --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts @@ -0,0 +1,376 @@ +/// +/// +declare namespace oj { + class ojThematicMap extends dvtBaseComponent> { + animationDuration: number; + animationOnDisplay: 'auto'|'none'; + areaData: oj.DataProvider|null; + as: string; + focusRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + initialZooming: 'auto'|'none'; + isolatedItem: K1; + labelDisplay: 'on'|'off'|'auto'; + labelType: 'long'|'short'; + linkData: oj.DataProvider|null; + mapProvider: {geo: object, propertiesKeys: {id: string, longLabel?: string, shortLabel?: string}}; + markerData: oj.DataProvider|null; + markerZoomBehavior: 'zoom'|'fixed'; + maxZoom: number; + panning: 'auto'|'none'; + renderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + selectionRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + styleDefaults: {areaSvgStyle?: object, dataAreaDefaults?: {borderColor?: string, hoverColor?: string, selectedInnerColor?: string, selectedOuterColor?: string}, dataMarkerDefaults?: {borderColor?: string, borderStyle?: 'none'|'solid', borderWidth?: number, color?: string, height?: number, labelStyle?: object, opacity?: number, shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, width?: number}, hoverBehaviorDelay?: number, labelStyle?: object, linkDefaults?: {color?: string, width?: number}}; + tooltip: {renderer: ((context: oj.ojThematicMap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + tooltipDisplay: 'auto'|'labelAndShortDesc'|'none'|'shortDesc'; + touchResponse: 'touchStart'|'auto'; + zooming: 'auto'|'none'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onAnimationDurationChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAreaDataChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onFocusRendererChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHighlightMatchChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onHoverRendererChanged: (event: CustomEvent)=> any; + onInitialZoomingChanged: (event: CustomEvent)=> any; + onIsolatedItemChanged: (event: CustomEvent)=> any; + onLabelDisplayChanged: (event: CustomEvent)=> any; + onLabelTypeChanged: (event: CustomEvent)=> any; + onLinkDataChanged: (event: CustomEvent)=> any; + onMapProviderChanged: (event: CustomEvent)=> any; + onMarkerDataChanged: (event: CustomEvent)=> any; + onMarkerZoomBehaviorChanged: (event: CustomEvent)=> any; + onMaxZoomChanged: (event: CustomEvent)=> any; + onPanningChanged: (event: CustomEvent)=> any; + onRendererChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onSelectionRendererChanged: (event: CustomEvent)=> any; + onStyleDefaultsChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTooltipDisplayChanged: (event: CustomEvent)=> any; + onTouchResponseChanged: (event: CustomEvent)=> any; + onZoomingChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getArea(index: number): oj.ojThematicMap.DataContext|null; + getContextByNode(node: Element): oj.ojThematicMap.NodeContext|null; + getLink(index: number): oj.ojThematicMap.DataContext|null; + getMarker(index: number): oj.ojThematicMap.DataContext|null; + } + interface ojThematicMapEventMap extends oj.dvtBaseComponentEventMap { + 'animationDurationChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'areaDataChanged': CustomEvent; + 'asChanged': CustomEvent; + 'focusRendererChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'highlightMatchChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'hoverRendererChanged': CustomEvent; + 'initialZoomingChanged': CustomEvent; + 'isolatedItemChanged': CustomEvent; + 'labelDisplayChanged': CustomEvent; + 'labelTypeChanged': CustomEvent; + 'linkDataChanged': CustomEvent; + 'mapProviderChanged': CustomEvent; + 'markerDataChanged': CustomEvent; + 'markerZoomBehaviorChanged': CustomEvent; + 'maxZoomChanged': CustomEvent; + 'panningChanged': CustomEvent; + 'rendererChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'selectionRendererChanged': CustomEvent; + 'styleDefaultsChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'tooltipDisplayChanged': CustomEvent; + 'touchResponseChanged': CustomEvent; + 'zoomingChanged': CustomEvent; + } + interface ojThematicMapSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number; + animationOnDisplay: 'auto'|'none'; + areaData: oj.DataProvider|null; + as: string; + focusRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + initialZooming: 'auto'|'none'; + isolatedItem: K1; + labelDisplay: 'on'|'off'|'auto'; + labelType: 'long'|'short'; + linkData: oj.DataProvider|null; + mapProvider: {geo: object, propertiesKeys: {id: string, longLabel?: string, shortLabel?: string}}; + markerData: oj.DataProvider|null; + markerZoomBehavior: 'zoom'|'fixed'; + maxZoom: number; + panning: 'auto'|'none'; + renderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + selection: Array; + selectionMode: 'single'|'multiple'|'none'; + selectionRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); + styleDefaults: {areaSvgStyle?: object, dataAreaDefaults?: {borderColor?: string, hoverColor?: string, selectedInnerColor?: string, selectedOuterColor?: string}, dataMarkerDefaults?: {borderColor?: string, borderStyle?: 'none'|'solid', borderWidth?: number, color?: string, height?: number, labelStyle?: object, opacity?: number, shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, width?: number}, hoverBehaviorDelay?: number, labelStyle?: object, linkDefaults?: {color?: string, width?: number}}; + tooltip: {renderer: ((context: oj.ojThematicMap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + tooltipDisplay: 'auto'|'labelAndShortDesc'|'none'|'shortDesc'; + touchResponse: 'touchStart'|'auto'; + zooming: 'auto'|'none'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + namespace ojThematicMap { + type DataContext = + { + color: string, label: string, selected: boolean, tooltip: string + } + } + namespace ojThematicMap { + type NodeContext = + { + subId: string, index: number + } + } + namespace ojThematicMap { + type RendererContext = + { + color: string, componentElement: Element, data: object, id: K1|K2|K3, itemData: D1|D2|D3, label: string, location: string|null, parentElement: Element, previousState: {hovered: boolean, selected: boolean, focused: boolean}, renderDefaultFocus: (()=> void), renderDefaultHover: (()=> void), renderDefaultSelection: (()=> void), root: Element|null, state: {hovered: boolean, selected: boolean, focused: boolean}, x: number|null, y: number|null + } + } + namespace ojThematicMap { + type TooltipContext = + { + color: string|null, componentElement: Element, data: object|null, id: K1|K2|K3, itemData: D1|D2|D3, label: string|null, location: string|null, locationName: string|null, parentElement: Element, tooltip: string, x: number, y: number + } + } + +} +declare namespace oj { + class ojThematicMapArea extends JetElement { + categories: Array; + color: string; + label: string; + labelStyle: object; + location: string; + opacity: number; + selectable: 'auto'|'off'; + shortDesc: string; + svgClassName: string; + svgStyle: object; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + onLocationChanged: (event: CustomEvent)=> any; + onOpacityChanged: (event: CustomEvent)=> any; + onSelectableChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapAreaEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojThematicMapAreaEventMap extends oj.JetElementEventMap { + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + 'locationChanged': CustomEvent; + 'opacityChanged': CustomEvent; + 'selectableChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + } + interface ojThematicMapAreaSettableProperties extends JetSettableProperties { + categories: Array; + color: string; + label: string; + labelStyle: object; + location: string; + opacity: number; + selectable: 'auto'|'off'; + shortDesc: string; + svgClassName: string; + svgStyle: object; + } + +} +declare namespace oj { + class ojThematicMapLink extends JetElement { + categories: Array; + color: string; + endLocation: {id?: any, location?: string, x?: number, y?: number}; + selectable: 'auto'|'off'; + shortDesc: string; + startLocation: {id?: any, location?: string, x?: number, y?: number}; + svgClassName: string; + svgStyle: object; + width: number; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onEndLocationChanged: (event: CustomEvent)=> any; + onSelectableChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onStartLocationChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onWidthChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapLinkEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojThematicMapLinkEventMap extends oj.JetElementEventMap { + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'endLocationChanged': CustomEvent; + 'selectableChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'startLocationChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'widthChanged': CustomEvent; + } + interface ojThematicMapLinkSettableProperties extends JetSettableProperties { + categories: Array; + color: string; + endLocation: {id?: any, location?: string, x?: number, y?: number}; + selectable: 'auto'|'off'; + shortDesc: string; + startLocation: {id?: any, location?: string, x?: number, y?: number}; + svgClassName: string; + svgStyle: object; + width: number; + } + +} +declare namespace oj { + class ojThematicMapMarker extends JetElement { + borderColor: string; + borderStyle: 'solid'|'none'; + borderWidth: number; + categories: Array; + color: string; + height: number; + label: string; + labelPosition: 'bottom'|'center'|'top'; + labelStyle: object; + location: string; + opacity: number; + rotation: number; + selectable: 'auto'|'off'; + shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + value: number; + width: number; + x: number|null; + y: number|null; + onBorderColorChanged: (event: CustomEvent)=> any; + onBorderStyleChanged: (event: CustomEvent)=> any; + onBorderWidthChanged: (event: CustomEvent)=> any; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onHeightChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onLabelPositionChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + onLocationChanged: (event: CustomEvent)=> any; + onOpacityChanged: (event: CustomEvent)=> any; + onRotationChanged: (event: CustomEvent)=> any; + onSelectableChanged: (event: CustomEvent)=> any; + onShapeChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSourceChanged: (event: CustomEvent)=> any; + onSourceHoverChanged: (event: CustomEvent)=> any; + onSourceHoverSelectedChanged: (event: CustomEvent)=> any; + onSourceSelectedChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + onWidthChanged: (event: CustomEvent)=> any; + onXChanged: (event: CustomEvent)=> any; + onYChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapMarkerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojThematicMapMarkerEventMap extends oj.JetElementEventMap { + 'borderColorChanged': CustomEvent; + 'borderStyleChanged': CustomEvent; + 'borderWidthChanged': CustomEvent; + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'heightChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'labelPositionChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + 'locationChanged': CustomEvent; + 'opacityChanged': CustomEvent; + 'rotationChanged': CustomEvent; + 'selectableChanged': CustomEvent; + 'shapeChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'sourceChanged': CustomEvent; + 'sourceHoverChanged': CustomEvent; + 'sourceHoverSelectedChanged': CustomEvent; + 'sourceSelectedChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'valueChanged': CustomEvent; + 'widthChanged': CustomEvent; + 'xChanged': CustomEvent; + 'yChanged': CustomEvent; + } + interface ojThematicMapMarkerSettableProperties extends JetSettableProperties { + borderColor: string; + borderStyle: 'solid'|'none'; + borderWidth: number; + categories: Array; + color: string; + height: number; + label: string; + labelPosition: 'bottom'|'center'|'top'; + labelStyle: object; + location: string; + opacity: number; + rotation: number; + selectable: 'auto'|'off'; + shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + value: number; + width: number; + x: number|null; + y: number|null; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts b/types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts new file mode 100644 index 0000000000..ba23106a05 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts @@ -0,0 +1,15 @@ +/// +/// +declare namespace oj { + abstract class dvtTimeComponent extends dvtBaseComponent { + + addEventListener(type: T, listener: (this: HTMLElement, ev: dvtTimeComponentEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface dvtTimeComponentEventMap extends oj.dvtBaseComponentEventMap { + } + interface dvtTimeComponentSettableProperties extends dvtBaseComponentSettableProperties { + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts b/types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts new file mode 100644 index 0000000000..1710eb655d --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts @@ -0,0 +1,40 @@ +/// +/// +/// +declare namespace oj { + class ojTimeAxis extends dvtBaseComponent { + converter: oj.ojTimeAxis.Converter|oj.Converter; + end: string; + scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years'; + start: string; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + onConverterChanged: (event: CustomEvent)=> any; + onEndChanged: (event: CustomEvent)=> any; + onScaleChanged: (event: CustomEvent)=> any; + onStartChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTimeAxisEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojTimeAxisEventMap extends oj.dvtBaseComponentEventMap { + 'converterChanged': CustomEvent; + 'endChanged': CustomEvent; + 'scaleChanged': CustomEvent; + 'startChanged': CustomEvent; + } + interface ojTimeAxisSettableProperties extends dvtBaseComponentSettableProperties { + converter: oj.ojTimeAxis.Converter|oj.Converter; + end: string; + scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years'; + start: string; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; + } + namespace ojTimeAxis { + type Converter = + { + default?: oj.Converter, seconds?: oj.Converter, minutes?: oj.Converter, hours?: oj.Converter, days?: oj.Converter, weeks?: oj.Converter, months?: oj.Converter, quarters?: oj.Converter, years?: oj.Converter + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts b/types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts new file mode 100644 index 0000000000..9252a83ed8 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts @@ -0,0 +1,8 @@ +declare namespace oj { + class TimeUtils { + static getDate(pos: number, rangeStartTime: Date|string|number, rangeEndTime: Date|string|number, rangeWidth: number): number; + static getLength(startTime: Date|string|number, endTime: Date|string|number, rangeStartTime: Date|string|number, rangeEndTime: Date|string|number, rangeWidth: number): number; + static getPosition(time: Date|string|number, rangeStartTime: Date|string|number, rangeEndTime: Date|string|number, rangeWidth: number): number; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts b/types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts new file mode 100644 index 0000000000..a8eec009ec --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts @@ -0,0 +1,19 @@ +/// +declare namespace oj { + class ojToolbar extends baseComponent { + chroming: 'full'|'half'|'outlined'; + onChromingChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojToolbarEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + refresh(): void; + } + interface ojToolbarEventMap extends oj.baseComponentEventMap { + 'chromingChanged': CustomEvent; + } + interface ojToolbarSettableProperties extends baseComponentSettableProperties { + chroming: 'full'|'half'|'outlined'; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtrain/index.d.ts b/types/@oracle/oraclejet/ojs/ojtrain/index.d.ts new file mode 100644 index 0000000000..db6720b353 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtrain/index.d.ts @@ -0,0 +1,58 @@ +/// +declare namespace oj { + class ojTrain extends baseComponent { + selectedStep: string; + steps: Array; + onSelectedStepChanged: (event: CustomEvent)=> any; + onStepsChanged: (event: CustomEvent)=> any; + onOjBeforeDeselect: (event: oj.ojTrain.ojBeforeDeselect)=> any; + onOjBeforeSelect: (event: oj.ojTrain.ojBeforeSelect)=> any; + onOjDeselect: (event: oj.ojTrain.ojDeselect)=> any; + onOjSelect: (event: oj.ojTrain.ojSelect)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTrainEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getNextSelectableStep(): string|null; + getPreviousSelectableStep(): string|null; + getStep(id: string): oj.ojTrain.Step|null; + refresh(): void; + updateStep(id: string, stepProperties: {id?: string, label?: string, disabled?: boolean, visited?: boolean, messageType?: 'info'|'error'|'fatal'|'warning'}): void; + } + namespace ojTrain { + class ojBeforeDeselect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { + + } + + class ojBeforeSelect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { + + } + + class ojDeselect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { + + } + + class ojSelect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { + + } + } + interface ojTrainEventMap extends oj.baseComponentEventMap { + 'ojBeforeDeselect': oj.ojTrain.ojBeforeDeselect; + 'ojBeforeSelect': oj.ojTrain.ojBeforeSelect; + 'ojDeselect': oj.ojTrain.ojDeselect; + 'ojSelect': oj.ojTrain.ojSelect; + 'selectedStepChanged': CustomEvent; + 'stepsChanged': CustomEvent; + } + interface ojTrainSettableProperties extends baseComponentSettableProperties { + selectedStep: string; + steps: Array; + } + namespace ojTrain { + type Step = + { + id: string, label: string, disabled?: boolean, visited?: boolean, messageType?: 'info'|'error'|'fatal'|'warning' + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts new file mode 100644 index 0000000000..333e0208ec --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts @@ -0,0 +1,7 @@ +/// +declare namespace oj { + interface TreeDataProvider extends DataProvider { + getChildDataProvider(any): TreeDataProvider + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts b/types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts new file mode 100644 index 0000000000..96a1db2873 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts @@ -0,0 +1,241 @@ +/// +/// +declare namespace oj { + class ojTreemap extends dvtBaseComponent> { + animationDuration: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: oj.DataProvider|null; + displayLevels: number; + drilling: 'on'|'off'; + groupGaps: 'all'|'none'|'outer'; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + isolatedNode: any; + layout: 'sliceAndDiceHorizontal'|'sliceAndDiceVertical'|'squarified'; + nodeContent: {renderer: ((context: oj.ojTreemap.NodeContentContext) => ({insert: Element|string}))}; + nodeDefaults: {groupLabelDisplay: 'node'|'off'|'header', header: {backgroundColor: string, borderColor: string, hoverBackgroundColor: string, hoverInnerColor: string, hoverOuterColor: string, isolate: 'off'|'on', labelHalign: 'center'|'end'|'start', labelStyle: object, selectedBackgroundColor: string, selectedInnerColor: string, selectedOuterColor: string, useNodeColor: 'on'|'off'}, hoverColor: string, labelDisplay: 'off'|'node', labelHalign: 'start'|'end'|'center', labelMinLength: number, labelStyle: object, labelValign: 'top'|'bottom'|'center', selectedInnerColor: string, selectedOuterColor: string}; + nodeSeparators: 'bevels'|'gaps'; + rootNode: any; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + sizeLabel: string; + sorting: 'on'|'off'; + tooltip: {renderer: ((context: oj.ojTreemap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipIsolate?: string, tooltipRestore?: string}; + onAnimationDurationChanged: (event: CustomEvent)=> any; + onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; + onAnimationOnDisplayChanged: (event: CustomEvent)=> any; + onAnimationUpdateColorChanged: (event: CustomEvent)=> any; + onAsChanged: (event: CustomEvent)=> any; + onColorLabelChanged: (event: CustomEvent)=> any; + onDataChanged: (event: CustomEvent)=> any; + onDisplayLevelsChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onGroupGapsChanged: (event: CustomEvent)=> any; + onHiddenCategoriesChanged: (event: CustomEvent)=> any; + onHighlightMatchChanged: (event: CustomEvent)=> any; + onHighlightedCategoriesChanged: (event: CustomEvent)=> any; + onHoverBehaviorChanged: (event: CustomEvent)=> any; + onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; + onIsolatedNodeChanged: (event: CustomEvent)=> any; + onLayoutChanged: (event: CustomEvent)=> any; + onNodeContentChanged: (event: CustomEvent)=> any; + onNodeDefaultsChanged: (event: CustomEvent)=> any; + onNodeSeparatorsChanged: (event: CustomEvent)=> any; + onRootNodeChanged: (event: CustomEvent)=> any; + onSelectionChanged: (event: CustomEvent)=> any; + onSelectionModeChanged: (event: CustomEvent)=> any; + onSizeLabelChanged: (event: CustomEvent)=> any; + onSortingChanged: (event: CustomEvent)=> any; + onTooltipChanged: (event: CustomEvent)=> any; + onTouchResponseChanged: (event: CustomEvent)=> any; + onOjBeforeDrill: (event: oj.ojTreemap.ojBeforeDrill)=> any; + onOjDrill: (event: oj.ojTreemap.ojDrill)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTreemapEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + getContextByNode(node: Element): oj.ojTreemap.NodeContext|null; + getNode(subIdPath: Array): oj.ojTreemap.DataContext|null; + } + namespace ojTreemap { + class ojBeforeDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + + class ojDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { + + } + } + interface ojTreemapEventMap extends oj.dvtBaseComponentEventMap { + 'ojBeforeDrill': oj.ojTreemap.ojBeforeDrill; + 'ojDrill': oj.ojTreemap.ojDrill; + 'animationDurationChanged': CustomEvent; + 'animationOnDataChangeChanged': CustomEvent; + 'animationOnDisplayChanged': CustomEvent; + 'animationUpdateColorChanged': CustomEvent; + 'asChanged': CustomEvent; + 'colorLabelChanged': CustomEvent; + 'dataChanged': CustomEvent; + 'displayLevelsChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'groupGapsChanged': CustomEvent; + 'hiddenCategoriesChanged': CustomEvent; + 'highlightMatchChanged': CustomEvent; + 'highlightedCategoriesChanged': CustomEvent; + 'hoverBehaviorChanged': CustomEvent; + 'hoverBehaviorDelayChanged': CustomEvent; + 'isolatedNodeChanged': CustomEvent; + 'layoutChanged': CustomEvent; + 'nodeContentChanged': CustomEvent; + 'nodeDefaultsChanged': CustomEvent; + 'nodeSeparatorsChanged': CustomEvent; + 'rootNodeChanged': CustomEvent; + 'selectionChanged': CustomEvent; + 'selectionModeChanged': CustomEvent; + 'sizeLabelChanged': CustomEvent; + 'sortingChanged': CustomEvent; + 'tooltipChanged': CustomEvent; + 'touchResponseChanged': CustomEvent; + } + interface ojTreemapSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number; + animationOnDataChange: 'auto'|'none'; + animationOnDisplay: 'auto'|'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: oj.DataProvider|null; + displayLevels: number; + drilling: 'on'|'off'; + groupGaps: 'all'|'none'|'outer'; + hiddenCategories: Array; + highlightMatch: 'any'|'all'; + highlightedCategories: Array; + hoverBehavior: 'dim'|'none'; + hoverBehaviorDelay: number; + isolatedNode: any; + layout: 'sliceAndDiceHorizontal'|'sliceAndDiceVertical'|'squarified'; + nodeContent: {renderer: ((context: oj.ojTreemap.NodeContentContext) => ({insert: Element|string}))}; + nodeDefaults: {groupLabelDisplay: 'node'|'off'|'header', header: {backgroundColor: string, borderColor: string, hoverBackgroundColor: string, hoverInnerColor: string, hoverOuterColor: string, isolate: 'off'|'on', labelHalign: 'center'|'end'|'start', labelStyle: object, selectedBackgroundColor: string, selectedInnerColor: string, selectedOuterColor: string, useNodeColor: 'on'|'off'}, hoverColor: string, labelDisplay: 'off'|'node', labelHalign: 'start'|'end'|'center', labelMinLength: number, labelStyle: object, labelValign: 'top'|'bottom'|'center', selectedInnerColor: string, selectedOuterColor: string}; + nodeSeparators: 'bevels'|'gaps'; + rootNode: any; + selection: Array; + selectionMode: 'none'|'single'|'multiple'; + sizeLabel: string; + sorting: 'on'|'off'; + tooltip: {renderer: ((context: oj.ojTreemap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; + touchResponse: 'touchStart'|'auto'; + translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipIsolate?: string, tooltipRestore?: string}; + } + namespace ojTreemap { + type DataContext = + { + color: string, label: string, selected: boolean, size: number, tooltip: string + } + } + namespace ojTreemap { + type NodeContentContext = + { + bounds: {x: number, y: number, width: number, height: number}, id: K, data: object, itemData: D, componentElement: Element + } + } + namespace ojTreemap { + type NodeContext = + { + subId: string, indexPath: Array + } + } + namespace ojTreemap { + type TooltipContext = + { + parentElement: Element, id: K, label: string, value: number, color: string, data: object, itemData: D, componentElement: Element + } + } + +} +declare namespace oj { + class ojTreemapNode extends JetElement { + categories?: Array; + color?: string; + drilling?: 'on'|'off'|'inherit'; + groupLabelDisplay?: 'node'|'off'|'header'; + header?: {isolate?: 'off'|'on', labelHalign?: 'center'|'end'|'start', labelStyle?: object, useNodeColor?: 'on'|'off'}; + label?: string; + labelDisplay?: 'off'|'node'; + labelHalign?: 'start'|'end'|'center'; + labelStyle?: object; + labelValign?: 'top'|'bottom'|'center'; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; + selectable?: 'off'|'auto'; + shortDesc?: string; + svgClassName?: string; + svgStyle?: object; + value: number; + onCategoriesChanged: (event: CustomEvent)=> any; + onColorChanged: (event: CustomEvent)=> any; + onDrillingChanged: (event: CustomEvent)=> any; + onGroupLabelDisplayChanged: (event: CustomEvent)=> any; + onHeaderChanged: (event: CustomEvent)=> any; + onLabelChanged: (event: CustomEvent)=> any; + onLabelDisplayChanged: (event: CustomEvent)=> any; + onLabelHalignChanged: (event: CustomEvent)=> any; + onLabelStyleChanged: (event: CustomEvent)=> any; + onLabelValignChanged: (event: CustomEvent)=> any; + onPatternChanged: (event: CustomEvent)=> any; + onSelectableChanged: (event: CustomEvent)=> any; + onShortDescChanged: (event: CustomEvent)=> any; + onSvgClassNameChanged: (event: CustomEvent)=> any; + onSvgStyleChanged: (event: CustomEvent)=> any; + onValueChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTreemapNodeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + } + interface ojTreemapNodeEventMap extends oj.JetElementEventMap { + 'categoriesChanged': CustomEvent; + 'colorChanged': CustomEvent; + 'drillingChanged': CustomEvent; + 'groupLabelDisplayChanged': CustomEvent; + 'headerChanged': CustomEvent; + 'labelChanged': CustomEvent; + 'labelDisplayChanged': CustomEvent; + 'labelHalignChanged': CustomEvent; + 'labelStyleChanged': CustomEvent; + 'labelValignChanged': CustomEvent; + 'patternChanged': CustomEvent; + 'selectableChanged': CustomEvent; + 'shortDescChanged': CustomEvent; + 'svgClassNameChanged': CustomEvent; + 'svgStyleChanged': CustomEvent; + 'valueChanged': CustomEvent; + } + interface ojTreemapNodeSettableProperties extends JetSettableProperties { + categories?: Array; + color?: string; + drilling?: 'on'|'off'|'inherit'; + groupLabelDisplay?: 'node'|'off'|'header'; + header?: {isolate?: 'off'|'on', labelHalign?: 'center'|'end'|'start', labelStyle?: object, useNodeColor?: 'on'|'off'}; + label?: string; + labelDisplay?: 'off'|'node'; + labelHalign?: 'start'|'end'|'center'; + labelStyle?: object; + labelValign?: 'top'|'bottom'|'center'; + pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; + selectable?: 'off'|'auto'; + shortDesc?: string; + svgClassName?: string; + svgStyle?: object; + value: number; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts new file mode 100644 index 0000000000..01a6280ff9 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts @@ -0,0 +1,188 @@ +/// +/// +declare namespace oj { + interface AsyncValidator { + hint: Promise; + validate(value: V): Promise + } + +} +declare namespace oj { + class ColorConverter extends Converter { + constructor(options?: oj.ColorConverter.ConverterOptions); + format(color: oj.Color): string|null; + getHint(): string; + parse(value: string): oj.Color; + resolvedOptions(): oj.ColorConverter.ConverterOptions; + } + namespace ColorConverter { + type ConverterOptions = + { + format?: 'rgb'|'hsl'|'hsv'|'hex'|'hex3' + } + } + +} +declare namespace oj { + class ColorConverterFactory { + createConverter(options?: oj.ColorConverter.ConverterOptions): oj.ColorConverter; + } + +} +declare namespace oj { + class Converter { + format(value: V): string|null; + getHint?(): string|null + getOptions?(): object + parse(value: string): V; + resolvedOptions?(): object + } + +} +declare namespace oj { + class ConverterError { + constructor(summary: string, detail: string); + getMessage(): oj.Message; + } + +} +declare namespace oj { + class ConverterFactory { + static CONVERTER_TYPE_COLOR: string; + static CONVERTER_TYPE_DATETIME: string; + static CONVERTER_TYPE_NUMBER: string; + createConverter(options: object|null): oj.Converter; + } + +} +declare namespace oj { + class IntlConverterUtils { + static dateToLocalIso(date: Date): string; + static getConverterInstance(converterOption: string|oj.Validation.RegisteredConverter|oj.Converter): oj.Converter|null + static getInitials(firstName?: string, lastName?: string): string|undefined; + static getLocalTimeZoneOffset(): string; + static isoToDate(isoString: string): Date; + static isoToLocalDate(isoString: string): Date; + } + +} +declare namespace oj { + class LengthValidator extends Validator { + static defaults: {countBy: string}; + constructor(options?: oj.LengthValidator.ValidatorOptions); + getHint(): string|null; + validate(value: string|number): void; + } + namespace LengthValidator { + type ValidatorOptions = + { + countBy?: 'codeUnit'|'codePoint', min?: number, max?: number, hint?: {max?: string, min?: string, inRange?: string, exact?: string}, messageDetail?: {tooLong?: string, tooShort?: string}, messageSummary?: {tooLong?: string, tooShort?: string} + } + } + +} +declare namespace oj { + class LengthValidatorFactory { + createValidator(options?: oj.LengthValidator.ValidatorOptions): oj.LengthValidator; + } + +} +declare namespace oj { + class LocaleData { + static getDayNames(type?: 'abbreviated'|'narrow'|'wide'): Array; + static getFirstDayOfWeek(): number; + static getMonthNames(type?: 'abbreviated'|'narrow'|'wide'): Array; + static getWeekendEnd(): number; + static getWeekendStart(): number; + static isMonthPriorToYear(): boolean; + static setBundle(bundle: object): void; + } + +} +declare namespace oj { + class RegExpValidator extends Validator { + constructor(options?: oj.RegExpValidator.ValidatorOptions); + getHint(): string|null; + validate(value: string|number): void; + } + namespace RegExpValidator { + type ValidatorOptions = + { + pattern?: string, hint?: string, messageSummary?: string, messageDetail?: string + } + } + +} +declare namespace oj { + class RegExpValidatorFactory { + createValidator(options: oj.RegExpValidator.ValidatorOptions): oj.RegExpValidator; + } + +} +declare namespace oj { + class RequiredValidator extends Validator { + constructor(options?: oj.RequiredValidator.ValidatorOptions); + getHint(): string|null; + validate(value: object|string|number): void; + } + namespace RequiredValidator { + type ValidatorOptions = + { + hint?: string, messageSummary?: string, messageDetail?: string + } + } + +} +declare namespace oj { + class RequiredValidatorFactory { + createValidator(options?: oj.RequiredValidator.ValidatorOptions): oj.RequiredValidator; + } + +} +declare namespace oj { + class Validation { + static converterFactory>(type:'number'|'color'|'datetime'|string, instance?:CF): CF|null + static getDefaultConverterFactory(type: 'number'|'color'|'datetime'): oj.ConverterFactory|null + static getDefaultValidatorFactory(type: 'required'|'regexp'|'numberRange'|'length'|'dateTimeRange'|'dateRestriction'): oj.ValidatorFactory|null + static validatorFactory>(type:'required'|'regexp'|'numberRange'|'length'|'dateTimeRange'|'dateRestriction'|string, instance?:VF): VF|null + } + namespace Validation { + type RegisteredConverter = + { + type: string, options?: object + } + } + namespace Validation { + type RegisteredValidator = + { + type: string, options?: object + } + } + +} +declare namespace oj { + class Validator { + getHint?(): string|null + validate(value: V): void; + } + +} +declare namespace oj { + class ValidatorError { + constructor(summary: string, detail: string); + getMessage(): oj.Message; + } + +} +declare namespace oj { + class ValidatorFactory { + static VALIDATOR_TYPE_DATERESTRICTION: string; + static VALIDATOR_TYPE_DATETIMERANGE: string; + static VALIDATOR_TYPE_LENGTH: string; + static VALIDATOR_TYPE_NUMBERRANGE: string; + static VALIDATOR_TYPE_REGEXP: string; + static VALIDATOR_TYPE_REQUIRED: string; + createValidator(options: object|null): oj.Validator; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts new file mode 100644 index 0000000000..f4ab6b312b --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts @@ -0,0 +1,108 @@ +/// +declare namespace oj { + class DateRestrictionValidator extends Validator { + constructor(options?: oj.DateRestrictionValidator.ValidatorOptions); + getHint(): string|null; + validate(value: string): void; + } + namespace DateRestrictionValidator { + type DayFormatterInput = + { + fullYear: number, month: number, date: number + } + } + namespace DateRestrictionValidator { + type DayFormatterOutput = + { + disabled?: boolean, className?: string, tooltip?: string + } + } + namespace DateRestrictionValidator { + type ValidatorOptions = + { + dayFormatter?: ((param0: oj.DateRestrictionValidator.DayFormatterInput)=> oj.DateRestrictionValidator.DayFormatterOutput|null|'all'), messageSummary?: string, messageDetail?: string + } + } + +} +declare namespace oj { + class DateRestrictionValidatorFactory { + createValidator(options?: oj.DateRestrictionValidator.ValidatorOptions): oj.DateRestrictionValidator; + } + +} +declare namespace oj { + abstract class DateTimeConverter extends Converter { + abstract calculateWeek(value: string): number|undefined; + compareISODates(isoStr: string, isoStr2: string): number; + format(value: string): string|null; + getAvailableTimeZones(): Array; + abstract isDayNameSet():boolean + abstract isDaySet():boolean + abstract isHourInAMPMSet():boolean + abstract isHourInDaySet():boolean + abstract isMilliSecondSet():boolean + abstract isMinuteSet():boolean + abstract isMonthSet():boolean + abstract isSecondSet():boolean + abstract isYearSet():boolean + parse(value: string): string; + } + +} +declare namespace oj { + class DateTimeConverterFactory { + createConverter(options?: oj.IntlDateTimeConverter.ConverterOptions): oj.IntlDateTimeConverter; + } + +} +declare namespace oj { + class DateTimeRangeValidator extends Validator { + constructor(options?: oj.DateTimeRangeValidator.ValidatorOptions); + getHint(): string|null; + validate(value: string): void; + } + namespace DateTimeRangeValidator { + type ValidatorOptions = + { + converter: oj.DateTimeConverter, min?: string, max?: string, hint?: {max?: string, min?: string, inRange?: string}, translationKey?: string, messageDetail?: {rangeUnderflow?: string, rangeOverflow?: string}, messageSummary?: {rangeUnderflow?: string, rangeOverflow?: string} + } + } + +} +declare namespace oj { + class DateTimeRangeValidatorFactory { + createValidator(options?: oj.DateTimeRangeValidator.ValidatorOptions): oj.DateTimeRangeValidator; + } + +} +declare namespace oj { + class IntlDateTimeConverter extends DateTimeConverter { + constructor(options?: oj.IntlDateTimeConverter.ConverterOptions); + calculateWeek(value: string): number; + compareISODates(isoStr: string, isoStr2: string): number; + format(value: string): string|null; + formatRelative(value: string, relativeOptions?: {formatUsing?: string, dateField?: string, relativeTime?: string, dateOnly?: boolean, timeZone?: string}): string|null; + getAvailableTimeZones(): Array; + getHint(): null; + getOptions(): oj.IntlDateTimeConverter.ConverterOptions; + isDayNameSet(): boolean; + isDaySet(): boolean; + isHourInAMPMSet(): boolean; + isHourInDaySet(): boolean; + isMilliSecondSet(): boolean; + isMinuteSet(): boolean; + isMonthSet(): boolean; + isSecondSet(): boolean; + isYearSet(): boolean; + parse(value: string): string|null; + resolvedOptions(): oj.IntlDateTimeConverter.ConverterOptions; + } + namespace IntlDateTimeConverter { + type ConverterOptions = + { + year?: '2-digit'|'numeric', 'two-digit-year-start'?: number, month?: '2-digit'|'numeric'|'narrow'|'short'|'long', day?: '2-digit'|'numeric', hour?: '2-digit'|'numeric', minute?: '2-digit'|'numeric', second?: '2-digit'|'numeric', millisecond?: 'numeric', weekday?: 'narrow'|'short'|'long', era?: 'narrow'|'short'|'long', timeZoneName?: 'short'|'long', timeZone?: string, isoStrFormat?: 'offset'|'zulu'|'local'|'auto', dst?: boolean, hour12?: boolean, pattern?: string, formatType?: 'date'|'time'|'datetime', dateFormat?: 'short'|'medium'|'long'|'full', timeFormat?: 'short'|'medium'|'long'|'full', lenientParse?: 'full'|'none' + } + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts new file mode 100644 index 0000000000..d53b2b8258 --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts @@ -0,0 +1,51 @@ +/// +declare namespace oj { + class IntlNumberConverter extends NumberConverter { + constructor(options?: oj.IntlNumberConverter.ConverterOptions); + format(value: number): string; + getHint(): null; + getOptions(): oj.IntlNumberConverter.ConverterOptions; + parse(value: string): number|null; + resolvedOptions(): oj.IntlNumberConverter.ConverterOptions; + } + namespace IntlNumberConverter { + type ConverterOptions = + { + style?: 'decimal'|'currency'|'percent'|'unit', currency?: string, unit?: 'byte'|'bit', currencyDisplay?: 'code'|'symbol'|'name', decimalFormat?: 'standard'|'short'|'long', currencyFormat?: 'standard'|'short'|'long', minimumIntegerDigits?: number, minimumFractionDigits?: number, maximumFractionDigits?: number, useGrouping?: boolean, pattern?: string, roundingMode?: 'HALF_UP'|'HALF_DOWN'|'HALF_EVEN', roundDuringParse?: boolean, separators?: object, lenientParse?: 'full'|'none' + } + } + +} +declare namespace oj { + class NumberConverter extends Converter { + format(value: number): string|null; + parse(value: string): number; + } + +} +declare namespace oj { + class NumberConverterFactory { + createConverter(options?: oj.IntlNumberConverter.ConverterOptions): oj.IntlNumberConverter; + } + +} +declare namespace oj { + class NumberRangeValidator extends Validator { + constructor(options?: oj.NumberRangeValidator.ValidatorOptions); + getHint(): string|null; + validate(value: string|number): void; + } + namespace NumberRangeValidator { + type ValidatorOptions = + { + converter?: oj.NumberConverter, min?: number, max?: number, hint?: {max?: string, min?: string, inRange?: string, exact?: string}, messageDetail?: {rangeUnderflow?: string, rangeOverflow?: string, exact?: string}, messageSummary?: {rangeUnderflow?: string, rangeOverflow?: string} + } + } + +} +declare namespace oj { + class NumberRangeValidatorFactory { + createValidator(options?: oj.NumberRangeValidator.ValidatorOptions): oj.NumberRangeValidator; + } + +} diff --git a/types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts new file mode 100644 index 0000000000..c714ed9ecc --- /dev/null +++ b/types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts @@ -0,0 +1,22 @@ +declare namespace oj { + class ojValidationGroup extends JetElement { + readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; + onValidChanged: (event: CustomEvent)=> any; + + addEventListener(type: T, listener: (this: HTMLElement, ev: ojValidationGroupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + + focusOn(key?: '@firstInvalidShown'): void; + getProperty(property: string): any; + setProperties(properties: object): void; + setProperty(property: string, value: any): void; + showMessages(): void; + } + interface ojValidationGroupEventMap extends oj.JetElementEventMap { + 'validChanged': CustomEvent; + } + interface ojValidationGroupSettableProperties extends JetSettableProperties { + readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; + } + +} diff --git a/types/@oracle/tests/oraclejet/@oraclejet-tests.ts b/types/@oracle/tests/oraclejet/@oraclejet-tests.ts new file mode 100644 index 0000000000..9fc8ff4951 --- /dev/null +++ b/types/@oracle/tests/oraclejet/@oraclejet-tests.ts @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. + * The Universal Permissive License (UPL), Version 1.0 + */ +import "ojs/ojcore"; +import "ojs/ojinputtext"; +import "ojs/ojinputnumber"; + +/** + * @public + * @export + */ +class Test { + value: string; + + constructor() { + let self = this; + self.value = "Good Morning"; + + let textInput = document.getElementById('text-input') as oj.ojInputText; + //test a custom API of the component + let rawVal: string = textInput.rawValue; + } +} + +export = Test; \ No newline at end of file diff --git a/types/@oracle/tsconfig.json b/types/@oracle/tsconfig.json new file mode 100644 index 0000000000..812f56815d --- /dev/null +++ b/types/@oracle/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "module": "amd", + "lib": ["dom","es5","scripthost", "es2015.core","es2015.collection","es2015","esnext.asynciterable"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": ["knockout"], + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "target": "es5", + "typeRoots": ["../","./oraclejet/","./oraclejet/ojs/"] + }, + "include": [ + "/tests/oraclejet/@oraclejet-tests.ts", + "./oraclejet/**/*" + ] +} \ No newline at end of file diff --git a/types/@oracle/tslint.json b/types/@oracle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/@oracle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6814f8fa911ee85bd2170d6603129a1292fb5571 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 18:36:48 -0700 Subject: [PATCH 012/646] Update to latest version --- types/@oracle/index.d.ts | 0 types/@oracle/oraclejet/index.d.ts | 0 types/@oracle/oraclejet/ojs/index.d.ts | 23 - .../oraclejet/ojs/ojaccordion/index.d.ts | 49 - .../oraclejet/ojs/ojanimation/index.d.ts | 19 - .../ojs/ojarraydataprovider/index.d.ts | 22 - .../ojs/ojarraytreedataprovider/index.d.ts | 18 - .../@oracle/oraclejet/ojs/ojavatar/index.d.ts | 28 - .../@oracle/oraclejet/ojs/ojbutton/index.d.ts | 144 -- .../@oracle/oraclejet/ojs/ojchart/index.d.ts | 822 ------- .../oraclejet/ojs/ojcheckboxset/index.d.ts | 47 - .../oraclejet/ojs/ojcollapsible/index.d.ts | 52 - .../ojs/ojcollectiondataprovider/index.d.ts | 17 - .../@oracle/oraclejet/ojs/ojcolor/index.d.ts | 179 -- .../oraclejet/ojs/ojcolorpalette/index.d.ts | 56 - .../oraclejet/ojs/ojcolorspectrum/index.d.ts | 44 - .../oraclejet/ojs/ojcomponentcore/index.d.ts | 31 - .../oraclejet/ojs/ojcomposite/index.d.ts | 31 - .../oraclejet/ojs/ojconveyorbelt/index.d.ts | 23 - types/@oracle/oraclejet/ojs/ojcore/index.d.ts | 123 - .../oraclejet/ojs/ojdataprovider/index.d.ts | 254 -- .../oraclejet/ojs/ojdatetimepicker/index.d.ts | 308 --- .../@oracle/oraclejet/ojs/ojdefer/index.d.ts | 13 - .../ojs/ojdeferreddataprovider/index.d.ts | 17 - .../@oracle/oraclejet/ojs/ojdialog/index.d.ts | 127 - .../oraclejet/ojs/ojdvt-base/index.d.ts | 20 - .../oraclejet/ojs/ojeditablevalue/index.d.ts | 67 - .../oraclejet/ojs/ojfilepicker/index.d.ts | 44 - .../oraclejet/ojs/ojfilmstrip/index.d.ts | 42 - .../oraclejet/ojs/ojformlayout/index.d.ts | 37 - .../@oracle/oraclejet/ojs/ojgantt/index.d.ts | 286 --- .../@oracle/oraclejet/ojs/ojgauge/index.d.ts | 347 --- .../oraclejet/ojs/ojindexer/index.d.ts | 13 - .../oraclejet/ojs/ojinputnumber/index.d.ts | 95 - .../oraclejet/ojs/ojinputtext/index.d.ts | 178 -- .../@oracle/oraclejet/ojs/ojkeyset/index.d.ts | 32 - .../ojs/ojknockout-keyset/index.d.ts | 9 - .../oraclejet/ojs/ojknockout-model/index.d.ts | 7 - .../oraclejet/ojs/ojknockout/index.d.ts | 14 - .../@oracle/oraclejet/ojs/ojlabel/index.d.ts | 33 - .../oraclejet/ojs/ojlabelvalue/index.d.ts | 25 - .../@oracle/oraclejet/ojs/ojlegend/index.d.ts | 230 -- .../ojs/ojlistdataproviderview/index.d.ts | 21 - .../oraclejet/ojs/ojlistview/index.d.ts | 167 -- .../oraclejet/ojs/ojmasonrylayout/index.d.ts | 85 - types/@oracle/oraclejet/ojs/ojmenu/index.d.ts | 87 - .../oraclejet/ojs/ojmenuselectmany/index.d.ts | 36 - .../oraclejet/ojs/ojmessage/index.d.ts | 51 - .../oraclejet/ojs/ojmessages/index.d.ts | 55 - .../oraclejet/ojs/ojmessaging/index.d.ts | 30 - .../@oracle/oraclejet/ojs/ojmodel/index.d.ts | 169 -- .../ojs/ojmodule-element-utils/index.d.ts | 3 - .../oraclejet/ojs/ojmodule-element/index.d.ts | 54 - .../@oracle/oraclejet/ojs/ojmodule/index.d.ts | 24 - .../ojs/ojmoduleanimations/index.d.ts | 30 - .../oraclejet/ojs/ojnavigationlist/index.d.ts | 253 -- types/@oracle/oraclejet/ojs/ojnbox/index.d.ts | 251 -- .../oraclejet/ojs/ojoffcanvas/index.d.ts | 13 - .../oraclejet/ojs/ojoptgroup/index.d.ts | 25 - .../@oracle/oraclejet/ojs/ojoption/index.d.ts | 25 - .../oraclejet/ojs/ojpictochart/index.d.ts | 206 -- .../@oracle/oraclejet/ojs/ojpopup/index.d.ts | 105 - .../oraclejet/ojs/ojprogress/index.d.ts | 28 - .../oraclejet/ojs/ojprogresslist/index.d.ts | 50 - .../oraclejet/ojs/ojpulltorefresh/index.d.ts | 7 - .../oraclejet/ojs/ojradioset/index.d.ts | 47 - .../oraclejet/ojs/ojrefresher/index.d.ts | 30 - .../@oracle/oraclejet/ojs/ojrouter/index.d.ts | 69 - .../oraclejet/ojs/ojselectcombobox/index.d.ts | 427 ---- .../@oracle/oraclejet/ojs/ojslider/index.d.ts | 61 - .../oraclejet/ojs/ojsunburst/index.d.ts | 270 --- .../oraclejet/ojs/ojswipeactions/index.d.ts | 24 - .../oraclejet/ojs/ojswipetoreveal/index.d.ts | 7 - .../@oracle/oraclejet/ojs/ojswitch/index.d.ts | 39 - .../oraclejet/ojs/ojswitcher/index.d.ts | 21 - .../@oracle/oraclejet/ojs/ojtable/index.d.ts | 197 -- .../oraclejet/ojs/ojtagcloud/index.d.ts | 139 -- .../oraclejet/ojs/ojthematicmap/index.d.ts | 376 --- .../oraclejet/ojs/ojtime-base/index.d.ts | 15 - .../oraclejet/ojs/ojtimeaxis/index.d.ts | 40 - .../oraclejet/ojs/ojtimeutils/index.d.ts | 8 - .../oraclejet/ojs/ojtoolbar/index.d.ts | 19 - .../@oracle/oraclejet/ojs/ojtrain/index.d.ts | 58 - .../ojs/ojtreedataprovider/index.d.ts | 7 - .../oraclejet/ojs/ojtreemap/index.d.ts | 241 -- .../ojs/ojvalidation-base/index.d.ts | 188 -- .../ojs/ojvalidation-datetime/index.d.ts | 108 - .../ojs/ojvalidation-number/index.d.ts | 51 - .../ojs/ojvalidationgroup/index.d.ts | 22 - .../tests/oraclejet/@oraclejet-tests.ts | 26 - types/@oracle/tslint.json | 1 - types/oraclejet/index.d.ts | 60 + types/oraclejet/ojaccordion/index.d.ts | 66 + types/oraclejet/ojanimation/index.d.ts | 111 + .../oraclejet/ojarraydataprovider/index.d.ts | 27 + .../ojarraytreedataprovider/index.d.ts | 25 + .../ojattributegrouphandler/index.d.ts | 23 + types/oraclejet/ojavatar/index.d.ts | 29 + types/oraclejet/ojbutton/index.d.ts | 165 ++ types/oraclejet/ojchart/index.d.ts | 2104 +++++++++++++++++ types/oraclejet/ojcheckboxset/index.d.ts | 69 + types/oraclejet/ojcollapsible/index.d.ts | 64 + .../ojcollectiondataprovider/index.d.ts | 16 + types/oraclejet/ojcolor/index.d.ts | 182 ++ types/oraclejet/ojcolorpalette/index.d.ts | 74 + types/oraclejet/ojcolorspectrum/index.d.ts | 62 + types/oraclejet/ojcomponentcore/index.d.ts | 6 + types/oraclejet/ojcomposite/index.d.ts | 45 + types/oraclejet/ojconfig/index.d.ts | 9 + types/oraclejet/ojcontext/index.d.ts | 39 + types/oraclejet/ojconveyorbelt/index.d.ts | 26 + types/oraclejet/ojdatagrid/index.d.ts | 520 ++++ types/oraclejet/ojdataprovider/index.d.ts | 111 + types/oraclejet/ojdatetimepicker/index.d.ts | 639 +++++ types/oraclejet/ojdefer/index.d.ts | 21 + .../ojdeferreddataprovider/index.d.ts | 16 + types/oraclejet/ojdiagram/index.d.ts | 790 +++++++ types/oraclejet/ojdialog/index.d.ts | 148 ++ types/oraclejet/ojdvt-base/index.d.ts | 57 + types/oraclejet/ojeditablevalue/index.d.ts | 96 + types/oraclejet/ojexpressionutils/index.d.ts | 5 + types/oraclejet/ojfilepicker/index.d.ts | 43 + types/oraclejet/ojfilmstrip/index.d.ts | 63 + types/oraclejet/ojformlayout/index.d.ts | 38 + types/oraclejet/ojgantt/index.d.ts | 679 ++++++ types/oraclejet/ojganttutils/index.d.ts | 4 + types/oraclejet/ojgauge/index.d.ts | 574 +++++ types/oraclejet/ojinputnumber/index.d.ts | 150 ++ types/oraclejet/ojinputtext/index.d.ts | 249 ++ types/oraclejet/ojkeyset/index.d.ts | 28 + types/oraclejet/ojknockout-keyset/index.d.ts | 8 + types/oraclejet/ojknockout-model/index.d.ts | 3 + .../ojknockouttemplateutils/index.d.ts | 1 + types/oraclejet/ojlabel/index.d.ts | 48 + types/oraclejet/ojlabelvalue/index.d.ts | 26 + types/oraclejet/ojlegend/index.d.ts | 286 +++ .../ojlistdataproviderview/index.d.ts | 25 + types/oraclejet/ojlistview/index.d.ts | 335 +++ types/oraclejet/ojlocaledata/index.d.ts | 7 + types/oraclejet/ojlogger/index.d.ts | 10 + types/oraclejet/ojmasonrylayout/index.d.ts | 119 + types/oraclejet/ojmenu/index.d.ts | 105 + types/oraclejet/ojmenuselectmany/index.d.ts | 39 + types/oraclejet/ojmessage/index.d.ts | 80 + types/oraclejet/ojmessages/index.d.ts | 73 + types/oraclejet/ojmessaging/index.d.ts | 15 + types/oraclejet/ojmodel/index.d.ts | 280 +++ .../ojmodule-element-utils/index.d.ts | 8 + types/oraclejet/ojmodule-element/index.d.ts | 89 + types/oraclejet/ojmoduleanimations/index.d.ts | 34 + types/oraclejet/ojnavigationlist/index.d.ts | 360 +++ types/oraclejet/ojnbox/index.d.ts | 490 ++++ types/oraclejet/ojoptgroup/index.d.ts | 26 + types/oraclejet/ojoption/index.d.ts | 26 + types/oraclejet/ojpictochart/index.d.ts | 268 +++ types/oraclejet/ojpopup/index.d.ts | 128 + types/oraclejet/ojprogress/index.d.ts | 35 + types/oraclejet/ojprogresslist/index.d.ts | 30 + types/oraclejet/ojpulltorefresh/index.d.ts | 6 + types/oraclejet/ojradioset/index.d.ts | 69 + types/oraclejet/ojrefresher/index.d.ts | 33 + .../ojresponsiveknockoututils/index.d.ts | 4 + types/oraclejet/ojresponsiveutils/index.d.ts | 4 + types/oraclejet/ojrouter/index.d.ts | 131 + types/oraclejet/ojselectcombobox/index.d.ts | 714 ++++++ types/oraclejet/ojslider/index.d.ts | 83 + types/oraclejet/ojsunburst/index.d.ts | 407 ++++ types/oraclejet/ojswipeactions/index.d.ts | 36 + types/oraclejet/ojswipetoreveal/index.d.ts | 4 + types/oraclejet/ojswitch/index.d.ts | 49 + types/oraclejet/ojswitcher/index.d.ts | 22 + types/oraclejet/ojtable/index.d.ts | 595 +++++ types/oraclejet/ojtagcloud/index.d.ts | 208 ++ types/oraclejet/ojthematicmap/index.d.ts | 576 +++++ types/oraclejet/ojthemeutils/index.d.ts | 4 + types/oraclejet/ojtime-base/index.d.ts | 22 + types/oraclejet/ojtimeaxis/index.d.ts | 87 + types/oraclejet/ojtimeutils/index.d.ts | 3 + types/oraclejet/ojtoolbar/index.d.ts | 22 + types/oraclejet/ojtrain/index.d.ts | 78 + types/oraclejet/ojtranslation/index.d.ts | 5 + types/oraclejet/ojtreedataprovider/index.d.ts | 5 + types/oraclejet/ojtreemap/index.d.ts | 392 +++ types/oraclejet/ojvalidation-base/index.d.ts | 144 ++ .../ojvalidation-datetime/index.d.ts | 130 + .../oraclejet/ojvalidation-number/index.d.ts | 67 + types/oraclejet/ojvalidationgroup/index.d.ts | 23 + types/oraclejet/test.ts | 113 + types/{@oracle => oraclejet}/tsconfig.json | 13 +- types/oraclejet/tslint.json | 3 + 190 files changed, 14434 insertions(+), 8197 deletions(-) delete mode 100644 types/@oracle/index.d.ts delete mode 100644 types/@oracle/oraclejet/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojanimation/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojavatar/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojbutton/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojchart/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcolor/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojcore/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojdefer/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojdialog/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojgantt/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojgauge/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojindexer/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojknockout/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojlabel/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojlegend/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojlistview/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmenu/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmessage/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmessages/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmodel/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmodule/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojnbox/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojoption/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojpopup/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojprogress/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojradioset/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojrouter/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojslider/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojswitch/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtable/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtrain/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts delete mode 100644 types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts delete mode 100644 types/@oracle/tests/oraclejet/@oraclejet-tests.ts delete mode 100644 types/@oracle/tslint.json create mode 100644 types/oraclejet/index.d.ts create mode 100644 types/oraclejet/ojaccordion/index.d.ts create mode 100644 types/oraclejet/ojanimation/index.d.ts create mode 100644 types/oraclejet/ojarraydataprovider/index.d.ts create mode 100644 types/oraclejet/ojarraytreedataprovider/index.d.ts create mode 100644 types/oraclejet/ojattributegrouphandler/index.d.ts create mode 100644 types/oraclejet/ojavatar/index.d.ts create mode 100644 types/oraclejet/ojbutton/index.d.ts create mode 100644 types/oraclejet/ojchart/index.d.ts create mode 100644 types/oraclejet/ojcheckboxset/index.d.ts create mode 100644 types/oraclejet/ojcollapsible/index.d.ts create mode 100644 types/oraclejet/ojcollectiondataprovider/index.d.ts create mode 100644 types/oraclejet/ojcolor/index.d.ts create mode 100644 types/oraclejet/ojcolorpalette/index.d.ts create mode 100644 types/oraclejet/ojcolorspectrum/index.d.ts create mode 100644 types/oraclejet/ojcomponentcore/index.d.ts create mode 100644 types/oraclejet/ojcomposite/index.d.ts create mode 100644 types/oraclejet/ojconfig/index.d.ts create mode 100644 types/oraclejet/ojcontext/index.d.ts create mode 100644 types/oraclejet/ojconveyorbelt/index.d.ts create mode 100644 types/oraclejet/ojdatagrid/index.d.ts create mode 100644 types/oraclejet/ojdataprovider/index.d.ts create mode 100644 types/oraclejet/ojdatetimepicker/index.d.ts create mode 100644 types/oraclejet/ojdefer/index.d.ts create mode 100644 types/oraclejet/ojdeferreddataprovider/index.d.ts create mode 100644 types/oraclejet/ojdiagram/index.d.ts create mode 100644 types/oraclejet/ojdialog/index.d.ts create mode 100644 types/oraclejet/ojdvt-base/index.d.ts create mode 100644 types/oraclejet/ojeditablevalue/index.d.ts create mode 100644 types/oraclejet/ojexpressionutils/index.d.ts create mode 100644 types/oraclejet/ojfilepicker/index.d.ts create mode 100644 types/oraclejet/ojfilmstrip/index.d.ts create mode 100644 types/oraclejet/ojformlayout/index.d.ts create mode 100644 types/oraclejet/ojgantt/index.d.ts create mode 100644 types/oraclejet/ojganttutils/index.d.ts create mode 100644 types/oraclejet/ojgauge/index.d.ts create mode 100644 types/oraclejet/ojinputnumber/index.d.ts create mode 100644 types/oraclejet/ojinputtext/index.d.ts create mode 100644 types/oraclejet/ojkeyset/index.d.ts create mode 100644 types/oraclejet/ojknockout-keyset/index.d.ts create mode 100644 types/oraclejet/ojknockout-model/index.d.ts create mode 100644 types/oraclejet/ojknockouttemplateutils/index.d.ts create mode 100644 types/oraclejet/ojlabel/index.d.ts create mode 100644 types/oraclejet/ojlabelvalue/index.d.ts create mode 100644 types/oraclejet/ojlegend/index.d.ts create mode 100644 types/oraclejet/ojlistdataproviderview/index.d.ts create mode 100644 types/oraclejet/ojlistview/index.d.ts create mode 100644 types/oraclejet/ojlocaledata/index.d.ts create mode 100644 types/oraclejet/ojlogger/index.d.ts create mode 100644 types/oraclejet/ojmasonrylayout/index.d.ts create mode 100644 types/oraclejet/ojmenu/index.d.ts create mode 100644 types/oraclejet/ojmenuselectmany/index.d.ts create mode 100644 types/oraclejet/ojmessage/index.d.ts create mode 100644 types/oraclejet/ojmessages/index.d.ts create mode 100644 types/oraclejet/ojmessaging/index.d.ts create mode 100644 types/oraclejet/ojmodel/index.d.ts create mode 100644 types/oraclejet/ojmodule-element-utils/index.d.ts create mode 100644 types/oraclejet/ojmodule-element/index.d.ts create mode 100644 types/oraclejet/ojmoduleanimations/index.d.ts create mode 100644 types/oraclejet/ojnavigationlist/index.d.ts create mode 100644 types/oraclejet/ojnbox/index.d.ts create mode 100644 types/oraclejet/ojoptgroup/index.d.ts create mode 100644 types/oraclejet/ojoption/index.d.ts create mode 100644 types/oraclejet/ojpictochart/index.d.ts create mode 100644 types/oraclejet/ojpopup/index.d.ts create mode 100644 types/oraclejet/ojprogress/index.d.ts create mode 100644 types/oraclejet/ojprogresslist/index.d.ts create mode 100644 types/oraclejet/ojpulltorefresh/index.d.ts create mode 100644 types/oraclejet/ojradioset/index.d.ts create mode 100644 types/oraclejet/ojrefresher/index.d.ts create mode 100644 types/oraclejet/ojresponsiveknockoututils/index.d.ts create mode 100644 types/oraclejet/ojresponsiveutils/index.d.ts create mode 100644 types/oraclejet/ojrouter/index.d.ts create mode 100644 types/oraclejet/ojselectcombobox/index.d.ts create mode 100644 types/oraclejet/ojslider/index.d.ts create mode 100644 types/oraclejet/ojsunburst/index.d.ts create mode 100644 types/oraclejet/ojswipeactions/index.d.ts create mode 100644 types/oraclejet/ojswipetoreveal/index.d.ts create mode 100644 types/oraclejet/ojswitch/index.d.ts create mode 100644 types/oraclejet/ojswitcher/index.d.ts create mode 100644 types/oraclejet/ojtable/index.d.ts create mode 100644 types/oraclejet/ojtagcloud/index.d.ts create mode 100644 types/oraclejet/ojthematicmap/index.d.ts create mode 100644 types/oraclejet/ojthemeutils/index.d.ts create mode 100644 types/oraclejet/ojtime-base/index.d.ts create mode 100644 types/oraclejet/ojtimeaxis/index.d.ts create mode 100644 types/oraclejet/ojtimeutils/index.d.ts create mode 100644 types/oraclejet/ojtoolbar/index.d.ts create mode 100644 types/oraclejet/ojtrain/index.d.ts create mode 100644 types/oraclejet/ojtranslation/index.d.ts create mode 100644 types/oraclejet/ojtreedataprovider/index.d.ts create mode 100644 types/oraclejet/ojtreemap/index.d.ts create mode 100644 types/oraclejet/ojvalidation-base/index.d.ts create mode 100644 types/oraclejet/ojvalidation-datetime/index.d.ts create mode 100644 types/oraclejet/ojvalidation-number/index.d.ts create mode 100644 types/oraclejet/ojvalidationgroup/index.d.ts create mode 100644 types/oraclejet/test.ts rename types/{@oracle => oraclejet}/tsconfig.json (68%) create mode 100644 types/oraclejet/tslint.json diff --git a/types/@oracle/index.d.ts b/types/@oracle/index.d.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/types/@oracle/oraclejet/index.d.ts b/types/@oracle/oraclejet/index.d.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/types/@oracle/oraclejet/ojs/index.d.ts b/types/@oracle/oraclejet/ojs/index.d.ts deleted file mode 100644 index 90fb69208a..0000000000 --- a/types/@oracle/oraclejet/ojs/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// -declare namespace oj { - - var revision: string; - var version: string; - function ajax(settings?: object): object; - function sync(method: string, model: oj.Model|oj.Collection, options?: object): object; - -} -declare namespace oj { - interface JetSettableProperties { - } - interface GenericSetter { - set(propertyName: K, propertyValue: SP[K]): void; - unset(propertyName: K): void; - } - abstract class JetElement extends HTMLElement implements GenericSetter { - set(propertyName: K, propertyValue: SP[K]): void; - unset(propertyName: K): void; - } - interface JetElementEventMap extends HTMLElementEventMap { - } -} \ No newline at end of file diff --git a/types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts b/types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts deleted file mode 100644 index 427ee7ecaa..0000000000 --- a/types/@oracle/oraclejet/ojs/ojaccordion/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// -declare namespace oj { - class ojAccordion extends baseComponent { - expanded: Array<{id?: string, index?: number}>|null; - multiple: boolean; - onExpandedChanged: (event: CustomEvent)=> any; - onMultipleChanged: (event: CustomEvent)=> any; - onOjBeforeCollapse: (event: oj.ojAccordion.ojBeforeCollapse)=> any; - onOjBeforeExpand: (event: oj.ojAccordion.ojBeforeExpand)=> any; - onOjCollapse: (event: oj.ojAccordion.ojCollapse)=> any; - onOjExpand: (event: oj.ojAccordion.ojExpand)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojAccordionEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - } - namespace ojAccordion { - class ojBeforeCollapse extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { - - } - - class ojBeforeExpand extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { - - } - - class ojCollapse extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { - - } - - class ojExpand extends CustomEvent<{toCollapsible: Element, fromCollapsible: Element, [propName: string]: any}> { - - } - } - interface ojAccordionEventMap extends oj.baseComponentEventMap { - 'ojBeforeCollapse': oj.ojAccordion.ojBeforeCollapse; - 'ojBeforeExpand': oj.ojAccordion.ojBeforeExpand; - 'ojCollapse': oj.ojAccordion.ojCollapse; - 'ojExpand': oj.ojAccordion.ojExpand; - 'expandedChanged': CustomEvent; - 'multipleChanged': CustomEvent; - } - interface ojAccordionSettableProperties extends baseComponentSettableProperties { - expanded: Array|Array|Array<{id?: string, index?: number}>|null; - multiple: boolean; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojanimation/index.d.ts b/types/@oracle/oraclejet/ojs/ojanimation/index.d.ts deleted file mode 100644 index bd4b77f2c6..0000000000 --- a/types/@oracle/oraclejet/ojs/ojanimation/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -declare namespace oj { - namespace AnimationUtils { - function collapse(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, startMaxHeight?: string, endMaxHeight?: string, startMaxWidth?: string, endMaxWidth?: string}): Promise; - function expand(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, startMaxHeight?: string, endMaxHeight?: string, startMaxWidth?: string, endMaxWidth?: string}): Promise; - function fadeIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, startOpacity?: number, endOpacity?: number}): Promise; - function fadeOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, startOpacity?: number, endOpacity?: number}): Promise; - function flipIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, startAngle?: string, endAngle?: string, backfaceVisibility?: string, perspective?: string, transformOrigin?: string, flipTarget?: string}): Promise; - function flipOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, startAngle?: string, endAngle?: string, backfaceVisibility?: string, perspective?: string, transformOrigin?: string, flipTarget?: string}): Promise; - function ripple(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, offsetX?: string, offsetY?: string, color?: string, diameter?: string, startOpacity?: number, endOpacity?: number}): Promise; - function slideIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, offsetX?: string, offsetY?: string}): Promise; - function slideOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, direction?: string, offsetX?: string, offsetY?: string}): Promise; - function zoomIn(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, transformOrigin?: string}): Promise; - function zoomOut(element: Element, options?: {delay?: string, duration?: string, timingFunction?: string, persist?: string, axis?: string, transformOrigin?: string}): Promise; - } - namespace AnimationUtils { - type AnimationMethods = 'collapse'|'expand'|'fadeIn'|'fadeOut'|'flipIn'|'flipOut'|'ripple'|'slideIn'|'slideOut'|'zoomIn'|'zoomOut'; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts deleted file mode 100644 index dddaf2290a..0000000000 --- a/types/@oracle/oraclejet/ojs/ojarraydataprovider/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// -declare namespace oj { - class ArrayDataProvider implements DataProvider { - constructor(data: Array|(()=> Array), options?: {sortComparators?: SortComparators, implicitSort?: SortCriterion[], keys?: Array|(()=> Array), idAttribute?: string|Array, keyAttributes?: string|Array}); - addEventListener(eventType: string, listener: EventListener): void - containsKeys(params: FetchByKeysParameters): Promise> - dispatchEvent(evt: Event): boolean - fetchByKeys(params: FetchByKeysParameters): Promise> - fetchByOffset(params: FetchByOffsetParameters): Promise> - fetchFirst>(params?: FetchListParameters): AsyncIterable - getCapability(capabilityName?: string): any - getTotalSize(): Promise; - isEmpty(): 'yes'|'no'|'unknown'; - removeEventListener(eventType: string, listener: EventListener): void - } - -} -declare namespace oj { - interface SortComparators { - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts deleted file mode 100644 index dbb445c36f..0000000000 --- a/types/@oracle/oraclejet/ojs/ojarraytreedataprovider/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// -declare namespace oj { - class ArrayTreeDataProvider implements TreeDataProvider { - constructor(data: Array|(()=> Array), options?: {sortComparators?: SortComparators, implicitSort?: SortCriterion[], keyAttributes?: string|Array, keyAttributesScope?: 'global'|'siblings', childrenAttribute?: string}); - addEventListener(eventType: string, listener: EventListener): void - containsKeys(params: FetchByKeysParameters): Promise> - dispatchEvent(evt: Event): boolean - fetchByKeys(params: FetchByKeysParameters): Promise> - fetchByOffset(params: FetchByOffsetParameters): Promise> - fetchFirst>(params?: FetchListParameters): AsyncIterable - getCapability(capabilityName?: string): any - getChildDataProvider(any): ArrayTreeDataProvider - getTotalSize(): Promise; - isEmpty(): 'yes'|'no'|'unknown'; - removeEventListener(eventType: string, listener: EventListener): void - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojavatar/index.d.ts b/types/@oracle/oraclejet/ojs/ojavatar/index.d.ts deleted file mode 100644 index bfdda53359..0000000000 --- a/types/@oracle/oraclejet/ojs/ojavatar/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -declare namespace oj { - class ojAvatar extends JetElement { - initials: string; - size: 'xxs'|'xs'|'sm'|'md'|'lg'|'xl'|'xxl'; - src: string; - onInitialsChanged: (event: CustomEvent)=> any; - onSizeChanged: (event: CustomEvent)=> any; - onSrcChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojAvatarEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojAvatarEventMap extends oj.JetElementEventMap { - 'initialsChanged': CustomEvent; - 'sizeChanged': CustomEvent; - 'srcChanged': CustomEvent; - } - interface ojAvatarSettableProperties extends JetSettableProperties { - initials: string; - size: 'xxs'|'xs'|'sm'|'md'|'lg'|'xl'|'xxl'; - src: string; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojbutton/index.d.ts b/types/@oracle/oraclejet/ojs/ojbutton/index.d.ts deleted file mode 100644 index 22df674702..0000000000 --- a/types/@oracle/oraclejet/ojs/ojbutton/index.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -/// -declare namespace oj { - class ojButton extends baseComponent { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - onChromingChanged: (event: CustomEvent)=> any; - onDisabledChanged: (event: CustomEvent)=> any; - onDisplayChanged: (event: CustomEvent)=> any; - onOjAction: (event: oj.ojButton.ojAction)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojButton { - class ojAction extends CustomEvent<{ [propName: string]: any}> { - - } - } - interface ojButtonEventMap extends oj.baseComponentEventMap { - 'ojAction': oj.ojButton.ojAction; - 'chromingChanged': CustomEvent; - 'disabledChanged': CustomEvent; - 'displayChanged': CustomEvent; - } - interface ojButtonSettableProperties extends baseComponentSettableProperties { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - } - -} -declare namespace oj { - abstract class ojButtonset extends baseComponent { - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojButtonsetEventMap extends oj.baseComponentEventMap { - } - interface ojButtonsetSettableProperties extends baseComponentSettableProperties { - } - -} -declare namespace oj { - class ojButtonsetMany extends ojButtonset { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - focusManagement: 'oneTabstop'|'none'; - value: Array|null; - onChromingChanged: (event: CustomEvent)=> any; - onDisabledChanged: (event: CustomEvent)=> any; - onDisplayChanged: (event: CustomEvent)=> any; - onFocusManagementChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetManyEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojButtonsetManyEventMap extends oj.ojButtonsetEventMap { - 'chromingChanged': CustomEvent; - 'disabledChanged': CustomEvent; - 'displayChanged': CustomEvent; - 'focusManagementChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojButtonsetManySettableProperties extends ojButtonsetSettableProperties { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - focusManagement: 'oneTabstop'|'none'; - value: Array|null; - } - -} -declare namespace oj { - class ojButtonsetOne extends ojButtonset { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - focusManagement: 'oneTabstop'|'none'; - value: any; - onChromingChanged: (event: CustomEvent)=> any; - onDisabledChanged: (event: CustomEvent)=> any; - onDisplayChanged: (event: CustomEvent)=> any; - onFocusManagementChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetOneEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojButtonsetOneEventMap extends oj.ojButtonsetEventMap { - 'chromingChanged': CustomEvent; - 'disabledChanged': CustomEvent; - 'displayChanged': CustomEvent; - 'focusManagementChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojButtonsetOneSettableProperties extends ojButtonsetSettableProperties { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - focusManagement: 'oneTabstop'|'none'; - value: any; - } - -} -declare namespace oj { - class ojMenuButton extends ojButton { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - onChromingChanged: (event: CustomEvent)=> any; - onDisabledChanged: (event: CustomEvent)=> any; - onDisplayChanged: (event: CustomEvent)=> any; - onOjAction: (event: oj.ojMenuButton.ojAction)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuButtonEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojMenuButton { - class ojAction extends CustomEvent<{ [propName: string]: any}> { - - } - } - interface ojMenuButtonEventMap extends oj.ojButtonEventMap { - 'ojAction': oj.ojMenuButton.ojAction; - 'chromingChanged': CustomEvent; - 'disabledChanged': CustomEvent; - 'displayChanged': CustomEvent; - } - interface ojMenuButtonSettableProperties extends ojButtonSettableProperties { - chroming: 'full'|'half'|'outlined'; - disabled: boolean; - display: 'all'|'icons'; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojchart/index.d.ts b/types/@oracle/oraclejet/ojs/ojchart/index.d.ts deleted file mode 100644 index f2e3354441..0000000000 --- a/types/@oracle/oraclejet/ojs/ojchart/index.d.ts +++ /dev/null @@ -1,822 +0,0 @@ -/// -/// -declare namespace oj { - class ojChart extends dvtBaseComponent> { - animationOnDataChange: 'auto'|'slideToLeft'|'slideToRight'|'none'; - animationOnDisplay: 'auto'|'alphaFade'|'zoom'|'none'; - as: string; - coordinateSystem: 'polar'|'cartesian'; - data: oj.DataProvider|null; - dataCursor: 'off'|'on'|'auto'; - dataCursorBehavior: 'smooth'|'snap'|'auto'; - dataCursorPosition: {x: number|string, y: number, y2: number}; - dataLabel: ((context: oj.ojChart.DataLabelContext) => ({insert: Element|string}|{preventDefault: boolean})); - dnd: {drag: {groups: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, items: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, series: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}}, drop: {legend: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, plotArea: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, xAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, y2Axis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, yAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}}}; - dragMode: 'pan'|'zoom'|'select'|'off'|'user'; - drilling: 'on'|'seriesOnly'|'groupsOnly'|'off'; - groupComparator: ((param0: object, param1: Object)=> number)|null; - hiddenCategories: Array; - hideAndShowBehavior: 'withRescale'|'withoutRescale'|'none'; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - initialZooming: 'first'|'last'|'none'; - legend: {backgroundColor: string, borderColor: string, maxSize: string, position: 'start'|'end'|'bottom'|'top'|'auto', referenceObjectSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, rendered: 'on'|'off'|'auto', scrolling: 'off'|'asNeeded', sections: Array<{items: Array<{borderColor: string, categories: Array, categoryVisibility: 'hidden'|'visible', color: string, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerShape?: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shortDesc: string, source: string, symbolType: 'line'|'lineWithMarker'|'image'|'marker', text: string}>, sections: Array, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}>, seriesSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, size: string, symbolHeight: number, symbolWidth: number, textStyle: object, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}; - orientation: 'horizontal'|'vertical'; - otherThreshold: number; - overview: {content: object, height: string, rendered: 'on'|'off'}; - pieCenter: {converter: object, label: string, labelStyle: object, renderer: ((context: oj.ojChart.PieCenterContext) => ({insert: Element|string}|{preventDefault: boolean})), scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}; - plotArea: {backgroundColor: string, borderColor: string, borderWidth: number, rendered: 'off'|'on'}; - polarGridShape: 'polygon'|'circle'; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - seriesComparator: ((param0: object, param1: Object)=> number)|null; - sorting: 'ascending'|'descending'|'off'; - splitDualY: 'on'|'off'|'auto'; - splitterPosition: number; - stack: 'on'|'off'; - stackLabel: 'on'|'off'; - styleDefaults: {animationDownColor: string, animationDuration: number, animationIndicators: 'none'|'all', animationUpColor: string, barGapRatio: number, borderColor: string, borderWidth: number, boxPlot: {medianSvgClassName: string, medianSvgStyle: object, whiskerEndLength: string, whiskerEndSvgClassName: string, whiskerEndSvgStyle: object, whiskerSvgClassName: string, whiskerSvgStyle: object}, colors: Array, dataCursor: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerDisplayed: 'off'|'on', markerSize: number}, dataItemGaps: string, dataLabelPosition: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto', dataLabelStyle: object|Array, funnelBackgroundColor: string, groupSeparators: {color: string, rendered: 'off'|'auto'}, hoverBehaviorDelay: number, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto', lineWidth: number, markerColor: string, markerDisplayed: 'on'|'off'|'auto', markerShape?: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|string, markerSize: number, marqueeBorderColor: string, marqueeColor: string, maxBarWidth: number, otherColor: string, patterns: Array, pieFeelerColor: string, pieInnerRadius: number, selectionEffect: 'explode'|'highlightAndExplode'|'highlight', seriesEffect: 'color'|'pattern'|'gradient', shapes: Array, stackLabelStyle: object, stockFallingColor: string, stockRangeColor: string, stockRisingColor: string, stockVolumeColor: string, threeDEffect: 'on'|'off', tooltipLabelStyle: object, tooltipValueStyle: object}; - timeAxisType: 'enabled'|'mixedFrequency'|'skipGaps'|'disabled'|'auto'; - tooltip: {renderer: ((context: oj.ojChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - type: 'line'|'area'|'lineWithArea'|'stock'|'boxPlot'|'combo'|'pie'|'scatter'|'bubble'|'funnel'|'pyramid'|'bar'; - valueFormats: {close: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, group: {tooltipDisplay: 'off'|'auto', tooltipLabel: string|Array}, high: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, label: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}, low: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, open: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q1: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q3: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, series: {tooltipDisplay: 'off'|'auto', tooltipLabel: string}, targetValue: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, value: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, volume: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, x: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, z: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}}; - xAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'off'|'on'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number|string, maxSize: string, min: number|string, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, rendered: 'off'|'on', rotation: 'none'|'auto', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportEndGroup: number|string, viewportMax: number|string, viewportMin: number|string, viewportStartGroup: number|string}; - y2Axis: {alignTickMarks: 'off'|'on', axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object}; - yAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportMax: number, viewportMin: number}; - zoomAndScroll: 'delayedScrollOnly'|'liveScrollOnly'|'delayed'|'live'|'off'; - zoomDirection: 'x'|'y'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelClose?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelDefaultGroupName?: string, labelGroup?: string, labelHigh?: string, labelInvalidData?: string, labelLow?: string, labelNoData?: string, labelOpen?: string, labelOther?: string, labelPercentage?: string, labelQ1?: string, labelQ2?: string, labelQ3?: string, labelSeries?: string, labelTargetValue?: string, labelValue?: string, labelVolume?: string, labelX?: string, labelY?: string, labelZ?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipPan?: string, tooltipSelect?: string, tooltipZoom?: string}; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onCoordinateSystemChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDataCursorChanged: (event: CustomEvent)=> any; - onDataCursorBehaviorChanged: (event: CustomEvent)=> any; - onDataCursorPositionChanged: (event: CustomEvent)=> any; - onDataLabelChanged: (event: CustomEvent)=> any; - onDndChanged: (event: CustomEvent)=> any; - onDragModeChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onGroupComparatorChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHideAndShowBehaviorChanged: (event: CustomEvent)=> any; - onHighlightMatchChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onInitialZoomingChanged: (event: CustomEvent)=> any; - onLegendChanged: (event: CustomEvent)=> any; - onOrientationChanged: (event: CustomEvent)=> any; - onOtherThresholdChanged: (event: CustomEvent)=> any; - onOverviewChanged: (event: CustomEvent)=> any; - onPieCenterChanged: (event: CustomEvent)=> any; - onPlotAreaChanged: (event: CustomEvent)=> any; - onPolarGridShapeChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onSeriesComparatorChanged: (event: CustomEvent)=> any; - onSortingChanged: (event: CustomEvent)=> any; - onSplitDualYChanged: (event: CustomEvent)=> any; - onSplitterPositionChanged: (event: CustomEvent)=> any; - onStackChanged: (event: CustomEvent)=> any; - onStackLabelChanged: (event: CustomEvent)=> any; - onStyleDefaultsChanged: (event: CustomEvent)=> any; - onTimeAxisTypeChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTouchResponseChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - onValueFormatsChanged: (event: CustomEvent)=> any; - onXAxisChanged: (event: CustomEvent)=> any; - onY2AxisChanged: (event: CustomEvent)=> any; - onYAxisChanged: (event: CustomEvent)=> any; - onZoomAndScrollChanged: (event: CustomEvent)=> any; - onZoomDirectionChanged: (event: CustomEvent)=> any; - onOjDrill: (event: oj.ojChart.ojDrill)=> any; - onOjSelectInput: (event: oj.ojChart.ojSelectInput)=> any; - onOjViewportChange: (event: oj.ojChart.ojViewportChange)=> any; - onOjViewportChangeInput: (event: oj.ojChart.ojViewportChangeInput)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojChart.PieCenterLabelContext|oj.ojChart.LegendItemContext|oj.ojChart.ReferenceObject|oj.ojChart.GroupContext|oj.ojChart.AxisTitleContext|oj.ojChart.ItemContext|oj.ojChart.SeriesContext; - getDataItem(seriesIndex: number, groupIndex: number): object|null; - getGroup(groupIndex: string): string; - getGroupCount(): number; - getLegend(): object; - getPlotArea(): object; - getSeries(seriesIndex: string): string; - getSeriesCount(): number; - getValuesAt(x: number, y: number): object; - getXAxis(): object; - getY2Axis(): object; - getYAxis(): object; - } - namespace ojChart { - class ojDrill extends CustomEvent<{id: string, series: string, group: string, data: object, itemData: object, seriesData: object, groupData: Array, [propName: string]: any}> { - - } - - class ojSelectInput extends CustomEvent<{items: Array, selectionData: Array<{data: object, itemData: object, groupData: Array, seriesData: object}>, endGroup: string, startGroup: string, xMax: number, xMin: number, yMax: number, yMin: number, [propName: string]: any}> { - - } - - class ojViewportChange extends CustomEvent<{endGroup: string, startGroup: string, xMax: number, xMin: number, yMax: number, yMin: number, [propName: string]: any}> { - - } - - class ojViewportChangeInput extends CustomEvent<{endGroup: string, startGroup: string, xMax: number, xMin: number, yMax: number, yMin: number, [propName: string]: any}> { - - } - } - interface ojChartEventMap extends oj.dvtBaseComponentEventMap { - 'ojDrill': oj.ojChart.ojDrill; - 'ojSelectInput': oj.ojChart.ojSelectInput; - 'ojViewportChange': oj.ojChart.ojViewportChange; - 'ojViewportChangeInput': oj.ojChart.ojViewportChangeInput; - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'asChanged': CustomEvent; - 'coordinateSystemChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'dataCursorChanged': CustomEvent; - 'dataCursorBehaviorChanged': CustomEvent; - 'dataCursorPositionChanged': CustomEvent; - 'dataLabelChanged': CustomEvent; - 'dndChanged': CustomEvent; - 'dragModeChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'groupComparatorChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'hideAndShowBehaviorChanged': CustomEvent; - 'highlightMatchChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'initialZoomingChanged': CustomEvent; - 'legendChanged': CustomEvent; - 'orientationChanged': CustomEvent; - 'otherThresholdChanged': CustomEvent; - 'overviewChanged': CustomEvent; - 'pieCenterChanged': CustomEvent; - 'plotAreaChanged': CustomEvent; - 'polarGridShapeChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'seriesComparatorChanged': CustomEvent; - 'sortingChanged': CustomEvent; - 'splitDualYChanged': CustomEvent; - 'splitterPositionChanged': CustomEvent; - 'stackChanged': CustomEvent; - 'stackLabelChanged': CustomEvent; - 'styleDefaultsChanged': CustomEvent; - 'timeAxisTypeChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'touchResponseChanged': CustomEvent; - 'typeChanged': CustomEvent; - 'valueFormatsChanged': CustomEvent; - 'xAxisChanged': CustomEvent; - 'y2AxisChanged': CustomEvent; - 'yAxisChanged': CustomEvent; - 'zoomAndScrollChanged': CustomEvent; - 'zoomDirectionChanged': CustomEvent; - } - interface ojChartSettableProperties extends dvtBaseComponentSettableProperties { - animationOnDataChange: 'auto'|'slideToLeft'|'slideToRight'|'none'; - animationOnDisplay: 'auto'|'alphaFade'|'zoom'|'none'; - as: string; - coordinateSystem: 'polar'|'cartesian'; - data: oj.DataProvider|null; - dataCursor: 'off'|'on'|'auto'; - dataCursorBehavior: 'smooth'|'snap'|'auto'; - dataCursorPosition: {x: number|string, y: number, y2: number}; - dataLabel: ((context: oj.ojChart.DataLabelContext) => ({insert: Element|string}|{preventDefault: boolean})); - dnd: {drag: {groups: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, items: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}, series: {dataTypes: string|Array, drag: ((param0: Event)=> void), dragEnd: ((param0: Event)=> void), dragStart: ((param0: Event, param1: object)=> void)}}, drop: {legend: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, plotArea: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, xAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, y2Axis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}, yAxis: {dataTypes: string|Array, dragEnter: ((param0: Event, param1: object)=> void), dragLeave: ((param0: Event, param1: object)=> void), dragOver: ((param0: Event, param1: object)=> void), drop: ((param0: Event, param1: object)=> void)}}}; - dragMode: 'pan'|'zoom'|'select'|'off'|'user'; - drilling: 'on'|'seriesOnly'|'groupsOnly'|'off'; - groupComparator: ((param0: object, param1: Object)=> number)|null; - hiddenCategories: Array; - hideAndShowBehavior: 'withRescale'|'withoutRescale'|'none'; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - initialZooming: 'first'|'last'|'none'; - legend: {backgroundColor: string, borderColor: string, maxSize: string, position: 'start'|'end'|'bottom'|'top'|'auto', referenceObjectSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, rendered: 'on'|'off'|'auto', scrolling: 'off'|'asNeeded', sections: Array<{items: Array<{borderColor: string, categories: Array, categoryVisibility: 'hidden'|'visible', color: string, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerShape?: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shortDesc: string, source: string, symbolType: 'line'|'lineWithMarker'|'image'|'marker', text: string}>, sections: Array, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}>, seriesSection: {title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}, size: string, symbolHeight: number, symbolWidth: number, textStyle: object, title: string, titleHalign: 'center'|'end'|'start', titleStyle: object}; - orientation: 'horizontal'|'vertical'; - otherThreshold: number; - overview: {content: object, height: string, rendered: 'on'|'off'}; - pieCenter: {converter: object, label: string, labelStyle: object, renderer: ((context: oj.ojChart.PieCenterContext) => ({insert: Element|string}|{preventDefault: boolean})), scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}; - plotArea: {backgroundColor: string, borderColor: string, borderWidth: number, rendered: 'off'|'on'}; - polarGridShape: 'polygon'|'circle'; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - seriesComparator: ((param0: object, param1: Object)=> number)|null; - sorting: 'ascending'|'descending'|'off'; - splitDualY: 'on'|'off'|'auto'; - splitterPosition: number; - stack: 'on'|'off'; - stackLabel: 'on'|'off'; - styleDefaults: {animationDownColor: string, animationDuration: number, animationIndicators: 'none'|'all', animationUpColor: string, barGapRatio: number, borderColor: string, borderWidth: number, boxPlot: {medianSvgClassName: string, medianSvgStyle: object, whiskerEndLength: string, whiskerEndSvgClassName: string, whiskerEndSvgStyle: object, whiskerSvgClassName: string, whiskerSvgStyle: object}, colors: Array, dataCursor: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, markerColor: string, markerDisplayed: 'off'|'on', markerSize: number}, dataItemGaps: string, dataLabelPosition: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto', dataLabelStyle: object|Array, funnelBackgroundColor: string, groupSeparators: {color: string, rendered: 'off'|'auto'}, hoverBehaviorDelay: number, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto', lineWidth: number, markerColor: string, markerDisplayed: 'on'|'off'|'auto', markerShape?: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|string, markerSize: number, marqueeBorderColor: string, marqueeColor: string, maxBarWidth: number, otherColor: string, patterns: Array, pieFeelerColor: string, pieInnerRadius: number, selectionEffect: 'explode'|'highlightAndExplode'|'highlight', seriesEffect: 'color'|'pattern'|'gradient', shapes: Array, stackLabelStyle: object, stockFallingColor: string, stockRangeColor: string, stockRisingColor: string, stockVolumeColor: string, threeDEffect: 'on'|'off', tooltipLabelStyle: object, tooltipValueStyle: object}; - timeAxisType: 'enabled'|'mixedFrequency'|'skipGaps'|'disabled'|'auto'; - tooltip: {renderer: ((context: oj.ojChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - type: 'line'|'area'|'lineWithArea'|'stock'|'boxPlot'|'combo'|'pie'|'scatter'|'bubble'|'funnel'|'pyramid'|'bar'; - valueFormats: {close: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, group: {tooltipDisplay: 'off'|'auto', tooltipLabel: string|Array}, high: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, label: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto'}, low: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, open: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q1: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, q3: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, series: {tooltipDisplay: 'off'|'auto', tooltipLabel: string}, targetValue: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, value: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, volume: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, x: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, y2: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}, z: {converter: object, scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', tooltipDisplay: 'off'|'auto', tooltipLabel: string}}; - xAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'off'|'on'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number|string, maxSize: string, min: number|string, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, rendered: 'off'|'on', rotation: 'none'|'auto', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportEndGroup: number|string, viewportMax: number|string, viewportMin: number|string, viewportStartGroup: number|string}; - y2Axis: {alignTickMarks: 'off'|'on', axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object}; - yAxis: {axisLine: {lineColor: string, lineWidth: number, rendered: 'on'|'off'|'auto'}, baselineScaling: 'min'|'zero', dataMax: number, dataMin: number, majorTick: {baselineColor: 'inherit'|'auto', baselineStyle: 'dotted'|'dashed'|'solid', baselineWidth: number, lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, max: number, maxSize: string, min: number, minStep: number, minorStep: number, minorTick: {lineColor: string, lineStyle: 'dotted'|'dashed'|'solid', lineWidth: number, rendered: 'on'|'off'|'auto'}, position: 'start'|'end'|'top'|'bottom'|'auto', referenceObjects: Array<{categories: Array, color: string, displayInLegend: 'on'|'off', high: number, id: string, items: Array<{high: number, low: number, value: number, x: number|string}>, lineStyle: 'dotted'|'dashed'|'solid', lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'straight', lineWidth: number, location: 'front'|'back', low: number, shortDesc: string, svgClassName: string, svgStyle: object, text: string, type: 'area'|'line', value: number}>, rendered: 'off'|'on', scale: 'log'|'linear', size: string, step: number, tickLabel: {converter: object, position: 'inside'|'outside', rendered: 'off'|'on', scaling: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style: object}, title: string, titleStyle: object, viewportMax: number, viewportMin: number}; - zoomAndScroll: 'delayedScrollOnly'|'liveScrollOnly'|'delayed'|'live'|'off'; - zoomDirection: 'x'|'y'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelClose?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelDefaultGroupName?: string, labelGroup?: string, labelHigh?: string, labelInvalidData?: string, labelLow?: string, labelNoData?: string, labelOpen?: string, labelOther?: string, labelPercentage?: string, labelQ1?: string, labelQ2?: string, labelQ3?: string, labelSeries?: string, labelTargetValue?: string, labelValue?: string, labelVolume?: string, labelX?: string, labelY?: string, labelZ?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipPan?: string, tooltipSelect?: string, tooltipZoom?: string}; - } - namespace ojChart { - type AxisTitleContext = - { - axis: 'xAxis'|'yAxis'|'y2Axis', subId: string - } - } - namespace ojChart { - type DataLabelContext = - { - id: any, series: string, group: string|Array, value: number, targetValue: number, x: number|string, y: number, z: number, low: number, high: number, open: number, close: number, volume: number, label: string, totalValue: number, data: object|null, itemData: object|null, seriesData: object|null, groupData: object|null, componentElement: Element - } - } - namespace ojChart { - type GroupContext = - { - indexPath: Array, subId: string - } - } - namespace ojChart { - type ItemContext = - { - seriesIndex: number, itemIndex: number, subId: string - } - } - namespace ojChart { - type LegendItemContext = - { - sectionIndexPath: Array, itemIndex: number, subId: string - } - } - namespace ojChart { - type PieCenterContext = - { - outerBounds: object, innerBounds: object, label: string, componentElement: Element - } - } - namespace ojChart { - type PieCenterLabelContext = - { - subId: string - } - } - namespace ojChart { - type ReferenceObject = - { - axis: 'xAxis'|'yAxis'|'y2Axis', index: number, subId: string - } - } - namespace ojChart { - type SeriesContext = - { - itemIndex: number, subId: string - } - } - namespace ojChart { - type TooltipContext = - { - parentElement: Element, id: any, series: string, group: string|Array, label: string, value: number, x: number|string, y: number, z: number, low: number, high: number, open: number, close: number, volume: number, targetValue: number, data: object|null, itemData: object|null, seriesData: object|null, groupData: object|null, componentElement: Element, color: string - } - } - -} -declare namespace oj { - class ojChartGroup extends JetElement { - drilling?: 'on'|'off'|'inherit'; - labelStyle?: object; - name?: string; - shortDesc?: string; - onDrillingChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - onNameChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartGroupEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojChartGroupEventMap extends oj.JetElementEventMap { - 'drillingChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - 'nameChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - } - interface ojChartGroupSettableProperties extends JetSettableProperties { - drilling?: 'on'|'off'|'inherit'; - labelStyle?: object; - name?: string; - shortDesc?: string; - } - -} -declare namespace oj { - class ojChartItem extends JetElement { - borderColor?: string; - borderWidth?: number; - boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; - categories?: Array; - close?: number; - color?: string; - drilling?: 'on'|'off'|'inherit'; - groupId: Array; - high?: number; - items?: Array|Array; - label?: string|Array; - labelPosition?: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto'; - labelStyle?: object|Array; - low?: number; - markerDisplayed?: 'on'|'off'|'auto'; - markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; - markerSize?: number; - open?: number; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; - q1?: number; - q2?: number; - q3?: number; - seriesId: string; - shortDesc?: string; - source?: string; - sourceHover?: string; - sourceHoverSelected?: string; - sourceSelected?: string; - svgClassName?: string; - svgStyle?: object; - targetValue?: number; - value?: number; - volume?: number; - x?: number|string; - y?: number; - z?: number; - onBorderColorChanged: (event: CustomEvent)=> any; - onBorderWidthChanged: (event: CustomEvent)=> any; - onBoxPlotChanged: (event: CustomEvent)=> any; - onCategoriesChanged: (event: CustomEvent)=> any; - onCloseChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onGroupIdChanged: (event: CustomEvent)=> any; - onHighChanged: (event: CustomEvent)=> any; - onItemsChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onLabelPositionChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - onLowChanged: (event: CustomEvent)=> any; - onMarkerDisplayedChanged: (event: CustomEvent)=> any; - onMarkerShapeChanged: (event: CustomEvent)=> any; - onMarkerSizeChanged: (event: CustomEvent)=> any; - onOpenChanged: (event: CustomEvent)=> any; - onPatternChanged: (event: CustomEvent)=> any; - onQ1Changed: (event: CustomEvent)=> any; - onQ2Changed: (event: CustomEvent)=> any; - onQ3Changed: (event: CustomEvent)=> any; - onSeriesIdChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSourceChanged: (event: CustomEvent)=> any; - onSourceHoverChanged: (event: CustomEvent)=> any; - onSourceHoverSelectedChanged: (event: CustomEvent)=> any; - onSourceSelectedChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onTargetValueChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onVolumeChanged: (event: CustomEvent)=> any; - onXChanged: (event: CustomEvent)=> any; - onYChanged: (event: CustomEvent)=> any; - onZChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartItemEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojChartItemEventMap extends oj.JetElementEventMap { - 'borderColorChanged': CustomEvent; - 'borderWidthChanged': CustomEvent; - 'boxPlotChanged': CustomEvent; - 'categoriesChanged': CustomEvent; - 'closeChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'groupIdChanged': CustomEvent; - 'highChanged': CustomEvent; - 'itemsChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'labelPositionChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - 'lowChanged': CustomEvent; - 'markerDisplayedChanged': CustomEvent; - 'markerShapeChanged': CustomEvent; - 'markerSizeChanged': CustomEvent; - 'openChanged': CustomEvent; - 'patternChanged': CustomEvent; - 'q1Changed': CustomEvent; - 'q2Changed': CustomEvent; - 'q3Changed': CustomEvent; - 'seriesIdChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'sourceChanged': CustomEvent; - 'sourceHoverChanged': CustomEvent; - 'sourceHoverSelectedChanged': CustomEvent; - 'sourceSelectedChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'targetValueChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'volumeChanged': CustomEvent; - 'xChanged': CustomEvent; - 'yChanged': CustomEvent; - 'zChanged': CustomEvent; - } - interface ojChartItemSettableProperties extends JetSettableProperties { - borderColor?: string; - borderWidth?: number; - boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; - categories?: Array; - close?: number; - color?: string; - drilling?: 'on'|'off'|'inherit'; - groupId: Array; - high?: number; - items?: Array|Array; - label?: string|Array; - labelPosition?: 'center'|'outsideSlice'|'aboveMarker'|'belowMarker'|'beforeMarker'|'afterMarker'|'insideBarEdge'|'outsideBarEdge'|'none'|'auto'; - labelStyle?: object|Array; - low?: number; - markerDisplayed?: 'on'|'off'|'auto'; - markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; - markerSize?: number; - open?: number; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; - q1?: number; - q2?: number; - q3?: number; - seriesId: string; - shortDesc?: string; - source?: string; - sourceHover?: string; - sourceHoverSelected?: string; - sourceSelected?: string; - svgClassName?: string; - svgStyle?: object; - targetValue?: number; - value?: number; - volume?: number; - x?: number|string; - y?: number; - z?: number; - } - -} -declare namespace oj { - class ojChartSeries extends JetElement { - areaColor?: string; - areaSvgClassName?: string; - areaSvgStyle?: object; - assignedToY2?: 'on'|'off'; - borderColor?: string; - borderWidth?: number; - boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3Color?: string, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; - categories?: Array; - color?: string; - displayInLegend?: 'on'|'off'|'auto'; - drilling?: 'on'|'off'|'inherit'; - lineStyle?: 'dotted'|'dashed'|'solid'; - lineType?: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto'; - lineWidth?: number; - markerColor?: string; - markerDisplayed?: 'on'|'off'|'auto'; - markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; - markerSize?: number; - markerSvgClassName?: string; - markerSvgStyle?: object; - name?: string; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; - pieSliceExplode?: number; - shortDesc?: string; - source?: string; - sourceHover?: string; - sourceHoverSelected?: string; - sourceSelected?: string; - stackCategory?: string; - svgClassName?: string; - svgStyle?: object; - type?: 'bar'|'line'|'area'|'lineWithArea'|'candlestick'|'boxPlot'|'auto'; - onAreaColorChanged: (event: CustomEvent)=> any; - onAreaSvgClassNameChanged: (event: CustomEvent)=> any; - onAreaSvgStyleChanged: (event: CustomEvent)=> any; - onAssignedToY2Changed: (event: CustomEvent)=> any; - onBorderColorChanged: (event: CustomEvent)=> any; - onBorderWidthChanged: (event: CustomEvent)=> any; - onBoxPlotChanged: (event: CustomEvent)=> any; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onDisplayInLegendChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onLineStyleChanged: (event: CustomEvent)=> any; - onLineTypeChanged: (event: CustomEvent)=> any; - onLineWidthChanged: (event: CustomEvent)=> any; - onMarkerColorChanged: (event: CustomEvent)=> any; - onMarkerDisplayedChanged: (event: CustomEvent)=> any; - onMarkerShapeChanged: (event: CustomEvent)=> any; - onMarkerSizeChanged: (event: CustomEvent)=> any; - onMarkerSvgClassNameChanged: (event: CustomEvent)=> any; - onMarkerSvgStyleChanged: (event: CustomEvent)=> any; - onNameChanged: (event: CustomEvent)=> any; - onPatternChanged: (event: CustomEvent)=> any; - onPieSliceExplodeChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSourceChanged: (event: CustomEvent)=> any; - onSourceHoverChanged: (event: CustomEvent)=> any; - onSourceHoverSelectedChanged: (event: CustomEvent)=> any; - onSourceSelectedChanged: (event: CustomEvent)=> any; - onStackCategoryChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartSeriesEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojChartSeriesEventMap extends oj.JetElementEventMap { - 'areaColorChanged': CustomEvent; - 'areaSvgClassNameChanged': CustomEvent; - 'areaSvgStyleChanged': CustomEvent; - 'assignedToY2Changed': CustomEvent; - 'borderColorChanged': CustomEvent; - 'borderWidthChanged': CustomEvent; - 'boxPlotChanged': CustomEvent; - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'displayInLegendChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'lineStyleChanged': CustomEvent; - 'lineTypeChanged': CustomEvent; - 'lineWidthChanged': CustomEvent; - 'markerColorChanged': CustomEvent; - 'markerDisplayedChanged': CustomEvent; - 'markerShapeChanged': CustomEvent; - 'markerSizeChanged': CustomEvent; - 'markerSvgClassNameChanged': CustomEvent; - 'markerSvgStyleChanged': CustomEvent; - 'nameChanged': CustomEvent; - 'patternChanged': CustomEvent; - 'pieSliceExplodeChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'sourceChanged': CustomEvent; - 'sourceHoverChanged': CustomEvent; - 'sourceHoverSelectedChanged': CustomEvent; - 'sourceSelectedChanged': CustomEvent; - 'stackCategoryChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'typeChanged': CustomEvent; - } - interface ojChartSeriesSettableProperties extends JetSettableProperties { - areaColor?: string; - areaSvgClassName?: string; - areaSvgStyle?: object; - assignedToY2?: 'on'|'off'; - borderColor?: string; - borderWidth?: number; - boxPlot?: {medianSvgClassName?: string, medianSvgStyle?: object, q2Color?: string, q2SvgClassName?: string, q2SvgStyle?: object, q3Color?: string, q3SvgClassName?: string, q3SvgStyle?: object, whiskerEndLength?: string, whiskerEndSvgClassName?: string, whiskerEndSvgStyle?: object, whiskerSvgClassName?: string, whiskerSvgStyle?: object}; - categories?: Array; - color?: string; - displayInLegend?: 'on'|'off'|'auto'; - drilling?: 'on'|'off'|'inherit'; - lineStyle?: 'dotted'|'dashed'|'solid'; - lineType?: 'straight'|'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'auto'; - lineWidth?: number; - markerColor?: string; - markerDisplayed?: 'on'|'off'|'auto'; - markerShape?: 'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'|'auto'|string; - markerSize?: number; - markerSvgClassName?: string; - markerSvgStyle?: object; - name?: string; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'auto'; - pieSliceExplode?: number; - shortDesc?: string; - source?: string; - sourceHover?: string; - sourceHoverSelected?: string; - sourceSelected?: string; - stackCategory?: string; - svgClassName?: string; - svgStyle?: object; - type?: 'bar'|'line'|'area'|'lineWithArea'|'candlestick'|'boxPlot'|'auto'; - } - -} -declare namespace oj { - class ojSparkChart extends dvtBaseComponent> { - animationDuration: number|null; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - areaColor: string; - areaSvgClassName: string; - areaSvgStyle: object; - as: string; - barGapRatio: number; - baselineScaling: 'zero'|'min'; - color: string; - data: oj.DataProvider|null; - firstColor: string; - highColor: string; - lastColor: string; - lineStyle: 'dotted'|'dashed'|'solid'; - lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'straight'; - lineWidth: number; - lowColor: string; - markerShape: 'square'|'circle'|'diamond'|'plus'|'triangleDown'|'triangleUp'|'human'|'star'|'auto'; - markerSize: number; - referenceObjects: Array; - svgClassName: string; - svgStyle: object; - tooltip: {renderer: ((context: oj.ojSparkChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; - type: 'area'|'lineWithArea'|'bar'|'line'; - visualEffects: 'none'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onAnimationDurationChanged: (event: CustomEvent)=> any; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAreaColorChanged: (event: CustomEvent)=> any; - onAreaSvgClassNameChanged: (event: CustomEvent)=> any; - onAreaSvgStyleChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onBarGapRatioChanged: (event: CustomEvent)=> any; - onBaselineScalingChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onFirstColorChanged: (event: CustomEvent)=> any; - onHighColorChanged: (event: CustomEvent)=> any; - onLastColorChanged: (event: CustomEvent)=> any; - onLineStyleChanged: (event: CustomEvent)=> any; - onLineTypeChanged: (event: CustomEvent)=> any; - onLineWidthChanged: (event: CustomEvent)=> any; - onLowColorChanged: (event: CustomEvent)=> any; - onMarkerShapeChanged: (event: CustomEvent)=> any; - onMarkerSizeChanged: (event: CustomEvent)=> any; - onReferenceObjectsChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - onVisualEffectsChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSparkChartEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getDataItem(itemIndex: number): oj.ojSparkChart.ItemContext|null; - } - interface ojSparkChartEventMap extends oj.dvtBaseComponentEventMap { - 'animationDurationChanged': CustomEvent; - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'areaColorChanged': CustomEvent; - 'areaSvgClassNameChanged': CustomEvent; - 'areaSvgStyleChanged': CustomEvent; - 'asChanged': CustomEvent; - 'barGapRatioChanged': CustomEvent; - 'baselineScalingChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'firstColorChanged': CustomEvent; - 'highColorChanged': CustomEvent; - 'lastColorChanged': CustomEvent; - 'lineStyleChanged': CustomEvent; - 'lineTypeChanged': CustomEvent; - 'lineWidthChanged': CustomEvent; - 'lowColorChanged': CustomEvent; - 'markerShapeChanged': CustomEvent; - 'markerSizeChanged': CustomEvent; - 'referenceObjectsChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'typeChanged': CustomEvent; - 'visualEffectsChanged': CustomEvent; - } - interface ojSparkChartSettableProperties extends dvtBaseComponentSettableProperties { - animationDuration: number|null; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - areaColor: string; - areaSvgClassName: string; - areaSvgStyle: object; - as: string; - barGapRatio: number; - baselineScaling: 'zero'|'min'; - color: string; - data: oj.DataProvider|null; - firstColor: string; - highColor: string; - lastColor: string; - lineStyle: 'dotted'|'dashed'|'solid'; - lineType: 'curved'|'stepped'|'centeredStepped'|'segmented'|'centeredSegmented'|'none'|'straight'; - lineWidth: number; - lowColor: string; - markerShape: 'square'|'circle'|'diamond'|'plus'|'triangleDown'|'triangleUp'|'human'|'star'|'auto'; - markerSize: number; - referenceObjects: Array; - svgClassName: string; - svgStyle: object; - tooltip: {renderer: ((context: oj.ojSparkChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; - type: 'area'|'lineWithArea'|'bar'|'line'; - visualEffects: 'none'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - namespace ojSparkChart { - type Item = - { - borderColor: string, color: string, date: Date, high: number, low: number, markerDisplayed: 'on'|'off', markerShape: 'square'|'circle'|'diamond'|'plus'|'triangleDown'|'triangleUp'|'human'|'star'|'auto'|string, markerSize: number, svgClassName: string, svgStyle: object, value: number - } - } - namespace ojSparkChart { - type ItemContext = - { - borderColor: string, color: string, date: Date, high: number, low: number, value: number - } - } - namespace ojSparkChart { - type ReferenceObject = - { - color?: string, high?: number, lineWidth?: number, lineStyle: 'dotted'|'dashed'|'solid', location: 'front'|'back', low?: number, svgClassName?: string, svgStyle?: object, type: 'area'|'line', value?: number - } - } - namespace ojSparkChart { - type TooltipContext = - { - color: string, componentElement: Element, parentElement: Element - } - } - -} -declare namespace oj { - class ojSparkChartItem extends JetElement { - borderColor: string; - color: string; - date: string; - high: number|null; - low: number|null; - markerDisplayed: 'off'|'on'; - markerShape: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'; - markerSize: number; - svgClassName: string; - svgStyle: object; - value: number|null; - onBorderColorChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onDateChanged: (event: CustomEvent)=> any; - onHighChanged: (event: CustomEvent)=> any; - onLowChanged: (event: CustomEvent)=> any; - onMarkerDisplayedChanged: (event: CustomEvent)=> any; - onMarkerShapeChanged: (event: CustomEvent)=> any; - onMarkerSizeChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSparkChartItemEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojSparkChartItemEventMap extends oj.JetElementEventMap { - 'borderColorChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'dateChanged': CustomEvent; - 'highChanged': CustomEvent; - 'lowChanged': CustomEvent; - 'markerDisplayedChanged': CustomEvent; - 'markerShapeChanged': CustomEvent; - 'markerSizeChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojSparkChartItemSettableProperties extends JetSettableProperties { - borderColor: string; - color: string; - date: string; - high: number|null; - low: number|null; - markerDisplayed: 'off'|'on'; - markerShape: 'auto'|'circle'|'diamond'|'human'|'plus'|'square'|'star'|'triangleDown'|'triangleUp'; - markerSize: number; - svgClassName: string; - svgStyle: object; - value: number|null; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts b/types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts deleted file mode 100644 index 6972efe009..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcheckboxset/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/// -declare namespace oj { - class ojCheckboxset extends editableValue, ojCheckboxsetSettableProperties> { - disabled: boolean; - labelledBy: string|null; - required: boolean; - value: Array; - translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - onDisabledChanged: (event: CustomEvent)=> any; - onLabelledByChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojCheckboxset.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojCheckboxset.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojCheckboxsetEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - validate(): Promise; - } - namespace ojCheckboxset { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojCheckboxsetEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojCheckboxset.ojAnimateEnd; - 'ojAnimateStart': oj.ojCheckboxset.ojAnimateStart; - 'disabledChanged': CustomEvent; - 'labelledByChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojCheckboxsetSettableProperties extends editableValueSettableProperties> { - disabled: boolean; - labelledBy: string|null; - required: boolean; - value: Array; - translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts b/types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts deleted file mode 100644 index 4784d83c1c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcollapsible/index.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/// -declare namespace oj { - class ojCollapsible extends baseComponent { - disabled: boolean; - expandArea: 'header'|'disclosureIcon'; - expanded: boolean; - onDisabledChanged: (event: CustomEvent)=> any; - onExpandAreaChanged: (event: CustomEvent)=> any; - onExpandedChanged: (event: CustomEvent)=> any; - onOjBeforeCollapse: (event: oj.ojCollapsible.ojBeforeCollapse)=> any; - onOjBeforeExpand: (event: oj.ojCollapsible.ojBeforeExpand)=> any; - onOjCollapse: (event: oj.ojCollapsible.ojCollapse)=> any; - onOjExpand: (event: oj.ojCollapsible.ojExpand)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojCollapsibleEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - } - namespace ojCollapsible { - class ojBeforeCollapse extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { - - } - - class ojBeforeExpand extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { - - } - - class ojCollapse extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { - - } - - class ojExpand extends CustomEvent<{header: Element, content: Element, [propName: string]: any}> { - - } - } - interface ojCollapsibleEventMap extends oj.baseComponentEventMap { - 'ojBeforeCollapse': oj.ojCollapsible.ojBeforeCollapse; - 'ojBeforeExpand': oj.ojCollapsible.ojBeforeExpand; - 'ojCollapse': oj.ojCollapsible.ojCollapse; - 'ojExpand': oj.ojCollapsible.ojExpand; - 'disabledChanged': CustomEvent; - 'expandAreaChanged': CustomEvent; - 'expandedChanged': CustomEvent; - } - interface ojCollapsibleSettableProperties extends baseComponentSettableProperties { - disabled: boolean; - expandArea: 'header'|'disclosureIcon'; - expanded: boolean; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts deleted file mode 100644 index 08bd5b25c8..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcollectiondataprovider/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -declare namespace oj { - class CollectionDataProvider implements DataProvider { - constructor(collection: oj.Collection); - addEventListener(eventType: string, listener: EventListener): void - containsKeys(params: FetchByKeysParameters): Promise> - dispatchEvent(evt: Event): boolean - fetchByKeys(params: FetchByKeysParameters): Promise> - fetchByOffset(params: FetchByOffsetParameters): Promise> - fetchFirst>(params?: FetchListParameters): AsyncIterable - getCapability(capabilityName?: string): any - getTotalSize(): Promise; - isEmpty(): 'yes'|'no'|'unknown'; - removeEventListener(eventType: string, listener: EventListener): void - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcolor/index.d.ts b/types/@oracle/oraclejet/ojs/ojcolor/index.d.ts deleted file mode 100644 index 0c8397621c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcolor/index.d.ts +++ /dev/null @@ -1,179 +0,0 @@ -declare namespace oj { - class Color { - static ALICEBLUE: oj.Color; - static ANTIQUEWHITE: oj.Color; - static AQUA: oj.Color; - static AQUAMARINE: oj.Color; - static AZURE: oj.Color; - static BEIGE: oj.Color; - static BISQUE: oj.Color; - static BLACK: oj.Color; - static BLANCHEDALMOND: oj.Color; - static BLUE: oj.Color; - static BLUEVIOLET: oj.Color; - static BROWN: oj.Color; - static BURLYWOOD: oj.Color; - static CADETBLUE: oj.Color; - static CHARTREUSE: oj.Color; - static CHOCOLATE: oj.Color; - static CORAL: oj.Color; - static CORNFLOWERBLUE: oj.Color; - static CORNSILK: oj.Color; - static CRIMSON: oj.Color; - static CYAN: oj.Color; - static DARKBLUE: oj.Color; - static DARKCYAN: oj.Color; - static DARKGOLDENROD: oj.Color; - static DARKGRAY: oj.Color; - static DARKGREEN: oj.Color; - static DARKGREY: oj.Color; - static DARKKHAKI: oj.Color; - static DARKMAGENTA: oj.Color; - static DARKOLIVEGREEN: oj.Color; - static DARKORANGE: oj.Color; - static DARKORCHID: oj.Color; - static DARKRED: oj.Color; - static DARKSALMON: oj.Color; - static DARKSEAGREEN: oj.Color; - static DARKSLATEBLUE: oj.Color; - static DARKSLATEGRAY: oj.Color; - static DARKSLATEGREY: oj.Color; - static DARKTURQUOISE: oj.Color; - static DARKVIOLET: oj.Color; - static DEEPPINK: oj.Color; - static DEEPSKYBLUE: oj.Color; - static DIMGRAY: oj.Color; - static DIMGREY: oj.Color; - static DODGERBLUE: oj.Color; - static FIREBRICK: oj.Color; - static FLORALWHITE: oj.Color; - static FORESTGREEN: oj.Color; - static FUCHSIA: oj.Color; - static GAINSBORO: oj.Color; - static GHOSTWHITE: oj.Color; - static GOLD: oj.Color; - static GOLDENROD: oj.Color; - static GRAY: oj.Color; - static GREEN: oj.Color; - static GREENYELLOW: oj.Color; - static GREY: oj.Color; - static HONEYDEW: oj.Color; - static HOTPINK: oj.Color; - static INDIANRED: oj.Color; - static INDIGO: oj.Color; - static IVORY: oj.Color; - static KHAKI: oj.Color; - static LAVENDER: oj.Color; - static LAVENDERBLUSH: oj.Color; - static LAWNGREEN: oj.Color; - static LEMONCHIFFON: oj.Color; - static LIGHTBLUE: oj.Color; - static LIGHTCORAL: oj.Color; - static LIGHTCYAN: oj.Color; - static LIGHTGOLDENRODYELLOW: oj.Color; - static LIGHTGRAY: oj.Color; - static LIGHTGREEN: oj.Color; - static LIGHTGREY: oj.Color; - static LIGHTPINK: oj.Color; - static LIGHTSALMON: oj.Color; - static LIGHTSEAGREEN: oj.Color; - static LIGHTSKYBLUE: oj.Color; - static LIGHTSLATEGRAY: oj.Color; - static LIGHTSLATEGREY: oj.Color; - static LIGHTSTEELBLUE: oj.Color; - static LIGHTYELLOW: oj.Color; - static LIME: oj.Color; - static LIMEGREEN: oj.Color; - static LINEN: oj.Color; - static MAGENTA: oj.Color; - static MAROON: oj.Color; - static MEDIUMAQUAMARINE: oj.Color; - static MEDIUMBLUE: oj.Color; - static MEDIUMORCHID: oj.Color; - static MEDIUMPURPLE: oj.Color; - static MEDIUMSEAGREEN: oj.Color; - static MEDIUMSLATEBLUE: oj.Color; - static MEDIUMSPRINGGREEN: oj.Color; - static MEDIUMTURQUOISE: oj.Color; - static MEDIUMVIOLETRED: oj.Color; - static MIDNIGHTBLUE: oj.Color; - static MINTCREAM: oj.Color; - static MISTYROSE: oj.Color; - static MOCCASIN: oj.Color; - static NAVAJOWHITE: oj.Color; - static NAVY: oj.Color; - static OLDLACE: oj.Color; - static OLIVE: oj.Color; - static OLIVEDRAB: oj.Color; - static ORANGE: oj.Color; - static ORANGERED: oj.Color; - static ORCHID: oj.Color; - static PALEGOLDENROD: oj.Color; - static PALEGREEN: oj.Color; - static PALETURQUOISE: oj.Color; - static PALEVIOLETRED: oj.Color; - static PAPAYAWHIP: oj.Color; - static PEACHPUFF: oj.Color; - static PERU: oj.Color; - static PINK: oj.Color; - static PLUM: oj.Color; - static POWDERBLUE: oj.Color; - static PURPLE: oj.Color; - static REBECCAPURPLE: oj.Color; - static RED: oj.Color; - static ROSYBROWN: oj.Color; - static ROYALBLUE: oj.Color; - static SADDLEBROWN: oj.Color; - static SALMON: oj.Color; - static SANDYBROWN: oj.Color; - static SEAGREEN: oj.Color; - static SEASHELL: oj.Color; - static SIENNA: oj.Color; - static SILVER: oj.Color; - static SKYBLUE: oj.Color; - static SLATEBLUE: oj.Color; - static SLATEGRAY: oj.Color; - static SLATEGREY: oj.Color; - static SNOW: oj.Color; - static SPRINGGREEN: oj.Color; - static STEELBLUE: oj.Color; - static TAN: oj.Color; - static TEAL: oj.Color; - static THISTLE: oj.Color; - static TOMATO: oj.Color; - static TRANSPARENT: oj.Color; - static TURQUOISE: oj.Color; - static VIOLET: oj.Color; - static WHEAT: oj.Color; - static WHITE: oj.Color; - static WHITESMOKE: oj.Color; - static YELLOW: oj.Color; - static YELLOWGREEN: oj.Color; - constructor(color: string|oj.Color.RGBA|oj.Color.HSLA|oj.Color.HSVA); - getAlpha(): number; - getBlue(doNotRound?: boolean): number; - getGreen(doNotRound?: boolean): number; - getRed(doNotRound?: boolean): number; - isEqual(color: oj.Color): boolean; - toString(): string; - } - namespace Color { - type HSLA = - { - h: number, s: number, l: number, a?: number - } - } - namespace Color { - type HSVA = - { - h: number, s: number, v: number, a?: number - } - } - namespace Color { - type RGBA = - { - r: number, g: number, b: number, a?: number - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts b/types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts deleted file mode 100644 index 34aaa0e23e..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcolorpalette/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/// -declare namespace oj { - class ojColorPalette extends editableValue { - labelDisplay: 'auto'|'off'; - labelledBy: string|null; - layout: 'grid'|'list'; - palette: Array<{color: oj.Color, label?: string}>; - swatchSize: 'xs'|'sm'|'lg'; - value: oj.Color; - translations: {labelNone?: string}; - onLabelDisplayChanged: (event: CustomEvent)=> any; - onLabelledByChanged: (event: CustomEvent)=> any; - onLayoutChanged: (event: CustomEvent)=> any; - onPaletteChanged: (event: CustomEvent)=> any; - onSwatchSizeChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojColorPalette.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojColorPalette.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojColorPaletteEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - setProperties(properties: object): any; - setProperty(property: string, value: any): any; - } - namespace ojColorPalette { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojColorPaletteEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojColorPalette.ojAnimateEnd; - 'ojAnimateStart': oj.ojColorPalette.ojAnimateStart; - 'labelDisplayChanged': CustomEvent; - 'labelledByChanged': CustomEvent; - 'layoutChanged': CustomEvent; - 'paletteChanged': CustomEvent; - 'swatchSizeChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojColorPaletteSettableProperties extends editableValueSettableProperties { - labelDisplay: 'auto'|'off'; - labelledBy: string|null; - layout: 'grid'|'list'; - palette: Array<{color: oj.Color, label?: string}>; - swatchSize: 'xs'|'sm'|'lg'; - value: oj.Color; - translations: {labelNone?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts b/types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts deleted file mode 100644 index f5e8308c9c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcolorspectrum/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/// -declare namespace oj { - class ojColorSpectrum extends editableValue { - labelledBy: string|null; - readonly transientValue: oj.Color; - value: oj.Color; - translations: {labelHue?: string, labelOpacity?: string, labelSatLum?: string, labelThumbDesc?: string}; - onLabelledByChanged: (event: CustomEvent)=> any; - onTransientValueChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojColorSpectrum.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojColorSpectrum.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojColorSpectrumEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - setProperties(properties: object): any; - setProperty(property: string, value: any): any; - } - namespace ojColorSpectrum { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojColorSpectrumEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojColorSpectrum.ojAnimateEnd; - 'ojAnimateStart': oj.ojColorSpectrum.ojAnimateStart; - 'labelledByChanged': CustomEvent; - 'transientValueChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojColorSpectrumSettableProperties extends editableValueSettableProperties { - labelledBy: string|null; - readonly transientValue: oj.Color; - value: oj.Color; - translations: {labelHue?: string, labelOpacity?: string, labelSatLum?: string, labelThumbDesc?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts b/types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts deleted file mode 100644 index 0bb4197939..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcomponentcore/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare namespace oj { - abstract class baseComponent extends JetElement { - translations: object|null; - - onTranslationsChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: baseComponentEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - refresh(): void; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface baseComponentEventMap extends oj.JetElementEventMap { - 'translationsChanged': CustomEvent; - } - interface baseComponentSettableProperties extends JetSettableProperties { - translations: object|null; - } - -} -declare namespace oj { - class Components { - static subtreeAttached(node: Element): void; - static subtreeDetached(node: Element): void; - static subtreeHidden(node: Element): void; - static subtreeShown(node: Element, options?: {initialRender: boolean}): void; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts b/types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts deleted file mode 100644 index aeb13c443b..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcomposite/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare namespace oj { - namespace Composite { - function getComponentMetadata(name: string): oj.Composite.Metadata|null; - function register(name: string, descriptor: {metadata: oj.Composite.Metadata, view: string, viewModel: ((param0: oj.Composite.ViewModelContext)=> void|object), parseFunction: ((value: string, name: string, meta: Object, defaultParseFunction: (value: string)=> any)=>any)}): void; - } - namespace Composite { - type Metadata = - { - name: string, version: string, jetVersion: string, properties?: object, methods?: object, events?: object, slots?: object - } - } - namespace Composite { - type PropertyChangedContext = - { - property: string, value: any, previousValue: any, updatedFrom: 'external'|'internal', subproperty?: {path: string, value: any, previousValue: any} - } - } - namespace Composite { - type ViewModel = - { - activated: ((param0: oj.Composite.ViewModelContext)=> Promise|void), connected: ((param0: oj.Composite.ViewModelContext)=> void), bindingsApplied: ((param0: oj.Composite.ViewModelContext)=> void), propertyChanged: ((param0: oj.Composite.PropertyChangedContext)=> void), disconnected: ((param0: Element)=> void) - } - } - namespace Composite { - type ViewModelContext = - { - element: Element, properties: object, slotCounts: object, unique: string, uniqueId: string - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts b/types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts deleted file mode 100644 index f7463f449e..0000000000 --- a/types/@oracle/oraclejet/ojs/ojconveyorbelt/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// -declare namespace oj { - class ojConveyorBelt extends baseComponent { - contentParent: string|null; - orientation: 'horizontal'|'vertical'; - onContentParentChanged: (event: CustomEvent)=> any; - onOrientationChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojConveyorBeltEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - } - interface ojConveyorBeltEventMap extends oj.baseComponentEventMap { - 'contentParentChanged': CustomEvent; - 'orientationChanged': CustomEvent; - } - interface ojConveyorBeltSettableProperties extends baseComponentSettableProperties { - contentParent: string|null; - orientation: 'horizontal'|'vertical'; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojcore/index.d.ts b/types/@oracle/oraclejet/ojs/ojcore/index.d.ts deleted file mode 100644 index 2d23485157..0000000000 --- a/types/@oracle/oraclejet/ojs/ojcore/index.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -declare namespace oj { - class BusyContext { - static applicationBootstrapComplete(): undefined; - static setDefaultTimeout(timeout: number): undefined; - addBusyState(options: {description: object|(()=> string)}): (()=> void); - clear(): undefined; - dump(message?: string): undefined; - getBusyStates(): Array<{id:string, description:string}>; - isReady(): boolean; - toString(): string; - whenReady(timeout?: number): Promise<(boolean|Error)>; - } - -} -declare namespace oj { - class Config { - static getAutomationMode(): string; - static getDeviceType(): 'phone'|'tablet'|'others'; - static getLocale(): string; - static getResourceUrl(relativePath: string): string; - static getVersionInfo(): string; - static logVersionInfo(): undefined; - static setAutomationMode(mode: string): undefined; - static setLocale(locale: string, callback?: (()=> void)): undefined; - static setResourceBaseUrl(baseUrl: string): undefined; - } - -} -declare namespace oj { - class Context { - static getContext(node: Element): oj.Context; - static getPageContext(): oj.Context; - getBusyContext(): oj.BusyContext; - } - -} -declare namespace oj { - class Logger { - static readonly LEVEL_ERROR: number; - static readonly LEVEL_INFO: number; - static readonly LEVEL_LOG: number; - static readonly LEVEL_NONE: number; - static readonly LEVEL_WARN: number; - static error(...args: (object|string|number)[]): void; - static info(...args: (object|string|number)[]): void; - static log(...args: (object|string|number)[]): void; - static option(key?: object|string, value?: any): any; - static warn(...args: (object|string|number)[]): void; - } - -} -declare namespace oj { - class Object { - constructor(); - static compareValues(obj1: any, obj2: any): boolean; - static copyPropertiesForClass(targetClass: object, source: object): void; - static createCallback(obj: object, func: object): ()=>any; - static createSubclass(extendingClass: object, baseClass: object, typeName?: string): void; - static ensureClassInitialization(clazz: object): void; - static getTypeName(): string; - static isEmpty(): boolean; - clone(): object; - equals(object: object): boolean; - getClass(otherInstance?: object): object; - getTypeName(clazz: object|null): string; - Init(): void; - toDebugString(): string; - toString(): string; - } - -} -declare namespace oj { - class ResponsiveUtils { - static compare(size1: oj.ResponsiveUtils.SCREEN_RANGE, size2: oj.ResponsiveUtils.SCREEN_RANGE): number; - static getFrameworkQuery(frameworkQueryKey: oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY): string|null; - } - namespace ResponsiveUtils { - enum FRAMEWORK_QUERY_KEY { - SM_UP = "sm-up", - MD_UP = "md-up", - LG_UP = "lg-up", - XL_UP = "xl-up", - XXL_UP = "xxl-up", - SM_ONLY = "sm-only", - MD_ONLY = "md-only", - LG_ONLY = "lg-only", - XL_ONLY = "xl-only", - MD_DOWN = "md-down", - LG_DOWN = "lg-down", - XL_DOWN = "xl-down", - HIGH_RESOLUTION = "high-resolution", - } - enum SCREEN_RANGE { - SM = "sm", - MD = "md", - LG = "lg", - XL = "xl", - XXL = "xxl", - } - } - - -} -declare namespace oj { - class ThemeUtils { - constructor(); - static clearCache(): void; - static getThemeName(): string|null; - static getThemeTargetPlatform(): string|null; - static parseJSONFromFontFamily(selector: string): any; - } - -} -declare namespace oj { - class Translations { - static applyParameters(pattern: string, parameters: object|Array): string|null; - static getComponentTranslations(componentName: string): object; - static getResource(key: string): object|string|null; - static getTranslatedString(key: string, ...var_args: (string|object|Array)[]): string; - static setBundle(bundle: object): void; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts deleted file mode 100644 index 45cd10f459..0000000000 --- a/types/@oracle/oraclejet/ojs/ojdataprovider/index.d.ts +++ /dev/null @@ -1,254 +0,0 @@ -declare namespace oj { - interface AttributeFilterOperator { - attribute: string; - op: oj.AttributeFilterOperator.AttributeOperator; - value: any; - } - namespace AttributeFilterOperator { - enum AttributeOperator { - $co, - $eq, - $ew, - $pr, - $gt, - $ge, - $lt, - $le, - $ne, - $regex, - $sw, - } - } - - -} -declare namespace oj { - interface CompoundFilterOperator { - criteria: FilterOperator[]; - op: oj.CompoundFilterOperator.CompoundOperator; - } - namespace CompoundFilterOperator { - enum CompoundOperator { - $and, - $or, - } - } - - -} -declare namespace oj { - interface ContainsKeysResults { - containsParameters: FetchByKeysParameters; - results: Set; - } - -} -declare namespace oj { - interface DataMapping { - mapFields: (item: Item) => Item; - mapFilterCriterion?: (filterCriterion: FilterOperator[]) => FilterOperator[]; - mapSortCriteria?: (sortCriteria: SortCriterion[]) => SortCriterion[]; - unmapSortCriteria?: (sortCriteria: SortCriterion[]) => SortCriterion[]; - } - -} -declare namespace oj { - interface DataProvider extends EventTarget { - containsKeys(parameters : FetchByKeysParameters) : Promise> - fetchByKeys(parameters : FetchByKeysParameters) : Promise> - fetchByOffset(parameters: FetchByOffsetParameters): Promise> - fetchFirst(FetchListParameters?): AsyncIterable> - getCapability(capabilityName: string): any - getTotalSize(): Promise; - isEmpty(): 'yes' | 'no' | 'unknown' - } - -} -declare namespace oj { - interface DataProviderAddOperationEventDetail extends DataProviderOperationEventDetail { - afterKeys?: Set; - } - -} -declare namespace oj { - class DataProviderMutationEvent implements Event { - AT_TARGET: number; - BUBBLING_PHASE: number; - CAPTURING_PHASE: number; - NONE: number; - bubbles: boolean; - cancelBubble: boolean; - cancelable: boolean; - composed: boolean; - currentTarget: EventTarget; - deepPath: () => EventTarget[]; - defaultPrevented: boolean; - detail: DataProviderMutationEventDetail; - eventPhase: number; - initEvent: (eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean) => void; - isTrusted: boolean; - preventDefault: () => void; - returnValue: boolean; - scoped: boolean; - srcElement: Element|null; - stopImmediatePropagation: () => void; - stopPropagation: () => void; - target: EventTarget; - timeStamp: number; - type: string; - constructor(detail: DataProviderMutationEventDetail); - } - -} -declare namespace oj { - interface DataProviderMutationEventDetail { - add?: DataProviderAddOperationEventDetail; - remove?: DataProviderOperationEventDetail; - update?: DataProviderOperationEventDetail; - } - -} -declare namespace oj { - interface DataProviderOperationEventDetail { - data?: D[]; - indexes?: number[]; - keys: Set; - metadata?: ItemMetadata[]; - } - -} -declare namespace oj { - class DataProviderRefreshEvent implements Event { - AT_TARGET: number; - BUBBLING_PHASE: number; - CAPTURING_PHASE: number; - NONE: number; - bubbles: boolean; - cancelBubble: boolean; - cancelable: boolean; - composed: boolean; - currentTarget: EventTarget; - deepPath: () => EventTarget[]; - defaultPrevented: boolean; - eventPhase: number; - initEvent: (eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean) => void; - isTrusted: boolean; - preventDefault: () => void; - returnValue: boolean; - scoped: boolean; - srcElement: Element|null; - stopImmediatePropagation: () => void; - stopPropagation: () => void; - target: EventTarget; - timeStamp: number; - type: string; - constructor(); - } - -} -declare namespace oj { - interface FetchByKeysCapability { - implementation: 'iteration'|'lookup'; - } - -} -declare namespace oj { - class FetchByKeysMixin { - static applyMixin(derivedCtor: Function): any; - } - -} -declare namespace oj { - interface FetchByKeysParameters { - keys: Set; - } - -} -declare namespace oj { - interface FetchByKeysResults { - fetchParameters: FetchByKeysParameters; - results: Map>; - } - -} -declare namespace oj { - interface FetchByOffsetCapability { - implementation: 'iteration'|'randomAccess'; - } - -} -declare namespace oj { - class FetchByOffsetMixin { - static applyMixin(derivedCtor: Function): any; - } - -} -declare namespace oj { - interface FetchByOffsetParameters extends FetchListParameters { - offset: number; - } - -} -declare namespace oj { - interface FetchByOffsetResults { - done: boolean; - fetchParameters: FetchByOffsetParameters; - results: Array>; - } - -} -declare namespace oj { - interface FetchListParameters { - filterCriterion?: FilterOperator; - size: number; - sortCriteria?: SortCriterion[]; - } - -} -declare namespace oj { - interface FetchListResult { - data: D[]; - fetchParameters: FetchListParameters; - metadata: ItemMetadata[]; - } - -} -declare namespace oj { - interface FilterCapability { - operators: Array; - } - -} -declare namespace oj { - interface FilterOperator { - op: oj.AttributeFilterOperator.AttributeOperator|oj.CompoundFilterOperator.CompoundOperator; - filter(data: Array): Array; - } - -} -declare namespace oj { - interface Item { - data: D; - metadata: ItemMetadata; - } - -} -declare namespace oj { - interface ItemMetadata { - key: K; - } - -} -declare namespace oj { - interface SortCapability { - attributes: 'none'|'single'|'multiple'; - } - -} -declare namespace oj { - interface SortCriterion { - attribute: keyof D; - direction: string; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts b/types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts deleted file mode 100644 index 707a963de7..0000000000 --- a/types/@oracle/oraclejet/ojs/ojdatetimepicker/index.d.ts +++ /dev/null @@ -1,308 +0,0 @@ -/// -/// -/// -declare namespace oj { - class ojDatePicker extends ojInputDate { - keyboardEdit: 'disabled'; - max: string|null; - min: string|null; - renderMode: 'jet'; - value: string; - onKeyboardEditChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onRenderModeChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojDatePicker.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojDatePicker.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojDatePickerEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojDatePicker { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojDatePickerEventMap extends oj.ojInputDateEventMap { - 'ojAnimateEnd': oj.ojDatePicker.ojAnimateEnd; - 'ojAnimateStart': oj.ojDatePicker.ojAnimateStart; - 'keyboardEditChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'renderModeChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojDatePickerSettableProperties extends ojInputDateSettableProperties { - keyboardEdit: 'disabled'; - max: string|null; - min: string|null; - renderMode: 'jet'; - value: string; - } - -} -declare namespace oj { - class ojDateTimePicker extends ojInputDateTime { - keyboardEdit: 'disabled'; - max: string|null; - min: string|null; - renderMode: 'jet'; - value: string; - onKeyboardEditChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onRenderModeChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojDateTimePicker.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojDateTimePicker.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojDateTimePickerEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojDateTimePicker { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojDateTimePickerEventMap extends oj.ojInputDateTimeEventMap { - 'ojAnimateEnd': oj.ojDateTimePicker.ojAnimateEnd; - 'ojAnimateStart': oj.ojDateTimePicker.ojAnimateStart; - 'keyboardEditChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'renderModeChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojDateTimePickerSettableProperties extends ojInputDateTimeSettableProperties { - keyboardEdit: 'disabled'; - max: string|null; - min: string|null; - renderMode: 'jet'; - value: string; - } - -} -declare namespace oj { - class ojInputDate extends inputBase { - converter: oj.Converter|oj.Validation.RegisteredConverter; - datePicker: {changeMonth: 'select'|'none', changeYear: 'select'|'none', currentMonthPos: number, daysOutsideMonth: 'hidden'|'visible'|'selectable', footerLayout: ''|'today', numberOfMonths: number, showOn: 'focus'|'image', stepBigMonths: number, stepMonths: 'numberOfMonths'|number, weekDisplay: 'number'|'none', yearRange: string}; - dayFormatter: (param: oj.ojInputDate.DayFormatterInput)=> (null|'all'|oj.ojInputDate.DayFormatterOutput); - dayMetaData: {[key:string]: {[key:string]: {[key:string]: {disabled?: boolean, className?: string, tooltip?: string}}}}; - keyboardEdit: 'enabled'|'disabled'; - max: string|null; - min: string|null; - pickerAttributes: {style?: string, class?: string}; - renderMode: 'jet'|'native'; - validators: Array|oj.Validation.RegisteredValidator>; - value: string; - translations: {currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; - onConverterChanged: (event: CustomEvent)=> any; - onDatePickerChanged: (event: CustomEvent)=> any; - onDayFormatterChanged: (event: CustomEvent)=> any; - onDayMetaDataChanged: (event: CustomEvent)=> any; - onKeyboardEditChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onPickerAttributesChanged: (event: CustomEvent)=> any; - onRenderModeChanged: (event: CustomEvent)=> any; - onValidatorsChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojInputDate.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojInputDate.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputDateEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - hide(): void; - refresh(): void; - show(): void; - } - namespace ojInputDate { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojInputDateEventMap extends oj.inputBaseEventMap { - 'ojAnimateEnd': oj.ojInputDate.ojAnimateEnd; - 'ojAnimateStart': oj.ojInputDate.ojAnimateStart; - 'converterChanged': CustomEvent; - 'datePickerChanged': CustomEvent; - 'dayFormatterChanged': CustomEvent; - 'dayMetaDataChanged': CustomEvent; - 'keyboardEditChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'pickerAttributesChanged': CustomEvent; - 'renderModeChanged': CustomEvent; - 'validatorsChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojInputDateSettableProperties extends inputBaseSettableProperties { - converter: oj.Converter|oj.Validation.RegisteredConverter; - datePicker: {changeMonth: 'select'|'none', changeYear: 'select'|'none', currentMonthPos: number, daysOutsideMonth: 'hidden'|'visible'|'selectable', footerLayout: ''|'today', numberOfMonths: number, showOn: 'focus'|'image', stepBigMonths: number, stepMonths: 'numberOfMonths'|number, weekDisplay: 'number'|'none', yearRange: string}; - dayFormatter: (param: oj.ojInputDate.DayFormatterInput)=> (null|'all'|oj.ojInputDate.DayFormatterOutput); - dayMetaData: {[key:string]: {[key:string]: {[key:string]: {disabled?: boolean, className?: string, tooltip?: string}}}}; - keyboardEdit: 'enabled'|'disabled'; - max: string|null; - min: string|null; - pickerAttributes: {style?: string, class?: string}; - renderMode: 'jet'|'native'; - validators: Array|oj.Validation.RegisteredValidator>; - value: string; - translations: {currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; - } - namespace ojInputDate { - type DayFormatterInput = - { - fullYear: number, month: number, date: number - } - } - namespace ojInputDate { - type DayFormatterOutput = - { - disabled?: boolean, className?: string, tooltip?: string - } - } - -} -declare namespace oj { - class ojInputDateTime extends ojInputDate { - converter: oj.Converter|oj.Validation.RegisteredConverter; - max: string|null; - min: string|null; - renderMode: 'jet'|'native'; - timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; - validators: Array|oj.Validation.RegisteredValidator>; - value: string; - translations: {cancel?: string, currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, done?: string, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; - onConverterChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onRenderModeChanged: (event: CustomEvent)=> any; - onTimePickerChanged: (event: CustomEvent)=> any; - onValidatorsChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojInputDateTime.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojInputDateTime.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputDateTimeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - hideTimePicker(): void; - show(): void; - showTimePicker(): void; - } - namespace ojInputDateTime { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojInputDateTimeEventMap extends oj.ojInputDateEventMap { - 'ojAnimateEnd': oj.ojInputDateTime.ojAnimateEnd; - 'ojAnimateStart': oj.ojInputDateTime.ojAnimateStart; - 'converterChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'renderModeChanged': CustomEvent; - 'timePickerChanged': CustomEvent; - 'validatorsChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojInputDateTimeSettableProperties extends ojInputDateSettableProperties { - converter: oj.Converter|oj.Validation.RegisteredConverter; - max: string|null; - min: string|null; - renderMode: 'jet'|'native'; - timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; - validators: Array|oj.Validation.RegisteredValidator>; - value: string; - translations: {cancel?: string, currentText?: string, dateRestriction?: {hint?: string, messageDetail?: string, messageSummary?: string}, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, done?: string, nextText?: string, prevText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipCalendar?: string, tooltipCalendarDisabled?: string, tooltipCalendarTime?: string, tooltipCalendarTimeDisabled?: string, weekHeader?: string}; - } - -} -declare namespace oj { - class ojInputTime extends inputBase { - converter: oj.Converter|oj.Validation.RegisteredConverter; - keyboardEdit: 'enabled'|'disabled'; - max: string|null; - min: string|null; - pickerAttributes: {style?: string, class?: string}; - renderMode: 'jet'|'native'; - timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; - validators: Array|oj.Validation.RegisteredValidator>; - value: string; - translations: {ampmWheelLabel?: string, cancelText?: string, currentTimeText?: string, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, hourWheelLabel?: string, minuteWheelLabel?: string, okText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipTime?: string, tooltipTimeDisabled?: string}; - onConverterChanged: (event: CustomEvent)=> any; - onKeyboardEditChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onPickerAttributesChanged: (event: CustomEvent)=> any; - onRenderModeChanged: (event: CustomEvent)=> any; - onTimePickerChanged: (event: CustomEvent)=> any; - onValidatorsChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojInputTime.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojInputTime.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputTimeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - hide(): void; - refresh(): void; - show(): void; - } - namespace ojInputTime { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojInputTimeEventMap extends oj.inputBaseEventMap { - 'ojAnimateEnd': oj.ojInputTime.ojAnimateEnd; - 'ojAnimateStart': oj.ojInputTime.ojAnimateStart; - 'converterChanged': CustomEvent; - 'keyboardEditChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'pickerAttributesChanged': CustomEvent; - 'renderModeChanged': CustomEvent; - 'timePickerChanged': CustomEvent; - 'validatorsChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojInputTimeSettableProperties extends inputBaseSettableProperties { - converter: oj.Converter|oj.Validation.RegisteredConverter; - keyboardEdit: 'enabled'|'disabled'; - max: string|null; - min: string|null; - pickerAttributes: {style?: string, class?: string}; - renderMode: 'jet'|'native'; - timePicker: {footerLayout: ''|'now', showOn: 'focus'|'image', timeIncrement: string}; - validators: Array|oj.Validation.RegisteredValidator>; - value: string; - translations: {ampmWheelLabel?: string, cancelText?: string, currentTimeText?: string, dateTimeRange?: {hint?: {inRange?: string, max?: string, min?: string}, messageDetail?: {rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, hourWheelLabel?: string, minuteWheelLabel?: string, okText?: string, regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipTime?: string, tooltipTimeDisabled?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojdefer/index.d.ts b/types/@oracle/oraclejet/ojs/ojdefer/index.d.ts deleted file mode 100644 index 7672ac8a35..0000000000 --- a/types/@oracle/oraclejet/ojs/ojdefer/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare namespace oj { - class ojDefer extends JetElement { - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojDeferEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojDeferEventMap extends oj.JetElementEventMap { - } - interface ojDeferSettableProperties extends JetSettableProperties { - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts deleted file mode 100644 index 0df017ec3c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojdeferreddataprovider/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -declare namespace oj { - class DeferredDataProvider implements DataProvider { - constructor(dataProvider: Promise>[], capabilityFunc: Function); - addEventListener(eventType: string, listener: EventListener): any; - containsKeys(params: FetchByKeysParameters): Promise> - dispatchEvent(evt: Event): boolean; - fetchByKeys(params: FetchByKeysParameters): Promise> - fetchByOffset(params: FetchByOffsetParameters): Promise> - fetchFirst>(params?: FetchListParameters): AsyncIterable - getCapability(capabilityName: string): object; - getTotalSize(): Promise; - isEmpty(): 'yes'|'no'|'unknown'; - removeEventListener(eventType: string, listener: EventListener): any; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojdialog/index.d.ts b/types/@oracle/oraclejet/ojs/ojdialog/index.d.ts deleted file mode 100644 index 85ea4be39c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojdialog/index.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -/// -declare namespace oj { - class ojDialog extends baseComponent { - cancelBehavior: 'icon'|'escape'|'none'; - dragAffordance: 'title-bar'|'none'; - initialVisibility: 'hide'|'show'; - modality: 'modal'|'modeless'; - position: oj.ojDialog.Position; - resizeBehavior: 'resizable'|'none'; - role: string; - translations: {labelCloseIcon?: string}; - onCancelBehaviorChanged: (event: CustomEvent)=> any; - onDragAffordanceChanged: (event: CustomEvent)=> any; - onInitialVisibilityChanged: (event: CustomEvent)=> any; - onModalityChanged: (event: CustomEvent)=> any; - onPositionChanged: (event: CustomEvent)=> any; - onResizeBehaviorChanged: (event: CustomEvent)=> any; - onRoleChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojDialog.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojDialog.ojAnimateStart)=> any; - onOjBeforeClose: (event: oj.ojDialog.ojBeforeClose)=> any; - onOjBeforeOpen: (event: oj.ojDialog.ojBeforeOpen)=> any; - onOjClose: (event: oj.ojDialog.ojClose)=> any; - onOjFocus: (event: oj.ojDialog.ojFocus)=> any; - onOjOpen: (event: oj.ojDialog.ojOpen)=> any; - onOjResize: (event: oj.ojDialog.ojResize)=> any; - onOjResizeStart: (event: oj.ojDialog.ojResizeStart)=> any; - onOjResizeStop: (event: oj.ojDialog.ojResizeStop)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojDialogEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - close(): void; - isOpen(): boolean; - open(): void; - refresh(): void; - } - namespace ojDialog { - class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: 'open'|'close', element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeClose extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojBeforeOpen extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojClose extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojFocus extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojOpen extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojResize extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojResizeStart extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojResizeStop extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - } - interface ojDialogEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.ojDialog.ojAnimateEnd; - 'ojAnimateStart': oj.ojDialog.ojAnimateStart; - 'ojBeforeClose': oj.ojDialog.ojBeforeClose; - 'ojBeforeOpen': oj.ojDialog.ojBeforeOpen; - 'ojClose': oj.ojDialog.ojClose; - 'ojFocus': oj.ojDialog.ojFocus; - 'ojOpen': oj.ojDialog.ojOpen; - 'ojResize': oj.ojDialog.ojResize; - 'ojResizeStart': oj.ojDialog.ojResizeStart; - 'ojResizeStop': oj.ojDialog.ojResizeStop; - 'cancelBehaviorChanged': CustomEvent; - 'dragAffordanceChanged': CustomEvent; - 'initialVisibilityChanged': CustomEvent; - 'modalityChanged': CustomEvent; - 'positionChanged': CustomEvent; - 'resizeBehaviorChanged': CustomEvent; - 'roleChanged': CustomEvent; - } - interface ojDialogSettableProperties extends baseComponentSettableProperties { - cancelBehavior: 'icon'|'escape'|'none'; - dragAffordance: 'title-bar'|'none'; - initialVisibility: 'hide'|'show'; - modality: 'modal'|'modeless'; - position: oj.ojDialog.Position; - resizeBehavior: 'resizable'|'none'; - role: string; - translations: {labelCloseIcon?: string}; - } - namespace ojDialog { - type Position = - { - my?: oj.ojDialog.PositionAlign, at?: oj.ojDialog.PositionAlign, offset?: oj.ojDialog.PositionPoint, of?: string|oj.ojDialog.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'none' - } - } - namespace ojDialog { - type PositionAlign = - { - vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' - } - } - namespace ojDialog { - type PositionPoint = - { - x?: number, y?: number - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts b/types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts deleted file mode 100644 index 9624749ed1..0000000000 --- a/types/@oracle/oraclejet/ojs/ojdvt-base/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -declare namespace oj { - abstract class dvtBaseComponent extends baseComponent { - trackResize: 'on'|'off'; - translations: {labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onTrackResizeChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: dvtBaseComponentEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface dvtBaseComponentEventMap extends oj.baseComponentEventMap { - 'trackResizeChanged': CustomEvent; - } - interface dvtBaseComponentSettableProperties extends baseComponentSettableProperties { - trackResize: 'on'|'off'; - translations: {labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts b/types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts deleted file mode 100644 index 63176945d9..0000000000 --- a/types/@oracle/oraclejet/ojs/ojeditablevalue/index.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/// -/// -declare namespace oj { - abstract class editableValue, SV= V, RV= V> extends baseComponent { - describedBy: string|null; - disabled: boolean; - displayOptions: {converterHint: Array<'placeholder'|'notewindow'|'none'>|'placeholder'|'notewindow'|'none', helpInstruction: Array<'notewindow'|'none'>|'notewindow'|'none', messages: Array<'inline'|'notewindow'|'none'>|'inline'|'notewindow'|'none', validatorHint: Array<'notewindow'|'none'>|'notewindow'|'none'}; - help: {instruction?: string}; - helpHints: {definition?: string, source?: string}; - labelHint: string; - messagesCustom: Array; - readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; - value: V; - onDescribedByChanged: (event: CustomEvent)=> any; - onDisabledChanged: (event: CustomEvent)=> any; - onDisplayOptionsChanged: (event: CustomEvent)=> any; - onHelpChanged: (event: CustomEvent)=> any; - onHelpHintsChanged: (event: CustomEvent)=> any; - onLabelHintChanged: (event: CustomEvent)=> any; - onMessagesCustomChanged: (event: CustomEvent)=> any; - onValidChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.editableValue.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.editableValue.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: editableValueEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - reset(): void; - showMessages(): void; - } - namespace editableValue { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface editableValueEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.editableValue.ojAnimateEnd; - 'ojAnimateStart': oj.editableValue.ojAnimateStart; - 'describedByChanged': CustomEvent; - 'disabledChanged': CustomEvent; - 'displayOptionsChanged': CustomEvent; - 'helpChanged': CustomEvent; - 'helpHintsChanged': CustomEvent; - 'labelHintChanged': CustomEvent; - 'messagesCustomChanged': CustomEvent; - 'validChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface editableValueSettableProperties extends baseComponentSettableProperties { - describedBy: string|null; - disabled: boolean; - displayOptions: {converterHint: Array<'placeholder'|'notewindow'|'none'>|'placeholder'|'notewindow'|'none', helpInstruction: Array<'notewindow'|'none'>|'notewindow'|'none', messages: Array<'inline'|'notewindow'|'none'>|'inline'|'notewindow'|'none', validatorHint: Array<'notewindow'|'none'>|'notewindow'|'none'}; - help: {instruction?: string}; - helpHints: {definition?: string, source?: string}; - labelHint: string; - messagesCustom: Array; - readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; - value: SV; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts b/types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts deleted file mode 100644 index dbcfec3632..0000000000 --- a/types/@oracle/oraclejet/ojs/ojfilepicker/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// -declare namespace oj { - interface FileUploadTransport { - flush(): void; - queue(fileList: FileList): Array; - } - -} -declare namespace oj { - class ojFilePicker extends JetElement { - accept: Array|null; - selectOn: 'auto'|'click'|'drop'|'clickAndDrop'; - selectionMode: 'multiple'|'single'; - onAcceptChanged: (event: CustomEvent)=> any; - onSelectOnChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onOjSelect: (event: oj.ojFilePicker.ojSelect)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojFilePickerEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - namespace ojFilePicker { - class ojSelect extends CustomEvent<{files: FileList, [propName: string]: any}> { - - } - } - interface ojFilePickerEventMap extends oj.JetElementEventMap { - 'ojSelect': oj.ojFilePicker.ojSelect; - 'acceptChanged': CustomEvent; - 'selectOnChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - } - interface ojFilePickerSettableProperties extends JetSettableProperties { - accept: Array|null; - selectOn: 'auto'|'click'|'drop'|'clickAndDrop'; - selectionMode: 'multiple'|'single'; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts b/types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts deleted file mode 100644 index 5287e1be53..0000000000 --- a/types/@oracle/oraclejet/ojs/ojfilmstrip/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/// -declare namespace oj { - class ojFilmStrip extends baseComponent { - arrowPlacement: 'adjacent'|'overlay'; - arrowVisibility: 'visible'|'hidden'|'hover'|'auto'; - currentItem: {id?: string, index?: number}; - looping: 'off'|'page'; - maxItemsPerPage: number; - orientation: 'horizontal'|'vertical'; - translations: {labelAccArrowNextPage?: string, labelAccArrowPreviousPage?: string, labelAccFilmStrip?: string, tipArrowNextPage?: string, tipArrowPreviousPage?: string}; - onArrowPlacementChanged: (event: CustomEvent)=> any; - onArrowVisibilityChanged: (event: CustomEvent)=> any; - onCurrentItemChanged: (event: CustomEvent)=> any; - onLoopingChanged: (event: CustomEvent)=> any; - onMaxItemsPerPageChanged: (event: CustomEvent)=> any; - onOrientationChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojFilmStripEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getItemsPerPage(): number; - refresh(): void; - } - interface ojFilmStripEventMap extends oj.baseComponentEventMap { - 'arrowPlacementChanged': CustomEvent; - 'arrowVisibilityChanged': CustomEvent; - 'currentItemChanged': CustomEvent; - 'loopingChanged': CustomEvent; - 'maxItemsPerPageChanged': CustomEvent; - 'orientationChanged': CustomEvent; - } - interface ojFilmStripSettableProperties extends baseComponentSettableProperties { - arrowPlacement: 'adjacent'|'overlay'; - arrowVisibility: 'visible'|'hidden'|'hover'|'auto'; - currentItem: {id?: string, index?: number}; - looping: 'off'|'page'; - maxItemsPerPage: number; - orientation: 'horizontal'|'vertical'; - translations: {labelAccArrowNextPage?: string, labelAccArrowPreviousPage?: string, labelAccFilmStrip?: string, tipArrowNextPage?: string, tipArrowPreviousPage?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts b/types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts deleted file mode 100644 index 4487a1baa7..0000000000 --- a/types/@oracle/oraclejet/ojs/ojformlayout/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare namespace oj { - class ojFormLayout extends JetElement { - direction: 'column'|'row'; - labelEdge: 'start'|'top'; - labelWidth: string; - labelWrapping: 'truncate'|'wrap'; - maxColumns: number; - onDirectionChanged: (event: CustomEvent)=> any; - onLabelEdgeChanged: (event: CustomEvent)=> any; - onLabelWidthChanged: (event: CustomEvent)=> any; - onLabelWrappingChanged: (event: CustomEvent)=> any; - onMaxColumnsChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojFormLayoutEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - refresh(): void; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojFormLayoutEventMap extends oj.JetElementEventMap { - 'directionChanged': CustomEvent; - 'labelEdgeChanged': CustomEvent; - 'labelWidthChanged': CustomEvent; - 'labelWrappingChanged': CustomEvent; - 'maxColumnsChanged': CustomEvent; - } - interface ojFormLayoutSettableProperties extends JetSettableProperties { - direction: 'column'|'row'; - labelEdge: 'start'|'top'; - labelWidth: string; - labelWrapping: 'truncate'|'wrap'; - maxColumns: number; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojgantt/index.d.ts b/types/@oracle/oraclejet/ojs/ojgantt/index.d.ts deleted file mode 100644 index 86b2f26147..0000000000 --- a/types/@oracle/oraclejet/ojs/ojgantt/index.d.ts +++ /dev/null @@ -1,286 +0,0 @@ -/// -/// -declare namespace oj { - class ojGantt extends dvtTimeComponent> { - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - as: string; - axisPosition: 'bottom'|'top'; - dependencyData?: (oj.DataProvider); - dnd: {move?: {tasks?: 'disabled'|'enabled'}}; - end: string; - gridlines: {horizontal?: 'hidden'|'visible'|'auto', vertical?: 'hidden'|'visible'|'auto'}; - majorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; - minorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; - referenceObjects: Array; - rowAxis: {label?: {renderer: ((context: oj.ojGantt.RowAxisLabelRendererContext) => ({insert: Element}))}, maxWidth?: string, rendered?: 'on'|'off', width?: string}; - rowDefaults: {height?: number}; - scrollPosition: {offsetY?: number, rowIndex?: number, y?: number}; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - start: string; - taskData?: (oj.DataProvider); - taskDefaults: {baseline?: {borderRadius?: string, height?: number, svgClassName?: string, svgStyle?: object}, borderRadius?: string, height?: number, labelPosition?: (string|Array), progress?: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object}, svgClassName?: string, svgStyle?: object, type?: 'normal'|'milestone'|'summary'|'auto'}; - tooltip: {renderer: ((context: oj.ojGantt.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - valueFormats: {baselineDate?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineEnd?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineStart?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, date?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, end?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, label?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, progress?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, row?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, start?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}}; - viewportEnd: string; - viewportStart: string; - translations: {accessibleDependencyInfo?: string, accessiblePredecessorInfo?: string, accessibleSuccessorInfo?: string, accessibleTaskTypeMilestone?: string, accessibleTaskTypeSummary?: string, componentName?: string, finishFinishDependencyAriaDesc?: string, finishStartDependencyAriaDesc?: string, labelAndValue?: string, labelBaselineDate?: string, labelBaselineEnd?: string, labelBaselineStart?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelEnd?: string, labelInvalidData?: string, labelLabel?: string, labelMoveBy?: string, labelNoData?: string, labelProgress?: string, labelRow?: string, labelStart?: string, startFinishDependencyAriaDesc?: string, startStartDependencyAriaDesc?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, taskMoveCancelled?: string, taskMoveFinalized?: string, taskMoveInitiated?: string, taskMoveInitiatedInstruction?: string, taskMoveSelectionInfo?: string, tooltipZoomIn?: string, tooltipZoomOut?: string}; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onAxisPositionChanged: (event: CustomEvent)=> any; - onDependencyDataChanged: (event: CustomEvent)=> any; - onDndChanged: (event: CustomEvent)=> any; - onEndChanged: (event: CustomEvent)=> any; - onGridlinesChanged: (event: CustomEvent)=> any; - onMajorAxisChanged: (event: CustomEvent)=> any; - onMinorAxisChanged: (event: CustomEvent)=> any; - onReferenceObjectsChanged: (event: CustomEvent)=> any; - onRowAxisChanged: (event: CustomEvent)=> any; - onRowDefaultsChanged: (event: CustomEvent)=> any; - onScrollPositionChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onStartChanged: (event: CustomEvent)=> any; - onTaskDataChanged: (event: CustomEvent)=> any; - onTaskDefaultsChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onValueFormatsChanged: (event: CustomEvent)=> any; - onViewportEndChanged: (event: CustomEvent)=> any; - onViewportStartChanged: (event: CustomEvent)=> any; - onOjMove: (event: oj.ojGantt.ojMove)=> any; - onOjViewportChange: (event: oj.ojGantt.ojViewportChange)=> any; - - addEventListener>(type: T, listener: (this: HTMLElement, ev: ojGanttEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): {subId: 'oj-gantt-row-label', index: number} | {subId: 'oj-gantt-taskbar', rowIndex: number, index: number} | null; - } - namespace ojGantt { - class ojMove extends CustomEvent<{taskContexts: Array<{data: oj.ojGantt.RowTask, rowData: oj.ojGantt.Row, itemData: D2|null, color: string}>, value: string, start: string, end: string, baselineStart: string, baselineEnd: string, rowContext: {rowData: oj.ojGantt.Row, componentElement: Element}, [propName: string]: any}> { - - } - - class ojViewportChange extends CustomEvent<{viewportStart: string, viewportEnd: string, majorAxisScale: string, minorAxisScale: string, [propName: string]: any}> { - - } - } - interface ojGanttEventMap extends oj.dvtTimeComponentEventMap { - 'ojMove': oj.ojGantt.ojMove; - 'ojViewportChange': oj.ojGantt.ojViewportChange; - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'asChanged': CustomEvent; - 'axisPositionChanged': CustomEvent; - 'dependencyDataChanged': CustomEvent; - 'dndChanged': CustomEvent; - 'endChanged': CustomEvent; - 'gridlinesChanged': CustomEvent; - 'majorAxisChanged': CustomEvent; - 'minorAxisChanged': CustomEvent; - 'referenceObjectsChanged': CustomEvent; - 'rowAxisChanged': CustomEvent; - 'rowDefaultsChanged': CustomEvent; - 'scrollPositionChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'startChanged': CustomEvent; - 'taskDataChanged': CustomEvent; - 'taskDefaultsChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'valueFormatsChanged': CustomEvent; - 'viewportEndChanged': CustomEvent; - 'viewportStartChanged': CustomEvent; - } - interface ojGanttSettableProperties extends dvtTimeComponentSettableProperties { - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - as: string; - axisPosition: 'bottom'|'top'; - dependencyData?: (oj.DataProvider); - dnd: {move?: {tasks?: 'disabled'|'enabled'}}; - end: string; - gridlines: {horizontal?: 'hidden'|'visible'|'auto', vertical?: 'hidden'|'visible'|'auto'}; - majorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; - minorAxis: {converter?: (oj.ojTimeAxis.Converter|oj.Converter), height?: number, scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years', zoomOrder?: Array}; - referenceObjects: Array; - rowAxis: {label?: {renderer: ((context: oj.ojGantt.RowAxisLabelRendererContext) => ({insert: Element}))}, maxWidth?: string, rendered?: 'on'|'off', width?: string}; - rowDefaults: {height?: number}; - scrollPosition: {offsetY?: number, rowIndex?: number, y?: number}; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - start: string; - taskData?: (oj.DataProvider); - taskDefaults: {baseline?: {borderRadius?: string, height?: number, svgClassName?: string, svgStyle?: object}, borderRadius?: string, height?: number, labelPosition?: (string|Array), progress?: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object}, svgClassName?: string, svgStyle?: object, type?: 'normal'|'milestone'|'summary'|'auto'}; - tooltip: {renderer: ((context: oj.ojGantt.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - valueFormats: {baselineDate?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineEnd?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, baselineStart?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, date?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, end?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, label?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, progress?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, row?: {tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}, start?: {converter?: (oj.Converter), tooltipDisplay?: 'off'|'auto', tooltipLabel?: string}}; - viewportEnd: string; - viewportStart: string; - translations: {accessibleDependencyInfo?: string, accessiblePredecessorInfo?: string, accessibleSuccessorInfo?: string, accessibleTaskTypeMilestone?: string, accessibleTaskTypeSummary?: string, componentName?: string, finishFinishDependencyAriaDesc?: string, finishStartDependencyAriaDesc?: string, labelAndValue?: string, labelBaselineDate?: string, labelBaselineEnd?: string, labelBaselineStart?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelDate?: string, labelEnd?: string, labelInvalidData?: string, labelLabel?: string, labelMoveBy?: string, labelNoData?: string, labelProgress?: string, labelRow?: string, labelStart?: string, startFinishDependencyAriaDesc?: string, startStartDependencyAriaDesc?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, taskMoveCancelled?: string, taskMoveFinalized?: string, taskMoveInitiated?: string, taskMoveInitiatedInstruction?: string, taskMoveSelectionInfo?: string, tooltipZoomIn?: string, tooltipZoomOut?: string}; - } - namespace ojGantt { - type Dependency = - { - id: K1, predecessorTaskId: K2, shortDesc?: string, successorTaskId: K2, svgClassName?: string, svgStyle?: object, type?: 'startStart'|'startFinish'|'finishFinish'|'finishStart' - } - } - namespace ojGantt { - type ReferenceObject = - { - svgClassName?: string, svgStyle?: object, value?: string - } - } - namespace ojGantt { - type Row = - { - id?: any, label?: string, labelStyle?: object, tasks?: Array> - } - } - namespace ojGantt { - type RowAxisLabelRendererContext = - { - parentElement: Element, rowData: oj.ojGantt.Row, itemData: Array, componentElement: Element, maxWidth: number, maxHeight: number - } - } - namespace ojGantt { - type RowTask = - { - borderRadius?: string, end?: string, height?: number, id: K2, label?: string, labelPosition?: string|Array, labelStyle?: object, start?: string, shortDesc?: string, svgClassName?: string, svgStyle?: object, type?: 'normal'|'milestone'|'summary'|'auto', progress?: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object, value?: number}, baseline?: {borderRadius?: string, end?: string, height?: number, start?: string, svgClassName?: string, svgStyle?: object} - } - } - namespace ojGantt { - type TooltipContext = - { - parentElement: Element, data: oj.ojGantt.RowTask, rowData: oj.ojGantt.Row, itemData: D2, componentElement: Element, color: string - } - } - -} -declare namespace oj { - class ojGanttDependency extends JetElement { - predecessorTaskId: any; - shortDesc: string|null; - successorTaskId: any; - svgClassName: string; - svgStyle: object; - type: 'finishStart'|'finishFinish'|'startStart'|'startFinish'; - onPredecessorTaskIdChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSuccessorTaskIdChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttDependencyEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojGanttDependencyEventMap extends oj.JetElementEventMap { - 'predecessorTaskIdChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'successorTaskIdChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'typeChanged': CustomEvent; - } - interface ojGanttDependencySettableProperties extends JetSettableProperties { - predecessorTaskId: any; - shortDesc: string|null; - successorTaskId: any; - svgClassName: string; - svgStyle: object; - type: 'finishStart'|'finishFinish'|'startStart'|'startFinish'; - } - -} -declare namespace oj { - class ojGanttRow extends JetElement { - label: string; - labelStyle: object; - onLabelChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttRowEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojGanttRowEventMap extends oj.JetElementEventMap { - 'labelChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - } - interface ojGanttRowSettableProperties extends JetSettableProperties { - label: string; - labelStyle: object; - } - -} -declare namespace oj { - class ojGanttTask extends JetElement { - baseline: {borderRadius?: string, end?: string, height?: number, start?: string, svgClassName?: string, svgStyle?: object}; - borderRadius: string; - end: string; - height: number|null; - label: string; - labelPosition: 'start'|'innerCenter'|'innerStart'|'innerEnd'|'end'|'none'; - labelStyle: object; - progress: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object, value?: number}; - rowId?: any; - shortDesc: string|null; - start: string; - svgClassName: string; - svgStyle: object; - type: 'normal'|'milestone'|'summary'|'auto'; - onBaselineChanged: (event: CustomEvent)=> any; - onBorderRadiusChanged: (event: CustomEvent)=> any; - onEndChanged: (event: CustomEvent)=> any; - onHeightChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onLabelPositionChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - onProgressChanged: (event: CustomEvent)=> any; - onRowIdChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onStartChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttTaskEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojGanttTaskEventMap extends oj.JetElementEventMap { - 'baselineChanged': CustomEvent; - 'borderRadiusChanged': CustomEvent; - 'endChanged': CustomEvent; - 'heightChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'labelPositionChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - 'progressChanged': CustomEvent; - 'rowIdChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'startChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'typeChanged': CustomEvent; - } - interface ojGanttTaskSettableProperties extends JetSettableProperties { - baseline: {borderRadius?: string, end?: string, height?: number, start?: string, svgClassName?: string, svgStyle?: object}; - borderRadius: string; - end: string; - height: number|null; - label: string; - labelPosition: 'start'|'innerCenter'|'innerStart'|'innerEnd'|'end'|'none'; - labelStyle: object; - progress: {borderRadius?: string, height?: string, svgClassName?: string, svgStyle?: object, value?: number}; - rowId?: any; - shortDesc: string|null; - start: string; - svgClassName: string; - svgStyle: object; - type: 'normal'|'milestone'|'summary'|'auto'; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojgauge/index.d.ts b/types/@oracle/oraclejet/ojs/ojgauge/index.d.ts deleted file mode 100644 index 0c3efab804..0000000000 --- a/types/@oracle/oraclejet/ojs/ojgauge/index.d.ts +++ /dev/null @@ -1,347 +0,0 @@ -/// -declare namespace oj { - abstract class dvtBaseGauge extends dvtBaseComponent { - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - - addEventListener(type: T, listener: (this: HTMLElement, ev: dvtBaseGaugeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface dvtBaseGaugeEventMap extends oj.dvtBaseComponentEventMap { - } - interface dvtBaseGaugeSettableProperties extends dvtBaseComponentSettableProperties { - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - -} -declare namespace oj { - class ojLedGauge extends dvtBaseGauge { - borderColor: string; - color: string; - label: {style?: object, text?: string}; - max: number; - metricLabel: {converter?: Converter, rendered?: 'on'|'off', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; - min: number; - rotation: 90|180|270|0; - size: number; - svgClassName: string; - svgStyle: object; - thresholds: Array; - tooltip: {renderer: ((context: oj.ojLedGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - type: 'arrow'|'diamond'|'square'|'rectangle'|'triangle'|'star'|'human'|'circle'; - value: number|null; - visualEffects: 'none'|'auto'; - onBorderColorChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMetricLabelChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onRotationChanged: (event: CustomEvent)=> any; - onSizeChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onThresholdsChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onVisualEffectsChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojLedGaugeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getMetricLabel(): string; - } - interface ojLedGaugeEventMap extends oj.dvtBaseGaugeEventMap { - 'borderColorChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'metricLabelChanged': CustomEvent; - 'minChanged': CustomEvent; - 'rotationChanged': CustomEvent; - 'sizeChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'thresholdsChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'typeChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'visualEffectsChanged': CustomEvent; - } - interface ojLedGaugeSettableProperties extends dvtBaseGaugeSettableProperties { - borderColor: string; - color: string; - label: {style?: object, text?: string}; - max: number; - metricLabel: {converter?: Converter, rendered?: 'on'|'off', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; - min: number; - rotation: 90|180|270|0; - size: number; - svgClassName: string; - svgStyle: object; - thresholds: Array; - tooltip: {renderer: ((context: oj.ojLedGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - type: 'arrow'|'diamond'|'square'|'rectangle'|'triangle'|'star'|'human'|'circle'; - value: number|null; - visualEffects: 'none'|'auto'; - } - namespace ojLedGauge { - type Threshold = - { - borderColor?: string, color?: string, max?: number, shortDesc?: string - } - } - namespace ojLedGauge { - type TooltipContext = - { - color: string, componentElement: Element, label: string, parentElement: Element - } - } - -} -declare namespace oj { - class ojRatingGauge extends dvtBaseGauge { - changed: boolean; - changedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - hoverState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - max: number; - min: number; - orientation: 'vertical'|'horizontal'; - preserveAspectRatio: 'none'|'meet'; - readonly: boolean; - selectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - step: 0.5|1; - thresholds: Array; - tooltip: {renderer: ((context: oj.ojRatingGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - readonly transientValue: number|null; - unselectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - value: number|null; - visualEffects: 'none'|'auto'; - onChangedChanged: (event: CustomEvent)=> any; - onChangedStateChanged: (event: CustomEvent)=> any; - onHoverStateChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onOrientationChanged: (event: CustomEvent)=> any; - onPreserveAspectRatioChanged: (event: CustomEvent)=> any; - onReadonlyChanged: (event: CustomEvent)=> any; - onSelectedStateChanged: (event: CustomEvent)=> any; - onStepChanged: (event: CustomEvent)=> any; - onThresholdsChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTransientValueChanged: (event: CustomEvent)=> any; - onUnselectedStateChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onVisualEffectsChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojRatingGaugeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojRatingGaugeEventMap extends oj.dvtBaseGaugeEventMap { - 'changedChanged': CustomEvent; - 'changedStateChanged': CustomEvent; - 'hoverStateChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'orientationChanged': CustomEvent; - 'preserveAspectRatioChanged': CustomEvent; - 'readonlyChanged': CustomEvent; - 'selectedStateChanged': CustomEvent; - 'stepChanged': CustomEvent; - 'thresholdsChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'transientValueChanged': CustomEvent; - 'unselectedStateChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'visualEffectsChanged': CustomEvent; - } - interface ojRatingGaugeSettableProperties extends dvtBaseGaugeSettableProperties { - changed: boolean; - changedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - hoverState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - max: number; - min: number; - orientation: 'vertical'|'horizontal'; - preserveAspectRatio: 'none'|'meet'; - readonly: boolean; - selectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - step: 0.5|1; - thresholds: Array; - tooltip: {renderer: ((context: oj.ojRatingGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - readonly transientValue: number|null; - unselectedState: {borderColor?: string, color?: string, shape?: 'circle'|'diamond'|'human'|'square'|'star'|'triangle'|string, source?: string, svgClassName?: string, svgStyle?: object}; - value: number|null; - visualEffects: 'none'|'auto'; - } - namespace ojRatingGauge { - type Threshold = - { - borderColor?: string, color?: string, max?: number, shortDesc?: string - } - } - namespace ojRatingGauge { - type TooltipContext = - { - color: string, componentElement: Element, label: string, parentElement: Element - } - } - -} -declare namespace oj { - class ojStatusMeterGauge extends dvtBaseGauge { - angleExtent: number; - animationDuration?: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - borderColor: string; - borderRadius: string; - center: {renderer: ((context: oj.ojStatusMeterGauge.CenterContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - color: string; - indicatorSize: number; - innerRadius: number; - label: {position?: 'center'|'start'|'auto', style?: object, text?: string}; - max: number; - metricLabel: {converter?: Converter, position?: 'center'|'insideIndicatorEdge'|'outsideIndicatorEdge'|'outsidePlotArea'|'withLabel'|'auto', rendered?: 'on'|'off'|'auto', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; - min: number; - orientation: 'circular'|'vertical'|'horizontal'; - plotArea: {borderColor?: string, borderRadius?: string, color?: string, rendered?: 'on'|'off'|'auto', svgClassName?: string, svgStyle?: object}; - readonly: boolean; - referenceLines: Array; - startAngle: number; - step: number|null; - svgClassName: string; - svgStyle: object; - thresholdDisplay: 'currentOnly'|'all'|'onIndicator'; - thresholds: Array; - tooltip: {renderer: ((context: oj.ojStatusMeterGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - readonly transientValue: number|null; - value: number|null; - visualEffects: 'none'|'auto'; - onAngleExtentChanged: (event: CustomEvent)=> any; - onAnimationDurationChanged: (event: CustomEvent)=> any; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onBorderColorChanged: (event: CustomEvent)=> any; - onBorderRadiusChanged: (event: CustomEvent)=> any; - onCenterChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onIndicatorSizeChanged: (event: CustomEvent)=> any; - onInnerRadiusChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMetricLabelChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onOrientationChanged: (event: CustomEvent)=> any; - onPlotAreaChanged: (event: CustomEvent)=> any; - onReadonlyChanged: (event: CustomEvent)=> any; - onReferenceLinesChanged: (event: CustomEvent)=> any; - onStartAngleChanged: (event: CustomEvent)=> any; - onStepChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onThresholdDisplayChanged: (event: CustomEvent)=> any; - onThresholdsChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTransientValueChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onVisualEffectsChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojStatusMeterGaugeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getMetricLabel(): string; - } - interface ojStatusMeterGaugeEventMap extends oj.dvtBaseGaugeEventMap { - 'angleExtentChanged': CustomEvent; - 'animationDurationChanged': CustomEvent; - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'borderColorChanged': CustomEvent; - 'borderRadiusChanged': CustomEvent; - 'centerChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'indicatorSizeChanged': CustomEvent; - 'innerRadiusChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'metricLabelChanged': CustomEvent; - 'minChanged': CustomEvent; - 'orientationChanged': CustomEvent; - 'plotAreaChanged': CustomEvent; - 'readonlyChanged': CustomEvent; - 'referenceLinesChanged': CustomEvent; - 'startAngleChanged': CustomEvent; - 'stepChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'thresholdDisplayChanged': CustomEvent; - 'thresholdsChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'transientValueChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'visualEffectsChanged': CustomEvent; - } - interface ojStatusMeterGaugeSettableProperties extends dvtBaseGaugeSettableProperties { - angleExtent: number; - animationDuration?: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - borderColor: string; - borderRadius: string; - center: {renderer: ((context: oj.ojStatusMeterGauge.CenterContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - color: string; - indicatorSize: number; - innerRadius: number; - label: {position?: 'center'|'start'|'auto', style?: object, text?: string}; - max: number; - metricLabel: {converter?: Converter, position?: 'center'|'insideIndicatorEdge'|'outsideIndicatorEdge'|'outsidePlotArea'|'withLabel'|'auto', rendered?: 'on'|'off'|'auto', scaling?: 'none'|'thousand'|'million'|'billion'|'trillion'|'quadrillion'|'auto', style?: object, text?: string, textType?: 'percent'|'number'}; - min: number; - orientation: 'circular'|'vertical'|'horizontal'; - plotArea: {borderColor?: string, borderRadius?: string, color?: string, rendered?: 'on'|'off'|'auto', svgClassName?: string, svgStyle?: object}; - readonly: boolean; - referenceLines: Array; - startAngle: number; - step: number|null; - svgClassName: string; - svgStyle: object; - thresholdDisplay: 'currentOnly'|'all'|'onIndicator'; - thresholds: Array; - tooltip: {renderer: ((context: oj.ojStatusMeterGauge.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - readonly transientValue: number|null; - value: number|null; - visualEffects: 'none'|'auto'; - } - namespace ojStatusMeterGauge { - type Bounds = - { - x: number, y: number, width: number, height: number - } - } - namespace ojStatusMeterGauge { - type CenterContext = - { - componentElement: Element, innerBounds: oj.ojStatusMeterGauge.Bounds, metricLabel: string, outerBounds: oj.ojStatusMeterGauge.Bounds - } - } - namespace ojStatusMeterGauge { - type ReferenceLine = - { - color?: string, value?: number - } - } - namespace ojStatusMeterGauge { - type Threshold = - { - borderColor?: string, color?: string, max?: number, shortDesc?: string - } - } - namespace ojStatusMeterGauge { - type TooltipContext = - { - color: string, componentElement: Element, label: string, parentElement: Element - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojindexer/index.d.ts b/types/@oracle/oraclejet/ojs/ojindexer/index.d.ts deleted file mode 100644 index 49b10e2bfa..0000000000 --- a/types/@oracle/oraclejet/ojs/ojindexer/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare namespace oj { - interface IndexerModel { - getIndexableSections(): Array|Array; - getMissingSections(): Array|Array; - setSection(section: string|object): Promise|Promise; - } - var IndexerModel: { - prototype: IndexerModel; - - SECTION_OTHERS: {id: string, label: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts b/types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts deleted file mode 100644 index ea03d4c8d3..0000000000 --- a/types/@oracle/oraclejet/ojs/ojinputnumber/index.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/// -/// -/// -declare namespace oj { - class ojInputNumber extends editableValue { - asyncValidators: Array>; - autocomplete: 'on'|'off'|string; - autofocus: boolean; - converter: oj.Converter|oj.Validation.RegisteredConverter; - max: number|null; - min: number|null; - name: string; - placeholder: string|null; - readonly rawValue: string; - readonly: boolean|null; - required: boolean; - step: number|null; - validators: Array|oj.Validation.RegisteredValidator>; - value: number|null; - virtualKeyboard: 'auto'|'number'|'text'; - translations: {numberRange?: {hint?: {exact?: string, inRange?: string, max?: string, min?: string}, messageDetail?: {exact?: string, rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipDecrement?: string, tooltipIncrement?: string}; - onAsyncValidatorsChanged: (event: CustomEvent)=> any; - onAutocompleteChanged: (event: CustomEvent)=> any; - onAutofocusChanged: (event: CustomEvent)=> any; - onConverterChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onNameChanged: (event: CustomEvent)=> any; - onPlaceholderChanged: (event: CustomEvent)=> any; - onRawValueChanged: (event: CustomEvent)=> any; - onReadonlyChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onStepChanged: (event: CustomEvent)=> any; - onValidatorsChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onVirtualKeyboardChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojInputNumber.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojInputNumber.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputNumberEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - stepDown(steps?: number): void; - stepUp(steps?: number): void; - validate(): Promise; - } - namespace ojInputNumber { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojInputNumberEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojInputNumber.ojAnimateEnd; - 'ojAnimateStart': oj.ojInputNumber.ojAnimateStart; - 'asyncValidatorsChanged': CustomEvent; - 'autocompleteChanged': CustomEvent; - 'autofocusChanged': CustomEvent; - 'converterChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'nameChanged': CustomEvent; - 'placeholderChanged': CustomEvent; - 'rawValueChanged': CustomEvent; - 'readonlyChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'stepChanged': CustomEvent; - 'validatorsChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'virtualKeyboardChanged': CustomEvent; - } - interface ojInputNumberSettableProperties extends editableValueSettableProperties { - asyncValidators: Array>; - autocomplete: 'on'|'off'|string; - autofocus: boolean; - converter: oj.Converter|oj.Validation.RegisteredConverter; - max: number|null; - min: number|null; - name: string; - placeholder: string|null; - readonly rawValue: string; - readonly: boolean|null; - required: boolean; - step: number|null; - validators: Array|oj.Validation.RegisteredValidator>; - value: number|null; - virtualKeyboard: 'auto'|'number'|'text'; - translations: {numberRange?: {hint?: {exact?: string, inRange?: string, max?: string, min?: string}, messageDetail?: {exact?: string, rangeOverflow?: string, rangeUnderflow?: string}, messageSummary?: {rangeOverflow?: string, rangeUnderflow?: string}}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, tooltipDecrement?: string, tooltipIncrement?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts b/types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts deleted file mode 100644 index 248bf14f58..0000000000 --- a/types/@oracle/oraclejet/ojs/ojinputtext/index.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -/// -/// -/// -/// -declare namespace oj { - abstract class inputBase, SV= V, RV= V> extends editableValue { - asyncValidators: Array>; - autocomplete: 'on'|'off'|string; - autofocus: boolean; - name: string; - placeholder: string; - readonly rawValue: RV; - readonly: boolean; - required: boolean; - validators: Array|oj.Validation.RegisteredValidator>|null; - translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - onAsyncValidatorsChanged: (event: CustomEvent)=> any; - onAutocompleteChanged: (event: CustomEvent)=> any; - onAutofocusChanged: (event: CustomEvent)=> any; - onNameChanged: (event: CustomEvent)=> any; - onPlaceholderChanged: (event: CustomEvent)=> any; - onRawValueChanged: (event: CustomEvent)=> any; - onReadonlyChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onValidatorsChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.inputBase.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.inputBase.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: inputBaseEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - validate(): Promise<'valid'|'invalid'>; - } - namespace inputBase { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface inputBaseEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.inputBase.ojAnimateEnd; - 'ojAnimateStart': oj.inputBase.ojAnimateStart; - 'asyncValidatorsChanged': CustomEvent; - 'autocompleteChanged': CustomEvent; - 'autofocusChanged': CustomEvent; - 'nameChanged': CustomEvent; - 'placeholderChanged': CustomEvent; - 'rawValueChanged': CustomEvent; - 'readonlyChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'validatorsChanged': CustomEvent; - } - interface inputBaseSettableProperties extends editableValueSettableProperties { - asyncValidators: Array>; - autocomplete: 'on'|'off'|string; - autofocus: boolean; - name: string; - placeholder: string; - readonly rawValue: RV; - readonly: boolean; - required: boolean; - validators: Array|oj.Validation.RegisteredValidator>|null; - translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - } - -} -declare namespace oj { - class ojInputPassword extends inputBase { - value: string|null; - translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojInputPassword.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojInputPassword.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputPasswordEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojInputPassword { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojInputPasswordEventMap extends oj.inputBaseEventMap { - 'ojAnimateEnd': oj.ojInputPassword.ojAnimateEnd; - 'ojAnimateStart': oj.ojInputPassword.ojAnimateStart; - 'valueChanged': CustomEvent; - } - interface ojInputPasswordSettableProperties extends inputBaseSettableProperties { - value: string|null; - translations: {regexp?: {messageDetail?: string, messageSummary?: string}, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - } - -} -declare namespace oj { - class ojInputText extends inputBase { - clearIcon: 'never'|'always'|'conditional'; - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - list: string; - virtualKeyboard: 'auto'|'email'|'number'|'search'|'tel'|'text'|'url'; - onClearIconChanged: (event: CustomEvent)=> any; - onConverterChanged: (event: CustomEvent)=> any; - onListChanged: (event: CustomEvent)=> any; - onVirtualKeyboardChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojInputText.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojInputText.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputTextEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojInputText { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojInputTextEventMap extends oj.inputBaseEventMap { - 'ojAnimateEnd': oj.ojInputText.ojAnimateEnd; - 'ojAnimateStart': oj.ojInputText.ojAnimateStart; - 'clearIconChanged': CustomEvent; - 'converterChanged': CustomEvent; - 'listChanged': CustomEvent; - 'virtualKeyboardChanged': CustomEvent; - } - interface ojInputTextSettableProperties extends inputBaseSettableProperties { - clearIcon: 'never'|'always'|'conditional'; - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - list: string; - virtualKeyboard: 'auto'|'email'|'number'|'search'|'tel'|'text'|'url'; - } - -} -declare namespace oj { - class ojTextArea extends inputBase { - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - rows: number; - onConverterChanged: (event: CustomEvent)=> any; - onRowsChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojTextArea.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojTextArea.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTextAreaEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojTextArea { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojTextAreaEventMap extends oj.inputBaseEventMap { - 'ojAnimateEnd': oj.ojTextArea.ojAnimateEnd; - 'ojAnimateStart': oj.ojTextArea.ojAnimateStart; - 'converterChanged': CustomEvent; - 'rowsChanged': CustomEvent; - } - interface ojTextAreaSettableProperties extends inputBaseSettableProperties { - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - rows: number; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts b/types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts deleted file mode 100644 index f6608c7f7d..0000000000 --- a/types/@oracle/oraclejet/ojs/ojkeyset/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -export class ExpandAllKeySet extends KeySet { - constructor(); - add(keys: Set|Array): ExpandAllKeySet - addAll(): ExpandAllKeySet - clear(): ExpandedKeySet - delete(keys: Set|Array): ExpandAllKeySet - deletedValues(): Set; - has(): ExpandAllKeySet - isAddAll(): boolean; - } - -export class ExpandedKeySet extends KeySet { - constructor(keys?: Set|Array); - add(keys: Set|Array): ExpandedKeySet - addAll(): ExpandAllKeySet - clear(): ExpandedKeySet - delete(keys: Set|Array): ExpandedKeySet - has(key: K): boolean; - isAddAll(): boolean; - values(): Set; - } - -export abstract class KeySet { - abstract add>(keys: Set|Array): KS - abstract addAll>(): KS - abstract clear>(): KS - abstract delete>(keys: Set|Array): KS - abstract has(key: K): boolean; - abstract isAddAll(): boolean; - } - - export as namespace KeySet; diff --git a/types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts b/types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts deleted file mode 100644 index 71d1945a6c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojknockout-keyset/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -export class ObservableExpandedKeySet { - constructor(initialValue?: KeySet.ExpandedKeySet|KeySet.ExpandAllKeySet); - add(keys: Set|Array): ObservableExpandedKeySet; - addAll(): ObservableExpandedKeySet; - clear(): ObservableExpandedKeySet; - delete(keys: Set|Array): ObservableExpandedKeySet; - } - diff --git a/types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts b/types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts deleted file mode 100644 index 21bf95f0dc..0000000000 --- a/types/@oracle/oraclejet/ojs/ojknockout-model/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -declare namespace oj { - class KnockoutUtils { - static map(m: object, callback?: ((param0: object)=> void), array?: boolean): Array>|KnockoutObservableArray; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojknockout/index.d.ts b/types/@oracle/oraclejet/ojs/ojknockout/index.d.ts deleted file mode 100644 index f388d46c92..0000000000 --- a/types/@oracle/oraclejet/ojs/ojknockout/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -declare namespace oj { - namespace KnockoutTemplateUtils { - function getRenderer(template: string, bReplaceNode?: boolean): ((param0: object)=> void); - } - -} -declare namespace oj { - class ResponsiveKnockoutUtils { - static createMediaQueryObservable(queryString: string): KnockoutObservable; - static createScreenRangeObservable(): KnockoutObservable; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojlabel/index.d.ts b/types/@oracle/oraclejet/ojs/ojlabel/index.d.ts deleted file mode 100644 index c10e0daf17..0000000000 --- a/types/@oracle/oraclejet/ojs/ojlabel/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/// -declare namespace oj { - class ojLabel extends baseComponent { - for: string|null; - help: {definition?: string|null, source?: string|null}; - labelId: string|null; - showRequired: boolean|null; - translations: {tooltipHelp?: string, tooltipRequired?: string}; - onForChanged: (event: CustomEvent)=> any; - onHelpChanged: (event: CustomEvent)=> any; - onLabelIdChanged: (event: CustomEvent)=> any; - onShowRequiredChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojLabelEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - } - interface ojLabelEventMap extends oj.baseComponentEventMap { - 'forChanged': CustomEvent; - 'helpChanged': CustomEvent; - 'labelIdChanged': CustomEvent; - 'showRequiredChanged': CustomEvent; - } - interface ojLabelSettableProperties extends baseComponentSettableProperties { - for: string|null; - help: {definition?: string|null, source?: string|null}; - labelId: string|null; - showRequired: boolean|null; - translations: {tooltipHelp?: string, tooltipRequired?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts b/types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts deleted file mode 100644 index c1649bedd7..0000000000 --- a/types/@oracle/oraclejet/ojs/ojlabelvalue/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -declare namespace oj { - class ojLabelValue extends JetElement { - labelEdge: 'start'|'top'|'inherit'; - labelWidth: string; - onLabelEdgeChanged: (event: CustomEvent)=> any; - onLabelWidthChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojLabelValueEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - refresh(): void; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojLabelValueEventMap extends oj.JetElementEventMap { - 'labelEdgeChanged': CustomEvent; - 'labelWidthChanged': CustomEvent; - } - interface ojLabelValueSettableProperties extends JetSettableProperties { - labelEdge: 'start'|'top'|'inherit'; - labelWidth: string; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojlegend/index.d.ts b/types/@oracle/oraclejet/ojs/ojlegend/index.d.ts deleted file mode 100644 index 36f940f25c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojlegend/index.d.ts +++ /dev/null @@ -1,230 +0,0 @@ -/// -/// -declare namespace oj { - class ojLegend extends dvtBaseComponent> { - as: string; - data: oj.DataProvider|null; - drilling: 'on'|'off'; - expanded: KeySet.KeySet|null; - halign: 'center'|'end'|'start'; - hiddenCategories: Array; - hideAndShowBehavior: 'on'|'off'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - orientation: 'horizontal'|'vertical'; - scrolling: 'off'|'asNeeded'; - symbolHeight: number; - symbolWidth: number; - textStyle?: object; - valign: 'middle'|'bottom'|'top'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onAsChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onExpandedChanged: (event: CustomEvent)=> any; - onHalignChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHideAndShowBehaviorChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; - onOrientationChanged: (event: CustomEvent)=> any; - onScrollingChanged: (event: CustomEvent)=> any; - onSymbolHeightChanged: (event: CustomEvent)=> any; - onSymbolWidthChanged: (event: CustomEvent)=> any; - onTextStyleChanged: (event: CustomEvent)=> any; - onValignChanged: (event: CustomEvent)=> any; - onOjDrill: (event: oj.ojLegend.ojDrill)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojLegend.NodeContext|null; - getItem(subIdPath: Array): oj.ojLegend.ItemContext|null; - getPreferredSize(): oj.ojLegend.PreferredSize|null; - getSection(subIdPath: Array): oj.ojLegend.SectionContext|null; - } - namespace ojLegend { - class ojDrill extends CustomEvent<{id: any, [propName: string]: any}> { - - } - } - interface ojLegendEventMap extends oj.dvtBaseComponentEventMap { - 'ojDrill': oj.ojLegend.ojDrill; - 'asChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'expandedChanged': CustomEvent; - 'halignChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'hideAndShowBehaviorChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'hoverBehaviorDelayChanged': CustomEvent; - 'orientationChanged': CustomEvent; - 'scrollingChanged': CustomEvent; - 'symbolHeightChanged': CustomEvent; - 'symbolWidthChanged': CustomEvent; - 'textStyleChanged': CustomEvent; - 'valignChanged': CustomEvent; - } - interface ojLegendSettableProperties extends dvtBaseComponentSettableProperties { - as: string; - data: oj.DataProvider|null; - drilling: 'on'|'off'; - expanded: KeySet.KeySet|null; - halign: 'center'|'end'|'start'; - hiddenCategories: Array; - hideAndShowBehavior: 'on'|'off'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - orientation: 'horizontal'|'vertical'; - scrolling: 'off'|'asNeeded'; - symbolHeight: number; - symbolWidth: number; - textStyle?: object; - valign: 'middle'|'bottom'|'top'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - namespace ojLegend { - type ItemContext = - { - text: string - } - } - namespace ojLegend { - type NodeContext = - { - itemIndex: number, sectionIndexPath: Array, subId: string - } - } - namespace ojLegend { - type PreferredSize = - { - width: number, height: number - } - } - namespace ojLegend { - type SectionContext = - { - title: string, sections: Array, items: Array, getSection: {title: string, sections: string, items: boolean}, getItems: {text: string} - } - } - -} -declare namespace oj { - class ojLegendItem extends JetElement { - borderColor?: string; - categories?: Array; - categoryVisibility?: 'hidden'|'visible'; - color?: string; - drilling?: 'on'|'off'|'inherit'; - lineStyle?: 'dotted'|'dashed'|'solid'; - lineWidth?: number; - markerColor?: string; - markerShape: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; - markerSvgClassName?: string; - markerSvgStyle?: object; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; - shortDesc?: string; - source?: string; - svgClassName?: string; - svgStyle?: object; - symbolType?: 'line'|'lineWithMarker'|'image'|'marker'; - text: string; - onBorderColorChanged: (event: CustomEvent)=> any; - onCategoriesChanged: (event: CustomEvent)=> any; - onCategoryVisibilityChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onLineStyleChanged: (event: CustomEvent)=> any; - onLineWidthChanged: (event: CustomEvent)=> any; - onMarkerColorChanged: (event: CustomEvent)=> any; - onMarkerShapeChanged: (event: CustomEvent)=> any; - onMarkerSvgClassNameChanged: (event: CustomEvent)=> any; - onMarkerSvgStyleChanged: (event: CustomEvent)=> any; - onPatternChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSourceChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onSymbolTypeChanged: (event: CustomEvent)=> any; - onTextChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendItemEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojLegendItemEventMap extends oj.JetElementEventMap { - 'borderColorChanged': CustomEvent; - 'categoriesChanged': CustomEvent; - 'categoryVisibilityChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'lineStyleChanged': CustomEvent; - 'lineWidthChanged': CustomEvent; - 'markerColorChanged': CustomEvent; - 'markerShapeChanged': CustomEvent; - 'markerSvgClassNameChanged': CustomEvent; - 'markerSvgStyleChanged': CustomEvent; - 'patternChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'sourceChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'symbolTypeChanged': CustomEvent; - 'textChanged': CustomEvent; - } - interface ojLegendItemSettableProperties extends JetSettableProperties { - borderColor?: string; - categories?: Array; - categoryVisibility?: 'hidden'|'visible'; - color?: string; - drilling?: 'on'|'off'|'inherit'; - lineStyle?: 'dotted'|'dashed'|'solid'; - lineWidth?: number; - markerColor?: string; - markerShape: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; - markerSvgClassName?: string; - markerSvgStyle?: object; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; - shortDesc?: string; - source?: string; - svgClassName?: string; - svgStyle?: object; - symbolType?: 'line'|'lineWithMarker'|'image'|'marker'; - text: string; - } - -} -declare namespace oj { - class ojLegendSection extends JetElement { - collapsible?: 'on'|'off'; - text?: string; - textHalign?: 'center'|'end'|'start'; - textStyle?: object; - onCollapsibleChanged: (event: CustomEvent)=> any; - onTextChanged: (event: CustomEvent)=> any; - onTextHalignChanged: (event: CustomEvent)=> any; - onTextStyleChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendSectionEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojLegendSectionEventMap extends oj.JetElementEventMap { - 'collapsibleChanged': CustomEvent; - 'textChanged': CustomEvent; - 'textHalignChanged': CustomEvent; - 'textStyleChanged': CustomEvent; - } - interface ojLegendSectionSettableProperties extends JetSettableProperties { - collapsible?: 'on'|'off'; - text?: string; - textHalign?: 'center'|'end'|'start'; - textStyle?: object; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts b/types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts deleted file mode 100644 index ed2b3d981f..0000000000 --- a/types/@oracle/oraclejet/ojs/ojlistdataproviderview/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// -declare namespace oj { - class ListDataProviderView implements DataProvider { - dataMapping: DataMapping; - from: any; - offset: number; - sortCriteria: SortCriterion[]; - constructor(dataProvider: DataProvider, options?: {from?: object, offset?: number, sortCriteria?: SortCriterion[], dataMapping?: DataMapping}); - addEventListener(eventType: string, listener: EventListener): void - containsKeys(params: FetchByKeysParameters): Promise> - dispatchEvent(evt: Event): boolean - fetchByKeys(params: FetchByKeysParameters): Promise> - fetchByOffset(params: FetchByOffsetParameters): Promise> - fetchFirst>(params?: FetchListParameters): AsyncIterable - getCapability(capabilityName: string) - getTotalSize(): Promise; - isEmpty(): 'yes'|'no'|'unknown'; - removeEventListener(eventType: string, listener: EventListener): void - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojlistview/index.d.ts b/types/@oracle/oraclejet/ojs/ojlistview/index.d.ts deleted file mode 100644 index cb4289b6ea..0000000000 --- a/types/@oracle/oraclejet/ojs/ojlistview/index.d.ts +++ /dev/null @@ -1,167 +0,0 @@ -/// -/// -/// -declare namespace oj { - class ojListView extends baseComponent> { - as: string; - currentItem: K; - data: oj.DataProvider; - dnd: {drag?: {items: {dataTypes?: string|Array, drag?: ((param0: Event)=> void), dragEnd?: ((param0: Event)=> void), dragStart?: ((param0: Event, param1: {items:Array})=> void)}}, drop?: {items: {dataTypes?: string|Array, dragEnter?: ((param0: Event, param1: {item:Element})=> void), dragLeave?: ((param0: Event, param1: {item:Element})=> void), dragOver?: ((param0: Event, param1: {item:Element})=> void), drop?: ((param0: Event, param1: oj.ojListView.ItemsDropContext)=> void)}}, reorder: {items: 'enabled'|'disabled'}}; - drillMode: 'collapsible'|'none'; - expanded: KeySet.KeySet; - readonly firstSelectedItem: {key: K, data: D}; - groupHeaderPosition: 'static'|'sticky'; - item: {focusable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean, renderer?: ((param0: oj.ojListView.ItemContext) => {insert: Element|string}|undefined)|null, selectable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean}; - scrollPolicy: 'auto'|'loadMoreOnScroll'; - scrollPolicyOptions: {fetchSize?: number, maxCount?: number, scroller?: Element}; - scrollPosition: {x?: number, y?: number, index?: number, parent?: K, key?: K, offsetX?: number, offsetY?: number}; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - selectionRequired: boolean; - translations: {accessibleNavigateSkipItems?: string, accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderInsideItem?: string, accessibleReorderTouchInstructionText?: string, indexerCharacters?: string, labelCopy?: string, labelCut?: string, labelPaste?: string, labelPasteAfter?: string, labelPasteBefore?: string, msgFetchingData?: string, msgNoData?: string}; - onAsChanged: (event: CustomEvent)=> any; - onCurrentItemChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDndChanged: (event: CustomEvent)=> any; - onDrillModeChanged: (event: CustomEvent)=> any; - onExpandedChanged: (event: CustomEvent)=> any; - onFirstSelectedItemChanged: (event: CustomEvent)=> any; - onGroupHeaderPositionChanged: (event: CustomEvent)=> any; - onItemChanged: (event: CustomEvent)=> any; - onScrollPolicyChanged: (event: CustomEvent)=> any; - onScrollPolicyOptionsChanged: (event: CustomEvent)=> any; - onScrollPositionChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onSelectionRequiredChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojListView.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojListView.ojAnimateStart)=> any; - onOjBeforeCollapse: (event: oj.ojListView.ojBeforeCollapse)=> any; - onOjBeforeCurrentItem: (event: oj.ojListView.ojBeforeCurrentItem)=> any; - onOjBeforeExpand: (event: oj.ojListView.ojBeforeExpand)=> any; - onOjCollapse: (event: oj.ojListView.ojCollapse)=> any; - onOjCopy: (event: oj.ojListView.ojCopy)=> any; - onOjCut: (event: oj.ojListView.ojCut)=> any; - onOjExpand: (event: oj.ojListView.ojExpand)=> any; - onOjPaste: (event: oj.ojListView.ojPaste)=> any; - onOjReorder: (event: oj.ojListView.ojReorder)=> any; - - addEventListener>(type: T, listener: (this: HTMLElement, ev: ojListViewEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojListView.ContextByNode|null; - getDataForVisibleItem(context: {key?: K, index?: number, parent?: Element}): D; - refresh(): void; - scrollToItem(item: {key: K}): void; - } - namespace ojListView { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeCollapse extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { - - } - - class ojBeforeCurrentItem extends CustomEvent<{previousKey: K, previousItem: Element, key: K, item: Element, [propName: string]: any}> { - - } - - class ojBeforeExpand extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { - - } - - class ojCollapse extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { - - } - - class ojCopy extends CustomEvent<{items: Array, [propName: string]: any}> { - - } - - class ojCut extends CustomEvent<{items: Array, [propName: string]: any}> { - - } - - class ojExpand extends CustomEvent<{key: K, item: Element, [propName: string]: any}> { - - } - - class ojPaste extends CustomEvent<{item: Element, [propName: string]: any}> { - - } - - class ojReorder extends CustomEvent<{items: Array, position: string, reference: Element, [propName: string]: any}> { - - } - } - interface ojListViewEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.ojListView.ojAnimateEnd; - 'ojAnimateStart': oj.ojListView.ojAnimateStart; - 'ojBeforeCollapse': oj.ojListView.ojBeforeCollapse; - 'ojBeforeCurrentItem': oj.ojListView.ojBeforeCurrentItem; - 'ojBeforeExpand': oj.ojListView.ojBeforeExpand; - 'ojCollapse': oj.ojListView.ojCollapse; - 'ojCopy': oj.ojListView.ojCopy; - 'ojCut': oj.ojListView.ojCut; - 'ojExpand': oj.ojListView.ojExpand; - 'ojPaste': oj.ojListView.ojPaste; - 'ojReorder': oj.ojListView.ojReorder; - 'asChanged': CustomEvent; - 'currentItemChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'dndChanged': CustomEvent; - 'drillModeChanged': CustomEvent; - 'expandedChanged': CustomEvent; - 'firstSelectedItemChanged': CustomEvent; - 'groupHeaderPositionChanged': CustomEvent; - 'itemChanged': CustomEvent; - 'scrollPolicyChanged': CustomEvent; - 'scrollPolicyOptionsChanged': CustomEvent; - 'scrollPositionChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'selectionRequiredChanged': CustomEvent; - } - interface ojListViewSettableProperties extends baseComponentSettableProperties { - as: string; - currentItem: K; - data: oj.DataProvider; - dnd: {drag?: {items: {dataTypes?: string|Array, drag?: ((param0: Event)=> void), dragEnd?: ((param0: Event)=> void), dragStart?: ((param0: Event, param1: {items:Array})=> void)}}, drop?: {items: {dataTypes?: string|Array, dragEnter?: ((param0: Event, param1: {item:Element})=> void), dragLeave?: ((param0: Event, param1: {item:Element})=> void), dragOver?: ((param0: Event, param1: {item:Element})=> void), drop?: ((param0: Event, param1: oj.ojListView.ItemsDropContext)=> void)}}, reorder: {items: 'enabled'|'disabled'}}; - drillMode: 'collapsible'|'none'; - expanded: KeySet.KeySet; - readonly firstSelectedItem: {key: K, data: D}; - groupHeaderPosition: 'static'|'sticky'; - item: {focusable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean, renderer?: ((param0: oj.ojListView.ItemContext) => {insert: Element|string}|undefined)|null, selectable?: ((param0: oj.ojListView.ItemContext) => boolean)|boolean}; - scrollPolicy: 'auto'|'loadMoreOnScroll'; - scrollPolicyOptions: {fetchSize?: number, maxCount?: number, scroller?: Element}; - scrollPosition: {x?: number, y?: number, index?: number, parent?: K, key?: K, offsetX?: number, offsetY?: number}; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - selectionRequired: boolean; - translations: {accessibleNavigateSkipItems?: string, accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderInsideItem?: string, accessibleReorderTouchInstructionText?: string, indexerCharacters?: string, labelCopy?: string, labelCut?: string, labelPaste?: string, labelPasteAfter?: string, labelPasteBefore?: string, msgFetchingData?: string, msgNoData?: string}; - } - namespace ojListView { - type ContextByNode = - { - subId: string, key: K, index: number, parent?: Element, group?: boolean - } - } - namespace ojListView { - type ItemContext = - { - datasource: oj.DataProvider, index: number, key: K, data: D, parentElement: Element, depth?: number, parentKey?: K, leaf?: boolean - } - } - namespace ojListView { - type ItemsDropContext = - { - item: Element, position: 'before'|'after'|'inside', reorder: boolean - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts b/types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts deleted file mode 100644 index f355ffc77b..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmasonrylayout/index.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/// -declare namespace oj { - class ojMasonryLayout extends baseComponent { - reorderHandle: string|null; - translations: {labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string}; - onReorderHandleChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojMasonryLayout.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojMasonryLayout.ojAnimateStart)=> any; - onOjBeforeInsert: (event: oj.ojMasonryLayout.ojBeforeInsert)=> any; - onOjBeforeRemove: (event: oj.ojMasonryLayout.ojBeforeRemove)=> any; - onOjBeforeReorder: (event: oj.ojMasonryLayout.ojBeforeReorder)=> any; - onOjBeforeResize: (event: oj.ojMasonryLayout.ojBeforeResize)=> any; - onOjInsert: (event: oj.ojMasonryLayout.ojInsert)=> any; - onOjRemove: (event: oj.ojMasonryLayout.ojRemove)=> any; - onOjReorder: (event: oj.ojMasonryLayout.ojReorder)=> any; - onOjResize: (event: oj.ojMasonryLayout.ojResize)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojMasonryLayoutEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - insertTile(selector: string, index: number): void; - refresh(): void; - removeTile(selector: string): void; - resizeTile(selector: string, sizeStyleClass: string): void; - } - namespace ojMasonryLayout { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeInsert extends CustomEvent<{tile: Element, index: number, [propName: string]: any}> { - - } - - class ojBeforeRemove extends CustomEvent<{tile: Element, [propName: string]: any}> { - - } - - class ojBeforeReorder extends CustomEvent<{tile: Element, fromIndex: number, [propName: string]: any}> { - - } - - class ojBeforeResize extends CustomEvent<{tile: Element, previousSizeStyleClass: string, sizeStyleClass: string, [propName: string]: any}> { - - } - - class ojInsert extends CustomEvent<{tile: Element, index: number, [propName: string]: any}> { - - } - - class ojRemove extends CustomEvent<{tile: Element, [propName: string]: any}> { - - } - - class ojReorder extends CustomEvent<{tile: Element, fromIndex: number, toIndex: number, [propName: string]: any}> { - - } - - class ojResize extends CustomEvent<{tile: Element, previousSizeStyleClass: string, sizeStyleClass: string, [propName: string]: any}> { - - } - } - interface ojMasonryLayoutEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.ojMasonryLayout.ojAnimateEnd; - 'ojAnimateStart': oj.ojMasonryLayout.ojAnimateStart; - 'ojBeforeInsert': oj.ojMasonryLayout.ojBeforeInsert; - 'ojBeforeRemove': oj.ojMasonryLayout.ojBeforeRemove; - 'ojBeforeReorder': oj.ojMasonryLayout.ojBeforeReorder; - 'ojBeforeResize': oj.ojMasonryLayout.ojBeforeResize; - 'ojInsert': oj.ojMasonryLayout.ojInsert; - 'ojRemove': oj.ojMasonryLayout.ojRemove; - 'ojReorder': oj.ojMasonryLayout.ojReorder; - 'ojResize': oj.ojMasonryLayout.ojResize; - 'reorderHandleChanged': CustomEvent; - } - interface ojMasonryLayoutSettableProperties extends baseComponentSettableProperties { - reorderHandle: string|null; - translations: {labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmenu/index.d.ts b/types/@oracle/oraclejet/ojs/ojmenu/index.d.ts deleted file mode 100644 index cd2c08461c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmenu/index.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -/// -declare namespace oj { - class ojMenu extends baseComponent { - disabled: boolean; - openOptions: oj.ojMenu.OpenOptions; - translations: {ariaFocusSkipLink?: string, labelCancel?: string}; - onDisabledChanged: (event: CustomEvent)=> any; - onOpenOptionsChanged: (event: CustomEvent)=> any; - onOjAction: (event: oj.ojMenu.ojAction)=> any; - onOjAnimateEnd: (event: oj.ojMenu.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojMenu.ojAnimateStart)=> any; - onOjBeforeOpen: (event: oj.ojMenu.ojBeforeOpen)=> any; - onOjClose: (event: oj.ojMenu.ojClose)=> any; - onOjOpen: (event: oj.ojMenu.ojOpen)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - open(event?: object, openOptions?: oj.ojMenu.OpenOptions): void; - refresh(): void; - } - namespace ojMenu { - class ojAction extends CustomEvent<{ [propName: string]: any}> { - - } - - class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: 'open'|'close', element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeOpen extends CustomEvent<{ [propName: string]: any}> { - - } - - class ojClose extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - - class ojOpen extends CustomEvent<{event: Event, [propName: string]: any}> { - - } - } - interface ojMenuEventMap extends oj.baseComponentEventMap { - 'ojAction': oj.ojMenu.ojAction; - 'ojAnimateEnd': oj.ojMenu.ojAnimateEnd; - 'ojAnimateStart': oj.ojMenu.ojAnimateStart; - 'ojBeforeOpen': oj.ojMenu.ojBeforeOpen; - 'ojClose': oj.ojMenu.ojClose; - 'ojOpen': oj.ojMenu.ojOpen; - 'disabledChanged': CustomEvent; - 'openOptionsChanged': CustomEvent; - } - interface ojMenuSettableProperties extends baseComponentSettableProperties { - disabled: boolean; - openOptions: oj.ojMenu.OpenOptions; - translations: {ariaFocusSkipLink?: string, labelCancel?: string}; - } - namespace ojMenu { - type OpenOptions = - { - display?: string, initialFocus?: string, launcher?: string|Element, position?: oj.ojMenu.Position - } - } - namespace ojMenu { - type Position = - { - my?: oj.ojMenu.PositionAlign, at?: oj.ojMenu.PositionAlign, offset?: oj.ojMenu.PositionPoint, of?: string|oj.ojMenu.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'flipcenter'|'none' - } - } - namespace ojMenu { - type PositionAlign = - { - vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' - } - } - namespace ojMenu { - type PositionPoint = - { - x?: number, y?: number - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts b/types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts deleted file mode 100644 index 0f380df2f2..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmenuselectmany/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// -declare namespace oj { - class ojMenuSelectMany extends JetElement { - disabled: boolean; - options: Array|oj.DataProvider|null; - value: Array; - onDisabledChanged: (event: CustomEvent)=> any; - onOptionsChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuSelectManyEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojMenuSelectManyEventMap extends oj.JetElementEventMap { - 'disabledChanged': CustomEvent; - 'optionsChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojMenuSelectManySettableProperties extends JetSettableProperties { - disabled: boolean; - options: Array|oj.DataProvider|null; - value: Array; - } - namespace ojMenuSelectMany { - type Option = - { - id?: string, disabled?: boolean, label: string, value: any - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmessage/index.d.ts b/types/@oracle/oraclejet/ojs/ojmessage/index.d.ts deleted file mode 100644 index 8be478bd06..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmessage/index.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -declare namespace oj { - class ojMessage extends JetElement { - message: oj.ojMessage.Message; - translations: {categories?: {confirmation?: string, error?: string, info?: string, warning?: string}, labelCloseIcon?: string}; - onMessageChanged: (event: CustomEvent)=> any; - - onTranslationsChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojMessage.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojMessage.ojAnimateStart)=> any; - onOjClose: (event: oj.ojMessage.ojClose)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojMessageEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - close(): void; - getProperty(property: string): any; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - namespace ojMessage { - class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{element: Element, action: 'open'|'close', endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojClose extends CustomEvent<{message: object, [propName: string]: any}> { - - } - } - interface ojMessageEventMap extends oj.JetElementEventMap { - 'ojAnimateEnd': oj.ojMessage.ojAnimateEnd; - 'ojAnimateStart': oj.ojMessage.ojAnimateStart; - 'ojClose': oj.ojMessage.ojClose; - 'messageChanged': CustomEvent; - 'translationsChanged': CustomEvent; - } - interface ojMessageSettableProperties extends JetSettableProperties { - message: oj.ojMessage.Message; - translations: {categories?: {confirmation?: string, error?: string, info?: string, warning?: string}, labelCloseIcon?: string}; - } - namespace ojMessage { - type Message = - { - icon?: string, category?: string, severity?: 'error'|'warning'|'confirmation'|'info'|'none', timestamp?: string, summary?: string, detail?: string, autoTimeout?: number, closeAffordance?: 'none'|'defaults', sound?: string - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmessages/index.d.ts b/types/@oracle/oraclejet/ojs/ojmessages/index.d.ts deleted file mode 100644 index 3246de390f..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmessages/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/// -/// -declare namespace oj { - class ojMessages extends JetElement { - display: 'general'|'notification'; - messages: Array | null | oj.DataProvider; - position: oj.ojMessages.Position|null; - translations: {ariaLiveRegion?: {navigationFromKeyboard?: string, navigationToKeyboard?: string, navigationToTouch?: string, newMessage?: string}, labelLandmark?: string}; - onDisplayChanged: (event: CustomEvent)=> any; - onMessagesChanged: (event: CustomEvent)=> any; - onPositionChanged: (event: CustomEvent)=> any; - - onTranslationsChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojMessagesEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - close(associated: object): void; - closeAll(closeFilter?: (message: oj.ojMessage.Message) => boolean): void; - getProperty(property: string): any; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojMessagesEventMap extends oj.JetElementEventMap { - 'displayChanged': CustomEvent; - 'messagesChanged': CustomEvent; - 'positionChanged': CustomEvent; - 'translationsChanged': CustomEvent; - } - interface ojMessagesSettableProperties extends JetSettableProperties { - display: 'general'|'notification'; - messages: Array | null | oj.DataProvider; - position: oj.ojMessages.Position|null; - translations: {ariaLiveRegion?: {navigationFromKeyboard?: string, navigationToKeyboard?: string, navigationToTouch?: string, newMessage?: string}, labelLandmark?: string}; - } - namespace ojMessages { - type Position = - { - my?: oj.ojMessages.PositionAlign, at?: oj.ojMessages.PositionAlign, offset?: oj.ojMessages.PositionPoint, of?: string|oj.ojMessages.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'none' - } - } - namespace ojMessages { - type PositionAlign = - { - vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' - } - } - namespace ojMessages { - type PositionPoint = - { - x?: number, y?: number - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts b/types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts deleted file mode 100644 index e65a3ddcc3..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmessaging/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -declare namespace oj { - class Message { - detail: string; - severity: string|number; - summary: string; - constructor(summary: string, detail: string, severity?: number|string); - static getMaxSeverity(messages?: Array): number; - static getSeverityLevel(severity?: string|number|undefined): number; - static getSeverityType(level?: string|number|undefined): string; - static isValid(messages: Array): boolean; - } - namespace Message { - enum SEVERITY_LEVEL { - FATAL = "5", - ERROR = "4", - WARNING = "3", - INFO = "2", - CONFIRMATION = "1", - } - enum SEVERITY_TYPE { - CONFIRMATION = "confirmation", - INFO = "info", - WARNING = "warning", - ERROR = "error", - FATAL = "fatal", - } - } - - -} diff --git a/types/@oracle/oraclejet/ojs/ojmodel/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodel/index.d.ts deleted file mode 100644 index 6e3ebe4118..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmodel/index.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -declare namespace oj { - class Collection { - changes: Array; - comparator: null|string|((param0: oj.Model, param1?: oj.Model)=> number); - customPagingOptions: ((response: object)=> oj.Collection.CustomPagingOptionsReturn|null)|null; - customURL: ((param0: string, param1: oj.Collection, param2: object)=> string|Object|null)|null; - fetchSize: number; - hasMore: boolean; - lastFetchCount: number; - lastFetchSize: number; - length: number; - model: object; - modelLimit: number; - models: Array; - offset: number; - omitLanguageHeader: boolean; - parse: ((param0: object)=> Object); - sortDirection: number; - totalResults: number; - url: null|string|(()=> string); - constructor(models?: Array, options?: object); - static extend(properties?: {parse?: (data: any)=> any, model?: oj.Model, url?: string, initialize?: (models: Array, options: Object)=> void, comparator?: null|string|((model1: oj.Model, model2?: oj.Model)=> number), fetchSize?: number, modelLimit?: number, [propName: string]: any}, classProperties?: object): any; - abort(): Promise; - add(m: oj.Model|object|Array|Array, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): Promise>|Array; - any(iterator: ((param0: object)=> void), context?: object): boolean; - at(index: number, options?: {fetchSize?: number, deferred?: boolean, [propName: string]: any}): oj.Model|Promise|null; - clone(): oj.Collection; - contains(model: object, options?: object): boolean|Promise; - create(attributes?: object, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): oj.Model|boolean|Promise; - difference(...var_args: (Array)[]): Array; - each(iterator: ((param0: oj.Model)=> void), context?: object): undefined; - fetch(options?: {success?: (collection: oj.Collection, response: Object, options: Object)=> void, error?: (collection: oj.Collection, xhr: Object, options: Object)=> void, add?: boolean, set?: boolean, startIndex?: number, startID?: Object, since?: Object, until?: Object, fetchSize?: number, [propName: string]: any}): object; - filter(iterator: ((param0: oj.Model)=> void), context?: object): Array; - findWhere(attrs: object|Array, options?: {deferred?: boolean, [propName: string]: any}): oj.Model|Promise; - first(n?: number, options?: object): Array|null|Promise; - get(id: object|string, options?: object): oj.Model|null|Promise; - getByCid(clientId: string): oj.Model|null; - groupBy(iterator: string|((param0: oj.Model)=> object), context?: object): object; - include(model: object, options?: object): boolean|Promise; - indexBy(iterator: string|((param0: oj.Model)=> void), context?: object): object; - indexOf(model: object, options?: object): number|Promise; - initial(n?: number): Array; - isEmpty(): boolean; - isRangeLocal(start: number, count: number): boolean; - last(n?: number, options?: object): Promise|Array|null; - lastIndexOf(model: oj.Model, fromIndex?: number): number; - listenTo(otherObj: object, eventType: string, callback: Function): undefined; - listenToOnce(otherObj: object, eventType: string, callback: Function): undefined; - map(iterator: ((param0: oj.Model)=> object), context?: object): Array; - max(iterator: ((param0: oj.Model)=> object), context?: object): object; - min(iterator: ((param0: object)=> void), context?: object): object; - modelId(attrs: object): null|string; - next(n: number, options?: {success?: (collection: oj.Collection, response: Object, options: Object)=> void, error?: (collection: oj.Collection, xhr: Object, options: Object)=> void, [propName: string]: any}): object|null; - off(eventType?: string|object, callback?: Function, context?: object): undefined; - on(eventType: string|object, callback: Function, context?: object): undefined; - once(eventType: string, callback: Function, context?: object): undefined; - pluck(attr: string): Array; - pop(options?: {silent?: boolean, deferred?: boolean, [propName: string]: any}): oj.Model|Promise; - previous(n: number, options?: {success?: (collection: oj.Collection, response: Object, options: Object)=> void, error?: (collection: oj.Collection, xhr: Object, options: Object)=> void, [propName: string]: any}): object; - push(m: oj.Model|object, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): Promise>|undefined; - refresh(options?: {silent?: boolean, startIndex?: number, [propName: string]: any}): Promise; - remove(m: oj.Model|Array, options?: object): Array|object; - reset(data?: object, options?: {silent?: boolean, [propName: string]: any}): oj.Model|Array; - rest(n?: number, options?: object): Array|Promise; - set(models: object, options?: {add?: boolean, remove?: boolean, merge?: boolean, silent?: boolean, deferred?: boolean, [propName: string]: any}): Promise|null; - setFetchSize(n: number): undefined; - setModelLimit(n: number): undefined; - setRangeLocal(start: number, count: number): Promise; - shift(options?: object): oj.Model|Promise|null; - size(): number; - slice(start: number, end?: number, options?: object): Promise>|Array; - sort(options?: {silent?: boolean, startIndex?: number, [propName: string]: any}): Promise|null; - sortBy(iterator: string|((param0: oj.Model)=> object), context?: object): Array; - sortedIndex(comparator: string|((param0: oj.Model, param1?: oj.Model)=> object)): number; - stopListening(otherObj?: object, eventType?: string, callback?: Function): undefined; - sync(method: string, collection: oj.Collection, options?: {success?: (json?: Array)=> void, error?: (xhr: Object, status: Object, error: Object)=> void, [propName: string]: any}): object; - toJSON(): Array; - trigger(eventType: string): undefined; - unshift(m: object, options?: {silent?: boolean, at?: number, merge?: boolean, sort?: boolean, force?: boolean, deferred?: boolean, [propName: string]: any}): Promise>|Array; - whenReady(): Promise; - where(attrs: object|Array, options?: object): Promise>|Array; - whereToCollection(attrs: object|Array, options?: object): oj.Collection|Promise; - without(...var_args: (oj.Model)[]): Array; - } - namespace Collection { - type CustomPagingOptionsReturn = - { - totalResults?: number, limit?: number, count?: number, offset?: number, hasMore?: boolean - } - } - namespace Collection { - type SetRangeLocalPromise = - { - start: number, count: number, models: Array - } - } - -} -declare namespace oj { - class Model { - attributes: object; - customURL: ((param0: string, param1: oj.Model, param2: object)=> string|Object|null)|null; - defaults: object; - id: string|null; - idAttribute: string|null; - omitLanguageHeader: boolean; - parse: ((param0: object)=> Object); - parseSave: ((param0: object)=> Object); - urlRoot: string|null; - validate: ((param0: object, param1: Object)=> string|Object|null)|null; - validationError: string|object|null; - constructor(attributes?: object, options?: object); - static extend(properties?: {parse?: (data: any)=> any, parseSave?: (data: any)=> any, urlRoot?: string, initialize?: (models: Array, options: Object)=> void, validate?: null|object|string|((attributes: Object, options?: oj.Model)=> number), [propName: string]: any}, classProperties?: object): any; - changedAttributes(attributes?: object): object|boolean; - clear(options?: object): oj.Model|boolean; - clone(): oj.Model; - destroy(options?: {success?: (model: oj.Model, response: Object, options: Object)=> void, error?: (model: oj.Model, xhr: Object, options: Object)=> void, wait?: boolean, [propName: string]: any}): boolean; - fetch(options?: {success?: (model: oj.Model, response: Object, options: Object)=> void, error?: (model: oj.Model, xhr: Object, options: Object)=> void, [propName: string]: any}): object; - get(property: string): object; - has(property: string): boolean; - hasChanged(attribute?: string): boolean; - invert(): object; - isNew(): boolean; - isValid(): boolean; - keys(): Array; - listenTo(otherObj: object, eventType: string, callback: Function): undefined; - listenToOnce(otherObj: object, eventType: string, callback: Function): undefined; - matches(attrs: object): ((param0: oj.Model)=> boolean); - off(eventType?: string|object, callback?: Function, context?: object): undefined; - omit(keys: Array|object): object; - on(eventType: string|object, callback: Function, context?: object): undefined; - once(eventType: string, callback: Function, context?: object): undefined; - pairs(): object; - pick(keys: Array|object): object; - previous(attr: string): object; - previousAttributes(): object; - save(attributes?: object, options?: {success?: (model: oj.Model, response: Object, options: Object)=> void, error?: (model: oj.Model, xhr: Object, options: Object)=> void, contentType?: string, valdiate?: boolean, wait?: boolean, patch?: boolean, attrs?: Object, [propName: string]: any}): object|boolean; - set(property: string|object, value?: object, options?: object): oj.Model|boolean; - stopListening(otherObj?: object, eventType?: string, callback?: Function): undefined; - sync(method: string, model: oj.Model, options?: object): object; - toJSON(): object; - trigger(eventType: string): undefined; - unset(property: string, options?: object): boolean; - url(): string|null; - values(): Array; - } - -} -declare namespace oj { - class OAuth { - constructor(attributes: object, header: string); - cleanAccessTokenRequest(): undefined; - cleanAccessTokenResponse(): undefined; - clientCredentialGrant(): undefined; - getAccessTokenRequest(): object; - getAccessTokenResponse(): object; - getHeader(): object; - isInitialized(): boolean; - setAccessTokenRequest(data: object): undefined; - setAccessTokenResponse(data: object): undefined; - } - -} -declare namespace oj { - class URLError { - constructor(); - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts deleted file mode 100644 index f2b9b3db7c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmodule-element-utils/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class ModuleElementUtils { - } - diff --git a/types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts deleted file mode 100644 index 5129c36e5a..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmodule-element/index.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -declare namespace oj { - interface ModuleElementAnimation { - animate(context: {node: Node, isInitial: boolean, oldViewModel: object, newViewModel: object, newViewParent: Node, oldViewParent: Node, removeOldView: Function, insertNewView: Function, oldDomNodes: Array}): Promise; - canAnimate(context: {node: Node, isInitial: boolean, oldViewModel: object, newViewModel: object}): boolean; - prepareAnimation(context: {node: Node, isInitial: boolean, oldViewModel: object, newViewModel: object}): object; - } - -} -declare namespace oj { - class ojModule { - animation: object; - config: {cleanupMode: 'onDisconnect'|'none', view: Array, viewModel: object}; - onAnimationChanged: (event: CustomEvent)=> any; - onConfigChanged: (event: CustomEvent)=> any; - onOjTransitionEnd: (event: oj.ojModule.ojTransitionEnd)=> any; - onOjTransitionStart: (event: oj.ojModule.ojTransitionStart)=> any; - onOjViewConnected: (event: oj.ojModule.ojViewConnected)=> any; - onOjViewDisconnected: (event: oj.ojModule.ojViewDisconnected)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojModuleEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojModule { - class ojTransitionEnd extends CustomEvent<{viewModel: object, [propName: string]: any}> { - - } - - class ojTransitionStart extends CustomEvent<{viewModel: object, [propName: string]: any}> { - - } - - class ojViewConnected extends CustomEvent<{viewModel: object, [propName: string]: any}> { - - } - - class ojViewDisconnected extends CustomEvent<{viewModel: object, view: Array, [propName: string]: any}> { - - } - } - interface ojModuleEventMap extends oj.JetElementEventMap { - 'ojTransitionEnd': oj.ojModule.ojTransitionEnd; - 'ojTransitionStart': oj.ojModule.ojTransitionStart; - 'ojViewConnected': oj.ojModule.ojViewConnected; - 'ojViewDisconnected': oj.ojModule.ojViewDisconnected; - 'animationChanged': CustomEvent; - 'configChanged': CustomEvent; - } - interface ojModuleSettableProperties extends JetSettableProperties { - animation: object; - config: {cleanupMode: 'onDisconnect'|'none', view: Array, viewModel: object}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojmodule/index.d.ts b/types/@oracle/oraclejet/ojs/ojmodule/index.d.ts deleted file mode 100644 index 3cf1b7ee7e..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmodule/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// -declare namespace oj { - namespace ModuleBinding { - var defaults: {viewPath: string, viewSuffix: string, modelPath: string, initializeMethod: string, disposeMethod: string, activatedHandler: string, attachedHandler: string, detachedHandler: string, bindingsAppliedHandler: string, deactivatedHandler: string, transitionCompletedHandler: string}; - } - -} -declare namespace oj.ModuleBinding { - interface ConventionMethods { - dispose(info: {element: Node, valueAccessor: Function}): void; - handleActivated(info: {element: Node, valueAccessor: Function}): Promise|undefined; - handleAttached(info: {element: Node, valueAccessor: Function, fromCache: boolean}): void; - handleBindingsApplied(info: {element: Node, valueAccessor: Function}): void; - handleDeactivated(info: {element: Node, valueAccessor: Function}): void; - handleDetached(info: {element: Node, valueAccessor: Function, cachedNodes: Array}): void; - handleTransitionCompleted(info: {element: Node, valueAccessor: Function}): void; - initialize(info: {element: Node, valueAccessor: Function}): object|undefined; - } - -} -declare namespace ojModule { - var Options: {view: Promise|string|Array|DocumentFragment, viewModel: Promise|Function|object, name: string, viewName: string, require: Function|{instance: any, viewPath: string, modelPath: string}, viewModelFactory: object, params: object, createViewFunction: string, cacheKey: string, lifecycleListener: object, animation: object}; - } - diff --git a/types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts b/types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts deleted file mode 100644 index 6d0592dbea..0000000000 --- a/types/@oracle/oraclejet/ojs/ojmoduleanimations/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -declare namespace oj { - namespace ModuleAnimations { - var coverStart: oj.ModuleElementAnimation; - var coverUp: oj.ModuleElementAnimation; - var fade: oj.ModuleElementAnimation; - var navChild: oj.ModuleElementAnimation; - var navParent: oj.ModuleElementAnimation; - var navSiblingEarlier: oj.ModuleElementAnimation; - var navSiblingLater: oj.ModuleElementAnimation; - var pushEnd: oj.ModuleElementAnimation; - var pushStart: oj.ModuleElementAnimation; - var revealDown: oj.ModuleElementAnimation; - var revealEnd: oj.ModuleElementAnimation; - var zoomIn: oj.ModuleElementAnimation; - var zoomOut: oj.ModuleElementAnimation; - function createAnimation(oldViewEffect: {effect: oj.AnimationUtils.AnimationMethods, [key:string]: any}|oj.AnimationUtils.AnimationMethods|null, newViewEffect: {effect: oj.AnimationUtils.AnimationMethods, [key:string]: any}|oj.AnimationUtils.AnimationMethods|null, newViewOnTop: boolean): oj.ModuleElementAnimation; - function switcher(callback: (param0: oj.ModuleAnimations.SwitcherCallBackParam) => oj.ModuleAnimations.Animations): oj.ModuleElementAnimation; - } - namespace ModuleAnimations { - type Animations = 'coverStart'|'coverUp'|'fade'|'navChild'|'navParent'|'navSiblingEarlier'|'navSiblingLater'|'pushEnd'|'pushStart'|'revealDown'|'revealEnd'|'zoomIn'|'zoomOut'; - } - namespace ModuleAnimations { - type SwitcherCallBackParam = - { - node: Element, valueAccessor: (()=> any), isInitial: boolean, oldViewModel: any, newViewModel: any - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts b/types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts deleted file mode 100644 index 9d1c348467..0000000000 --- a/types/@oracle/oraclejet/ojs/ojnavigationlist/index.d.ts +++ /dev/null @@ -1,253 +0,0 @@ -/// -/// -/// -declare namespace oj { - class ojNavigationList extends baseComponent> { - as: string; - currentItem: K; - data: oj.DataProvider|null; - display: 'all'|'icons'; - drillMode: 'none'|'collapsible'|'sliding'; - edge: 'top'|'start'; - expanded: KeySet.KeySet; - hierarchyMenuThreshold: number; - item: {renderer?: (((context: oj.ojNavigationList.ItemContext) => void)|null), selectable?: (((context: oj.ojNavigationList.ItemContext) => boolean)|boolean)}; - overflow: 'popup'|'hidden'; - rootLabel: string|null; - selection: K; - translations: {defaultRootLabel?: string, hierMenuBtnLabel?: string, previousIcon?: string}; - onAsChanged: (event: CustomEvent)=> any; - onCurrentItemChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDisplayChanged: (event: CustomEvent)=> any; - onDrillModeChanged: (event: CustomEvent)=> any; - onEdgeChanged: (event: CustomEvent)=> any; - onExpandedChanged: (event: CustomEvent)=> any; - onHierarchyMenuThresholdChanged: (event: CustomEvent)=> any; - onItemChanged: (event: CustomEvent)=> any; - onOverflowChanged: (event: CustomEvent)=> any; - onRootLabelChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojNavigationList.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojNavigationList.ojAnimateStart)=> any; - onOjBeforeCollapse: (event: oj.ojNavigationList.ojBeforeCollapse)=> any; - onOjBeforeCurrentItem: (event: oj.ojNavigationList.ojBeforeCurrentItem)=> any; - onOjBeforeExpand: (event: oj.ojNavigationList.ojBeforeExpand)=> any; - onOjBeforeSelect: (event: oj.ojNavigationList.ojBeforeSelect)=> any; - onOjCollapse: (event: oj.ojNavigationList.ojCollapse)=> any; - onOjExpand: (event: oj.ojNavigationList.ojExpand)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojNavigationListEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojNavigationList.NodeContext|null; - refresh(): void; - } - namespace ojNavigationList { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeCollapse extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { - - } - - class ojBeforeCurrentItem extends CustomEvent<{previousKey: any, previousItem: Element, key: any, item: Element, [propName: string]: any}> { - - } - - class ojBeforeExpand extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { - - } - - class ojBeforeSelect extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { - - } - - class ojCollapse extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { - - } - - class ojExpand extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { - - } - } - interface ojNavigationListEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.ojNavigationList.ojAnimateEnd; - 'ojAnimateStart': oj.ojNavigationList.ojAnimateStart; - 'ojBeforeCollapse': oj.ojNavigationList.ojBeforeCollapse; - 'ojBeforeCurrentItem': oj.ojNavigationList.ojBeforeCurrentItem; - 'ojBeforeExpand': oj.ojNavigationList.ojBeforeExpand; - 'ojBeforeSelect': oj.ojNavigationList.ojBeforeSelect; - 'ojCollapse': oj.ojNavigationList.ojCollapse; - 'ojExpand': oj.ojNavigationList.ojExpand; - 'asChanged': CustomEvent; - 'currentItemChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'displayChanged': CustomEvent; - 'drillModeChanged': CustomEvent; - 'edgeChanged': CustomEvent; - 'expandedChanged': CustomEvent; - 'hierarchyMenuThresholdChanged': CustomEvent; - 'itemChanged': CustomEvent; - 'overflowChanged': CustomEvent; - 'rootLabelChanged': CustomEvent; - 'selectionChanged': CustomEvent; - } - interface ojNavigationListSettableProperties extends baseComponentSettableProperties { - as: string; - currentItem: K; - data: oj.DataProvider|null; - display: 'all'|'icons'; - drillMode: 'none'|'collapsible'|'sliding'; - edge: 'top'|'start'; - expanded: KeySet.KeySet; - hierarchyMenuThreshold: number; - item: {renderer?: (((context: oj.ojNavigationList.ItemContext) => void)|null), selectable?: (((context: oj.ojNavigationList.ItemContext) => boolean)|boolean)}; - overflow: 'popup'|'hidden'; - rootLabel: string|null; - selection: K; - translations: {defaultRootLabel?: string, hierMenuBtnLabel?: string, previousIcon?: string}; - } - namespace ojNavigationList { - type ItemContext = - { - componentElement: Element, datasource?: oj.DataProvider, index: number, key: any, data: any, parentElement: Element - } - } - namespace ojNavigationList { - type NodeContext = - { - subId: string, index: number, key: K, group: boolean, parent?: Element - } - } - -} -declare namespace oj { - class ojTabBar extends baseComponent> { - as: string; - currentItem: any; - data: oj.DataProvider|null; - display: 'all'|'icons'; - edge: 'top'|'bottom'|'start'|'end'; - item: {renderer?: (((context: oj.ojTabBar.ItemContext) => void)|null), selectable?: (((context: oj.ojTabBar.ItemContext) => boolean)|boolean)}; - overflow: 'popup'|'hidden'; - reorderable: 'enabled'|'disabled'; - selection: any; - truncation: 'none'|'progressive'; - translations: {accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderTouchInstructionText?: string, labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string, labelRemove?: string, msgFetchingData?: string, msgNoData?: string, overflowItemLabel?: string, removeCueText?: string, selectedLabel?: string}; - onAsChanged: (event: CustomEvent)=> any; - onCurrentItemChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDisplayChanged: (event: CustomEvent)=> any; - onEdgeChanged: (event: CustomEvent)=> any; - onItemChanged: (event: CustomEvent)=> any; - onOverflowChanged: (event: CustomEvent)=> any; - onReorderableChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onTruncationChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojTabBar.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojTabBar.ojAnimateStart)=> any; - onOjBeforeCurrentItem: (event: oj.ojTabBar.ojBeforeCurrentItem)=> any; - onOjBeforeDeselect: (event: oj.ojTabBar.ojBeforeDeselect)=> any; - onOjBeforeRemove: (event: oj.ojTabBar.ojBeforeRemove)=> any; - onOjBeforeSelect: (event: oj.ojTabBar.ojBeforeSelect)=> any; - onOjDeselect: (event: oj.ojTabBar.ojDeselect)=> any; - onOjRemove: (event: oj.ojTabBar.ojRemove)=> any; - onOjReorder: (event: oj.ojTabBar.ojReorder)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTabBarEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojTabBar.NodeContext|null; - refresh(): void; - } - namespace ojTabBar { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeCurrentItem extends CustomEvent<{previousKey: any, previousItem: Element, key: any, item: Element, [propName: string]: any}> { - - } - - class ojBeforeDeselect extends CustomEvent<{fromKey: any, fromItem: Element, toKey: any, toItem: Element, [propName: string]: any}> { - - } - - class ojBeforeRemove extends CustomEvent<{item: Element, key: any, [propName: string]: any}> { - - } - - class ojBeforeSelect extends CustomEvent<{key: any, item: Element, [propName: string]: any}> { - - } - - class ojDeselect extends CustomEvent<{fromKey: any, fromItem: Element, toKey: any, toItem: Element, [propName: string]: any}> { - - } - - class ojRemove extends CustomEvent<{item: Element, key: any, [propName: string]: any}> { - - } - - class ojReorder extends CustomEvent<{item: Element, position: 'before'|'after', reference: Element, [propName: string]: any}> { - - } - } - interface ojTabBarEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.ojTabBar.ojAnimateEnd; - 'ojAnimateStart': oj.ojTabBar.ojAnimateStart; - 'ojBeforeCurrentItem': oj.ojTabBar.ojBeforeCurrentItem; - 'ojBeforeDeselect': oj.ojTabBar.ojBeforeDeselect; - 'ojBeforeRemove': oj.ojTabBar.ojBeforeRemove; - 'ojBeforeSelect': oj.ojTabBar.ojBeforeSelect; - 'ojDeselect': oj.ojTabBar.ojDeselect; - 'ojRemove': oj.ojTabBar.ojRemove; - 'ojReorder': oj.ojTabBar.ojReorder; - 'asChanged': CustomEvent; - 'currentItemChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'displayChanged': CustomEvent; - 'edgeChanged': CustomEvent; - 'itemChanged': CustomEvent; - 'overflowChanged': CustomEvent; - 'reorderableChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'truncationChanged': CustomEvent; - } - interface ojTabBarSettableProperties extends baseComponentSettableProperties { - as: string; - currentItem: any; - data: oj.DataProvider|null; - display: 'all'|'icons'; - edge: 'top'|'bottom'|'start'|'end'; - item: {renderer?: (((context: oj.ojTabBar.ItemContext) => void)|null), selectable?: (((context: oj.ojTabBar.ItemContext) => boolean)|boolean)}; - overflow: 'popup'|'hidden'; - reorderable: 'enabled'|'disabled'; - selection: any; - truncation: 'none'|'progressive'; - translations: {accessibleReorderAfterItem?: string, accessibleReorderBeforeItem?: string, accessibleReorderTouchInstructionText?: string, labelCut?: string, labelPasteAfter?: string, labelPasteBefore?: string, labelRemove?: string, msgFetchingData?: string, msgNoData?: string, overflowItemLabel?: string, removeCueText?: string, selectedLabel?: string}; - } - namespace ojTabBar { - type ItemContext = - { - componentElement: Element, datasource?: oj.DataProvider, index: number, key: K, data: D, parentElement: Element - } - } - namespace ojTabBar { - type NodeContext = - { - subId: string, index: number, key: K - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojnbox/index.d.ts b/types/@oracle/oraclejet/ojs/ojnbox/index.d.ts deleted file mode 100644 index 454774c4bc..0000000000 --- a/types/@oracle/oraclejet/ojs/ojnbox/index.d.ts +++ /dev/null @@ -1,251 +0,0 @@ -/// -/// -declare namespace oj { - class ojNBox extends dvtBaseComponent> { - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - as: string; - cellContent: 'counts'|'auto'; - cellMaximize: 'off'|'on'; - cells: Promise>|null; - columns: Promise>|null; - columnsTitle: string; - countLabel: ((context: oj.ojNBox.CountLabelContext) => (string|null)); - data: oj.DataProvider|null; - groupAttributes: 'color'|'indicatorColor'|'indicatorIconColor'|'indicatorIconPattern'|'indicatorIconShape'; - groupBehavior: 'acrossCells'|'none'|'withinCell'; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - labelTruncation: 'ifRequired'|'on'; - maximizedColumn: string; - maximizedRow: string; - otherColor: string; - otherThreshold: number; - rows: Promise>|null; - rowsTitle: string; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - styleDefaults: {animationDuration: number, cellDefaults: {labelHalign: 'center'|'end'|'start', labelStyle: object, maximizedSvgStyle: object, minimizedSvgStyle: object, showCount: 'on'|'off'|'auto', svgStyle: object}, columnLabelStyle: object, columnsTitleStyle: object, hoverBehaviorDelay: number, nodeDefaults: {borderColor: string, borderWidth: number, color: string, iconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, indicatorColor: string, indicatorIconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, labelStyle: object, secondaryLabelStyle: object}, rowLabelStyle: object, rowsTitleStyle: object}; - tooltip: {renderer: ((context: oj.ojNBox.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, highlightedCount?: string, labelAdditionalData?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelGroup?: string, labelInvalidData?: string, labelNoData?: string, labelOther?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onCellContentChanged: (event: CustomEvent)=> any; - onCellMaximizeChanged: (event: CustomEvent)=> any; - onCellsChanged: (event: CustomEvent)=> any; - onColumnsChanged: (event: CustomEvent)=> any; - onColumnsTitleChanged: (event: CustomEvent)=> any; - onCountLabelChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onGroupAttributesChanged: (event: CustomEvent)=> any; - onGroupBehaviorChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHighlightMatchChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onLabelTruncationChanged: (event: CustomEvent)=> any; - onMaximizedColumnChanged: (event: CustomEvent)=> any; - onMaximizedRowChanged: (event: CustomEvent)=> any; - onOtherColorChanged: (event: CustomEvent)=> any; - onOtherThresholdChanged: (event: CustomEvent)=> any; - onRowsChanged: (event: CustomEvent)=> any; - onRowsTitleChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onStyleDefaultsChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTouchResponseChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojNBoxEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getCell(rowValue: string, columnValue: string): object|null; - getColumn(columnValue: string): object|null; - getColumnCount(): number; - getColumnsTitle(): string; - getContextByNode(node: Element): object|null; - getDialog(): object|null; - getGroupBehavior(): string; - getGroupNode(groupCategory: string): object|null; - getRow(rowValue: string): object|null; - getRowCount(): number; - getRowsTitle(): string; - } - interface ojNBoxEventMap extends oj.dvtBaseComponentEventMap { - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'asChanged': CustomEvent; - 'cellContentChanged': CustomEvent; - 'cellMaximizeChanged': CustomEvent; - 'cellsChanged': CustomEvent; - 'columnsChanged': CustomEvent; - 'columnsTitleChanged': CustomEvent; - 'countLabelChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'groupAttributesChanged': CustomEvent; - 'groupBehaviorChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'highlightMatchChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'labelTruncationChanged': CustomEvent; - 'maximizedColumnChanged': CustomEvent; - 'maximizedRowChanged': CustomEvent; - 'otherColorChanged': CustomEvent; - 'otherThresholdChanged': CustomEvent; - 'rowsChanged': CustomEvent; - 'rowsTitleChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'styleDefaultsChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'touchResponseChanged': CustomEvent; - } - interface ojNBoxSettableProperties extends dvtBaseComponentSettableProperties { - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - as: string; - cellContent: 'counts'|'auto'; - cellMaximize: 'off'|'on'; - cells: Array|Promise>|null; - columns: Array|Promise>|null; - columnsTitle: string; - countLabel: ((context: oj.ojNBox.CountLabelContext) => (string|null)); - data: oj.DataProvider|null; - groupAttributes: 'color'|'indicatorColor'|'indicatorIconColor'|'indicatorIconPattern'|'indicatorIconShape'; - groupBehavior: 'acrossCells'|'none'|'withinCell'; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - labelTruncation: 'ifRequired'|'on'; - maximizedColumn: string; - maximizedRow: string; - otherColor: string; - otherThreshold: number; - rows: Array|Promise>|null; - rowsTitle: string; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - styleDefaults: {animationDuration: number, cellDefaults: {labelHalign: 'center'|'end'|'start', labelStyle: object, maximizedSvgStyle: object, minimizedSvgStyle: object, showCount: 'on'|'off'|'auto', svgStyle: object}, columnLabelStyle: object, columnsTitleStyle: object, hoverBehaviorDelay: number, nodeDefaults: {borderColor: string, borderWidth: number, color: string, iconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, indicatorColor: string, indicatorIconDefaults: {borderColor: string, borderRadius: string, borderWidth: number, color: string, height: number, opacity: number, pattern: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none', shape: 'circle'|'ellipse'|'square'|'plus'|'diamond'|'triangleUp'|'triangleDown'|'human'|'rectangle'|'star', source: string, width: number}, labelStyle: object, secondaryLabelStyle: object}, rowLabelStyle: object, rowsTitleStyle: object}; - tooltip: {renderer: ((context: oj.ojNBox.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, highlightedCount?: string, labelAdditionalData?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelGroup?: string, labelInvalidData?: string, labelNoData?: string, labelOther?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - namespace ojNBox { - type Cell = - { - label?: string, column: string, labelHalign?: string, labelStyle?: object, svgClassName?: string, svgStyle?: object, maximizedSvgStyle?: object, maximizedSvgClassName?: string, minimizedSvgStyle?: object, minimizedSvgClassName?: string, row: string, showCount?: 'on'|'off'|'auto'|string, shortDesc?: string - } - } - namespace ojNBox { - type Column = - { - id: string, label?: string, labelStyle?: object - } - } - namespace ojNBox { - type CountLabelContext = - { - row: string, column: string, nodeCount: number, totalNodeCount: number, highlightedNodeCount: number - } - } - namespace ojNBox { - type Row = - { - id: string, label?: string, labelStyle?: object - } - } - namespace ojNBox { - type TooltipContext = - { - parentElement: Element, id: K, label: string, secondaryLabel: string, row: string, column: string, color: string, indicatorColor: string, componentElement: Element - } - } - -} -declare namespace oj { - class ojNBoxNode extends JetElement { - borderColor: string; - borderWidth: number; - categories: Array; - color?: string; - column: string; - groupCategory?: string; - icon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'mallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string, svgClassName: string, svgStyle?: object, width?: number|null}; - indicatorColor?: string; - indicatorIcon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string|null, svgClassName: string, svgStyle?: object|null, width?: number|null}; - label: string; - row: string; - secondaryLabel: string; - shortDesc: string; - svgClassName: string; - svgStyle: object|null; - xPercentage?: number|null; - yPercentage?: number|null; - onBorderColorChanged: (event: CustomEvent)=> any; - onBorderWidthChanged: (event: CustomEvent)=> any; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onColumnChanged: (event: CustomEvent)=> any; - onGroupCategoryChanged: (event: CustomEvent)=> any; - onIconChanged: (event: CustomEvent)=> any; - onIndicatorColorChanged: (event: CustomEvent)=> any; - onIndicatorIconChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onRowChanged: (event: CustomEvent)=> any; - onSecondaryLabelChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onXPercentageChanged: (event: CustomEvent)=> any; - onYPercentageChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojNBoxNodeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojNBoxNodeEventMap extends oj.JetElementEventMap { - 'borderColorChanged': CustomEvent; - 'borderWidthChanged': CustomEvent; - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'columnChanged': CustomEvent; - 'groupCategoryChanged': CustomEvent; - 'iconChanged': CustomEvent; - 'indicatorColorChanged': CustomEvent; - 'indicatorIconChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'rowChanged': CustomEvent; - 'secondaryLabelChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'xPercentageChanged': CustomEvent; - 'yPercentageChanged': CustomEvent; - } - interface ojNBoxNodeSettableProperties extends JetSettableProperties { - borderColor: string; - borderWidth: number; - categories: Array; - color?: string; - column: string; - groupCategory?: string; - icon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'mallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string, svgClassName: string, svgStyle?: object, width?: number|null}; - indicatorColor?: string; - indicatorIcon?: {borderColor?: string, borderRadius?: string, borderWidth: number, color?: string, height?: number|null, opacity: number, pattern?: 'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'|'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle', shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, source?: string|null, svgClassName: string, svgStyle?: object|null, width?: number|null}; - label: string; - row: string; - secondaryLabel: string; - shortDesc: string; - svgClassName: string; - svgStyle: object|null; - xPercentage?: number|null; - yPercentage?: number|null; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts b/types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts deleted file mode 100644 index eab2775d88..0000000000 --- a/types/@oracle/oraclejet/ojs/ojoffcanvas/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare namespace oj { - class OffcanvasUtils { - constructor(); - static close(offcanvas: {selector: string}): Promise; - static open(offcanvas: {selector: string, content: string, edge: string, displayMode: string, autoDismiss: string, size: string, modality: string}): Promise; - static setupPanToReveal(offcanvas: {selector: string, edge?: string, size?: string}): void; - static setupResponsive(offcanvas: {selector: string, edge: string, query: string}): void; - static tearDownPanToReveal(offcanvas: {selector: string}): void; - static tearDownResponsive(offcanvas: {selector: string}): void; - static toggle(offcanvas: {selector: string, content: string, edge: string, displayMode: string, autoDismiss: string, size: string, modality: string}): Promise; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts b/types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts deleted file mode 100644 index 335cee2990..0000000000 --- a/types/@oracle/oraclejet/ojs/ojoptgroup/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -declare namespace oj { - class ojOptgroup extends JetElement { - disabled: boolean; - label: string; - onDisabledChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojOptgroupEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - refresh(): void; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojOptgroupEventMap extends oj.JetElementEventMap { - 'disabledChanged': CustomEvent; - 'labelChanged': CustomEvent; - } - interface ojOptgroupSettableProperties extends JetSettableProperties { - disabled: boolean; - label: string; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojoption/index.d.ts b/types/@oracle/oraclejet/ojs/ojoption/index.d.ts deleted file mode 100644 index 012cb7a4cc..0000000000 --- a/types/@oracle/oraclejet/ojs/ojoption/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -declare namespace oj { - class ojOption extends JetElement { - disabled: boolean; - value: any; - onDisabledChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojOptionEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - refresh(): void; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojOptionEventMap extends oj.JetElementEventMap { - 'disabledChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojOptionSettableProperties extends JetSettableProperties { - disabled: boolean; - value: any; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts b/types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts deleted file mode 100644 index ec1496377f..0000000000 --- a/types/@oracle/oraclejet/ojs/ojpictochart/index.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -/// -/// -declare namespace oj { - class ojPictoChart extends dvtBaseComponent> { - animationDuration?: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'popIn'|'alphaFade'|'zoom'|'none'; - as: string; - columnCount: number|null; - columnWidth: number|null; - data: oj.DataProvider|null; - drilling: 'on'|'off'; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - layout: 'vertical'|'horizontal'; - layoutOrigin: 'topEnd'|'bottomStart'|'bottomEnd'|'topStart'; - rowCount: number|null; - rowHeight: number|null; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - tooltip: {renderer: ((context: oj.ojPictoChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onAnimationDurationChanged: (event: CustomEvent)=> any; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onColumnCountChanged: (event: CustomEvent)=> any; - onColumnWidthChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHighlightMatchChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; - onLayoutChanged: (event: CustomEvent)=> any; - onLayoutOriginChanged: (event: CustomEvent)=> any; - onRowCountChanged: (event: CustomEvent)=> any; - onRowHeightChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onOjDrill: (event: oj.ojPictoChart.ojDrill)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojPictoChartEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojPictoChart.NodeContext|null; - getItem(index: number): oj.ojPictoChart.ItemContext|null; - getItemCount(): number; - } - namespace ojPictoChart { - class ojDrill extends CustomEvent<{id: any, [propName: string]: any}> { - - } - } - interface ojPictoChartEventMap extends oj.dvtBaseComponentEventMap { - 'ojDrill': oj.ojPictoChart.ojDrill; - 'animationDurationChanged': CustomEvent; - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'asChanged': CustomEvent; - 'columnCountChanged': CustomEvent; - 'columnWidthChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'highlightMatchChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'hoverBehaviorDelayChanged': CustomEvent; - 'layoutChanged': CustomEvent; - 'layoutOriginChanged': CustomEvent; - 'rowCountChanged': CustomEvent; - 'rowHeightChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - } - interface ojPictoChartSettableProperties extends dvtBaseComponentSettableProperties { - animationDuration?: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'popIn'|'alphaFade'|'zoom'|'none'; - as: string; - columnCount: number|null; - columnWidth: number|null; - data: oj.DataProvider|null; - drilling: 'on'|'off'; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - layout: 'vertical'|'horizontal'; - layoutOrigin: 'topEnd'|'bottomStart'|'bottomEnd'|'topStart'; - rowCount: number|null; - rowHeight: number|null; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - tooltip: {renderer: ((context: oj.ojPictoChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null}; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - namespace ojPictoChart { - type ItemContext = - { - color: string, count: number, id: K, name: string, selected: boolean, tooltip: string - } - } - namespace ojPictoChart { - type NodeContext = - { - subId: string, index: number - } - } - namespace ojPictoChart { - type TooltipContext = - { - parentElement: Element, id: K, name: string, count: number, color: string, componentElement: Element - } - } - -} -declare namespace oj { - class ojPictoChartItem extends JetElement { - borderColor: string; - borderWidth: number; - categories: Array; - color: string; - columnSpan: number; - count: number; - drilling: 'inherit'|'off'|'on'; - name: string; - rowSpan: number; - shape: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|'none'; - shortDesc: string; - source: string; - sourceHover: string; - sourceHoverSelected: string; - sourceSelected: string; - svgClassName: string; - svgStyle: object; - onBorderColorChanged: (event: CustomEvent)=> any; - onBorderWidthChanged: (event: CustomEvent)=> any; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onColumnSpanChanged: (event: CustomEvent)=> any; - onCountChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onNameChanged: (event: CustomEvent)=> any; - onRowSpanChanged: (event: CustomEvent)=> any; - onShapeChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSourceChanged: (event: CustomEvent)=> any; - onSourceHoverChanged: (event: CustomEvent)=> any; - onSourceHoverSelectedChanged: (event: CustomEvent)=> any; - onSourceSelectedChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojPictoChartItemEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojPictoChartItemEventMap extends oj.JetElementEventMap { - 'borderColorChanged': CustomEvent; - 'borderWidthChanged': CustomEvent; - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'columnSpanChanged': CustomEvent; - 'countChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'nameChanged': CustomEvent; - 'rowSpanChanged': CustomEvent; - 'shapeChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'sourceChanged': CustomEvent; - 'sourceHoverChanged': CustomEvent; - 'sourceHoverSelectedChanged': CustomEvent; - 'sourceSelectedChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - } - interface ojPictoChartItemSettableProperties extends JetSettableProperties { - borderColor: string; - borderWidth: number; - categories: Array; - color: string; - columnSpan: number; - count: number; - drilling: 'inherit'|'off'|'on'; - name: string; - rowSpan: number; - shape: 'circle'|'diamond'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|'none'; - shortDesc: string; - source: string; - sourceHover: string; - sourceHoverSelected: string; - sourceSelected: string; - svgClassName: string; - svgStyle: object; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojpopup/index.d.ts b/types/@oracle/oraclejet/ojs/ojpopup/index.d.ts deleted file mode 100644 index c0b076be88..0000000000 --- a/types/@oracle/oraclejet/ojs/ojpopup/index.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -/// -declare namespace oj { - class ojPopup extends baseComponent { - autoDismiss: 'none'|'focusLoss'; - chrome: 'default'|'none'; - initialFocus: 'auto'|'none'|'firstFocusable'|'popup'; - modality: 'modeless'|'modal'; - position: oj.ojPopup.Position; - tail: 'none'|'simple'; - translations: {ariaCloseSkipLink?: string, ariaFocusSkipLink?: string, ariaLiveRegionInitialFocusFirstFocusable?: string, ariaLiveRegionInitialFocusFirstFocusableTouch?: string, ariaLiveRegionInitialFocusNone?: string, ariaLiveRegionInitialFocusNoneTouch?: string}; - onAutoDismissChanged: (event: CustomEvent)=> any; - onChromeChanged: (event: CustomEvent)=> any; - onInitialFocusChanged: (event: CustomEvent)=> any; - onModalityChanged: (event: CustomEvent)=> any; - onPositionChanged: (event: CustomEvent)=> any; - onTailChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojPopup.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojPopup.ojAnimateStart)=> any; - onOjBeforeClose: (event: oj.ojPopup.ojBeforeClose)=> any; - onOjBeforeOpen: (event: oj.ojPopup.ojBeforeOpen)=> any; - onOjClose: (event: oj.ojPopup.ojClose)=> any; - onOjFocus: (event: oj.ojPopup.ojFocus)=> any; - onOjOpen: (event: oj.ojPopup.ojOpen)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojPopupEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - close(): void; - isOpen(): boolean; - open(launcher: string|Element, position?: oj.ojPopup.Position): void; - refresh(): void; - } - namespace ojPopup { - class ojAnimateEnd extends CustomEvent<{element: Element, action: 'open'|'close', [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: 'open'|'close', element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeClose extends CustomEvent<{ [propName: string]: any}> { - - } - - class ojBeforeOpen extends CustomEvent<{ [propName: string]: any}> { - - } - - class ojClose extends CustomEvent<{ [propName: string]: any}> { - - } - - class ojFocus extends CustomEvent<{ [propName: string]: any}> { - - } - - class ojOpen extends CustomEvent<{ [propName: string]: any}> { - - } - } - interface ojPopupEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.ojPopup.ojAnimateEnd; - 'ojAnimateStart': oj.ojPopup.ojAnimateStart; - 'ojBeforeClose': oj.ojPopup.ojBeforeClose; - 'ojBeforeOpen': oj.ojPopup.ojBeforeOpen; - 'ojClose': oj.ojPopup.ojClose; - 'ojFocus': oj.ojPopup.ojFocus; - 'ojOpen': oj.ojPopup.ojOpen; - 'autoDismissChanged': CustomEvent; - 'chromeChanged': CustomEvent; - 'initialFocusChanged': CustomEvent; - 'modalityChanged': CustomEvent; - 'positionChanged': CustomEvent; - 'tailChanged': CustomEvent; - } - interface ojPopupSettableProperties extends baseComponentSettableProperties { - autoDismiss: 'none'|'focusLoss'; - chrome: 'default'|'none'; - initialFocus: 'auto'|'none'|'firstFocusable'|'popup'; - modality: 'modeless'|'modal'; - position: oj.ojPopup.Position; - tail: 'none'|'simple'; - translations: {ariaCloseSkipLink?: string, ariaFocusSkipLink?: string, ariaLiveRegionInitialFocusFirstFocusable?: string, ariaLiveRegionInitialFocusFirstFocusableTouch?: string, ariaLiveRegionInitialFocusNone?: string, ariaLiveRegionInitialFocusNoneTouch?: string}; - } - namespace ojPopup { - type Position = - { - my?: oj.ojPopup.PositionAlign, at?: oj.ojPopup.PositionAlign, offset?: oj.ojPopup.PositionPoint, of?: string|oj.ojPopup.PositionPoint, collision?: 'flip'|'fit'|'flipfit'|'flipcenter'|'none' - } - } - namespace ojPopup { - type PositionAlign = - { - vertical?: 'top'|'bottom'|'center', horizontal?: 'start'|'end'|'left'|'center'|'bottom' - } - } - namespace ojPopup { - type PositionPoint = - { - x?: number, y?: number - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojprogress/index.d.ts b/types/@oracle/oraclejet/ojs/ojprogress/index.d.ts deleted file mode 100644 index 66fec85056..0000000000 --- a/types/@oracle/oraclejet/ojs/ojprogress/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// -declare namespace oj { - class ojProgress extends baseComponent { - max: number; - type: 'bar'|'circle'; - value: number; - translations: {ariaIndeterminateProgressText?: string}; - onMaxChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojProgressEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojProgressEventMap extends oj.baseComponentEventMap { - 'maxChanged': CustomEvent; - 'typeChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojProgressSettableProperties extends baseComponentSettableProperties { - max: number; - type: 'bar'|'circle'; - value: number; - translations: {ariaIndeterminateProgressText?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts b/types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts deleted file mode 100644 index d3b9efbc83..0000000000 --- a/types/@oracle/oraclejet/ojs/ojprogresslist/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// -/// -declare namespace oj { - class ojProgressList extends JetElement { - data: oj.DataProvider|null; - onDataChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojProgressListEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojProgressListEventMap extends oj.JetElementEventMap { - 'dataChanged': CustomEvent; - } - interface ojProgressListSettableProperties extends JetSettableProperties { - data: oj.DataProvider|null; - } - -} -declare namespace oj { - interface ProgressItem { - addEventListener(eventType: oj.ProgressItem.EventType, listener: EventListener): void; - removeEventListener(eventType: oj.ProgressItem.EventType, listener: EventListener): void; - } - namespace ProgressItem { - enum EventType { - LOADSTART = "loadstart", - PROGRESS = "progress", - ABORT = "abort", - ERROR = "error", - LOAD = "load", - TIMEOUT = "timeout", - LOADEND = "loadend", - } - enum Status { - QUEUED = "queued", - LOADSTARTED = "loadstarted", - ABORTED = "aborted", - ERRORED = "errored", - TIMEDOUT = "timedout", - LOADED = "loaded", - } - } - - -} diff --git a/types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts b/types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts deleted file mode 100644 index 7367c03bbd..0000000000 --- a/types/@oracle/oraclejet/ojs/ojpulltorefresh/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare namespace oj { - class PullToRefreshUtils { - static setupPullToRefresh(element: Element, refreshFunc: (()=> Promise), options?: {threshold?: number, primaryText?: string, secondaryText?: string}): void; - static tearDownPullToRefresh(element: Element): void; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojradioset/index.d.ts b/types/@oracle/oraclejet/ojs/ojradioset/index.d.ts deleted file mode 100644 index 7657b0a18c..0000000000 --- a/types/@oracle/oraclejet/ojs/ojradioset/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/// -declare namespace oj { - class ojRadioset extends editableValue { - disabled: boolean|null; - labelledBy: string|null; - required: boolean; - value: any; - translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - onDisabledChanged: (event: CustomEvent)=> any; - onLabelledByChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojRadioset.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojRadioset.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojRadiosetEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - validate(): Promise; - } - namespace ojRadioset { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojRadiosetEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojRadioset.ojAnimateEnd; - 'ojAnimateStart': oj.ojRadioset.ojAnimateStart; - 'disabledChanged': CustomEvent; - 'labelledByChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojRadiosetSettableProperties extends editableValueSettableProperties { - disabled: boolean|null; - labelledBy: string|null; - required: boolean; - value: any; - translations: {required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts b/types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts deleted file mode 100644 index 5c2dee4c70..0000000000 --- a/types/@oracle/oraclejet/ojs/ojrefresher/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -declare namespace oj { - class ojRefresher extends baseComponent { - refreshContent: (()=> Promise); - target: Element; - text: string; - threshold: number; - onRefreshContentChanged: (event: CustomEvent)=> any; - onTargetChanged: (event: CustomEvent)=> any; - onTextChanged: (event: CustomEvent)=> any; - onThresholdChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojRefresherEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojRefresherEventMap extends oj.baseComponentEventMap { - 'refreshContentChanged': CustomEvent; - 'targetChanged': CustomEvent; - 'textChanged': CustomEvent; - 'thresholdChanged': CustomEvent; - } - interface ojRefresherSettableProperties extends baseComponentSettableProperties { - refreshContent: (()=> Promise); - target: Element; - text: string; - threshold: number; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojrouter/index.d.ts b/types/@oracle/oraclejet/ojs/ojrouter/index.d.ts deleted file mode 100644 index 44c23b8f5d..0000000000 --- a/types/@oracle/oraclejet/ojs/ojrouter/index.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -/// -declare namespace oj { - class Router { - readonly currentState: (()=> oj.RouterState|undefined); - readonly currentValue: (()=> string|undefined); - defaultStateId: string|undefined; - static defaults: {urlAdapter?: oj.Router.urlPathAdapter|oj.Router.urlParamAdapter, baseUrl?: string, rootInstanceName?: string}; - readonly direction: string|undefined; - readonly moduleConfig: {name: KnockoutObservable, params: {ojRouter: {parentRouter: oj.Router, direction: string}}, lifecycleListener: {attached: ((param0: string)=> void)}}; - readonly name: string; - readonly observableModuleConfig: KnockoutObservable; - readonly parent: oj.Router|undefined; - static readonly rootInstance: oj.Router; - readonly stateId: ((param0?: string)=> string); - readonly states: Array|null; - static readonly transitionedToState: object; - static sync(): Promise<{hasChanged: boolean}>; - configure(option: {[key:string]: oj.RouterState.ConfigOptions}|((id:string)=> oj.RouterState)): any; - createChildRouter(name: string, parentStateId?: string): oj.Router; - dispose(): undefined; - getChildRouter(name: string): oj.Router|undefined; - getCurrentChildRouter(): oj.Router|undefined; - getState(stateId: string): oj.RouterState|undefined; - go(stateIdPath?: string|Array, options?: {historyUpdate: string}): Promise<{hasChanged: boolean}>; - retrieve(): any; - store(data: object): undefined; - } - namespace Router { - type ModuleConfigType = - { - name: KnockoutObservable, params: {ojRouter: {parentRouter: oj.Router, direction: string, parameters: object}}, lifecycleListener: {attached: ((param0: object)=> void)} - } - } - namespace Router { - class urlParamAdapter { - constructor(); - } -class urlPathAdapter { - constructor(); - } - - - } - - -} -declare namespace oj { - class RouterState { - canEnter: (()=> boolean)|(()=> Promise); - canExit: (()=> boolean)|(()=> Promise); - enter: (()=> void)|(()=> Promise); - exit: (()=> void)|(()=> Promise); - readonly id: string; - label: string|undefined; - parameters: object; - title: string|(()=> string|undefined); - value: any; - constructor(id: string, options?: oj.RouterState.ConfigOptions, router?: oj.Router); - go(): Promise<{hasChanged: boolean}>; - isCurrent(): boolean; - } - namespace RouterState { - type ConfigOptions = - { - label?: string, value?: any, isDefault?: boolean, canEnter?: (()=> boolean)|(()=> Promise), enter?: (()=> void)|(()=> Promise), canExit?: (()=> boolean)|(()=> Promise), exit?: (()=> void)|(()=> Promise) - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts b/types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts deleted file mode 100644 index d6c2cec4a5..0000000000 --- a/types/@oracle/oraclejet/ojs/ojselectcombobox/index.d.ts +++ /dev/null @@ -1,427 +0,0 @@ -/// -declare namespace oj { - abstract class ojCombobox, SV=V, RV=V> extends editableValue { - onOjAnimateEnd: (event: oj.ojCombobox.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojCombobox.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojComboboxEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - validate(): Promise; - } - namespace ojCombobox { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojComboboxEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojCombobox.ojAnimateEnd; - 'ojAnimateStart': oj.ojCombobox.ojAnimateStart; - } - interface ojComboboxSettableProperties extends editableValueSettableProperties { - } - namespace ojCombobox { - type Optgroup = - { - disabled?: boolean, label: string, children: Array<(oj.ojCombobox.Option|oj.ojCombobox.Optgroup)> - } - } - namespace ojCombobox { - type Option = - { - disabled?: boolean, label?: string, value: any - } - } - namespace ojCombobox { - type OptionContext = - { - component: Element, parent: Element, index: number, depth: number, leaf: boolean, data: object, parentElement: Element - } - } - namespace ojCombobox { - type OptionsKeys = - { - label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys - } - } - -} -declare namespace oj { - class ojComboboxMany extends ojCombobox, ojComboboxManySettableProperties, Array, string> { - asyncValidators: Array>>; - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - minLength: number; - optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - readonly rawValue: string|null; - required: boolean; - validators: Array>|oj.Validation.RegisteredValidator>|null; - value: Array|null; - valueOptions: Array<{value: any, label?: string}> | null; - translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - onAsyncValidatorsChanged: (event: CustomEvent)=> any; - onConverterChanged: (event: CustomEvent)=> any; - onMinLengthChanged: (event: CustomEvent)=> any; - onOptionRendererChanged: (event: CustomEvent)=> any; - onOptionsChanged: (event: CustomEvent)=> any; - onOptionsKeysChanged: (event: CustomEvent)=> any; - onPickerAttributesChanged: (event: CustomEvent)=> any; - onPlaceholderChanged: (event: CustomEvent)=> any; - onRawValueChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onValidatorsChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onValueOptionsChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojComboboxMany.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojComboboxMany.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojComboboxManyEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojComboboxMany { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojComboboxManyEventMap extends oj.ojComboboxEventMap { - 'ojAnimateEnd': oj.ojComboboxMany.ojAnimateEnd; - 'ojAnimateStart': oj.ojComboboxMany.ojAnimateStart; - 'asyncValidatorsChanged': CustomEvent; - 'converterChanged': CustomEvent; - 'minLengthChanged': CustomEvent; - 'optionRendererChanged': CustomEvent; - 'optionsChanged': CustomEvent; - 'optionsKeysChanged': CustomEvent; - 'pickerAttributesChanged': CustomEvent; - 'placeholderChanged': CustomEvent; - 'rawValueChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'validatorsChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'valueOptionsChanged': CustomEvent; - } - interface ojComboboxManySettableProperties extends ojComboboxSettableProperties, Array, string> { - asyncValidators: Array>>; - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - minLength: number; - optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - readonly rawValue: string|null; - required: boolean; - validators: Array>|oj.Validation.RegisteredValidator>|null; - value: Array|null; - valueOptions: Array<{value: any, label?: string}> | null; - translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - } - -} -declare namespace oj { - class ojComboboxOne extends ojCombobox, any, string> { - asyncValidators: Array>; - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - filterOnOpen: 'none'|'rawValue'; - minLength: number; - optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - readonly rawValue: string|null; - required: boolean; - validators: Array|oj.Validation.RegisteredValidator>|null; - value: any; - valueOption: {value: any, label?: string}; - translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - onAsyncValidatorsChanged: (event: CustomEvent)=> any; - onConverterChanged: (event: CustomEvent)=> any; - onFilterOnOpenChanged: (event: CustomEvent)=> any; - onMinLengthChanged: (event: CustomEvent)=> any; - onOptionRendererChanged: (event: CustomEvent)=> any; - onOptionsChanged: (event: CustomEvent)=> any; - onOptionsKeysChanged: (event: CustomEvent)=> any; - onPickerAttributesChanged: (event: CustomEvent)=> any; - onPlaceholderChanged: (event: CustomEvent)=> any; - onRawValueChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onValidatorsChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onValueOptionChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojComboboxOne.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojComboboxOne.ojAnimateStart)=> any; - onOjValueUpdated: (event: oj.ojComboboxOne.ojValueUpdated)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojComboboxOneEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojComboboxOne { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojValueUpdated extends CustomEvent<{value: any, previousValue: any, [propName: string]: any}> { - - } - } - interface ojComboboxOneEventMap extends oj.ojComboboxEventMap { - 'ojAnimateEnd': oj.ojComboboxOne.ojAnimateEnd; - 'ojAnimateStart': oj.ojComboboxOne.ojAnimateStart; - 'ojValueUpdated': oj.ojComboboxOne.ojValueUpdated; - 'asyncValidatorsChanged': CustomEvent; - 'converterChanged': CustomEvent; - 'filterOnOpenChanged': CustomEvent; - 'minLengthChanged': CustomEvent; - 'optionRendererChanged': CustomEvent; - 'optionsChanged': CustomEvent; - 'optionsKeysChanged': CustomEvent; - 'pickerAttributesChanged': CustomEvent; - 'placeholderChanged': CustomEvent; - 'rawValueChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'validatorsChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'valueOptionChanged': CustomEvent; - } - interface ojComboboxOneSettableProperties extends ojComboboxSettableProperties { - asyncValidators: Array>; - converter: oj.Converter|oj.Validation.RegisteredConverter|null; - filterOnOpen: 'none'|'rawValue'; - minLength: number; - optionRenderer?: ((param0: oj.ojCombobox.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys: {label?: string, value?: string, children?: string, childKeys?: oj.ojCombobox.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - readonly rawValue: string|null; - required: boolean; - validators: Array|oj.Validation.RegisteredValidator>|null; - value: any; - valueOption: {value: any, label?: string}; - translations: {filterFurther?: string, noMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}}; - } - -} -declare namespace oj { - abstract class ojSelect, SV=V> extends editableValue { - onOjAnimateEnd: (event: oj.ojSelect.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojSelect.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSelectEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - validate(): Promise; - } - namespace ojSelect { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojSelectEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojSelect.ojAnimateEnd; - 'ojAnimateStart': oj.ojSelect.ojAnimateStart; - } - interface ojSelectSettableProperties extends editableValueSettableProperties { - } - namespace ojSelect { - type Optgroup = - { - disabled?: boolean, label: string, children: Array<(oj.ojSelect.Option|oj.ojSelect.Optgroup)> - } - } - namespace ojSelect { - type Option = - { - disabled?: boolean, label?: string, value: any - } - } - namespace ojSelect { - type OptionContext = - { - component: Element, parent: Element, index: number, depth: number, leaf: boolean, data: object, parentElement: Element - } - } - namespace ojSelect { - type OptionsKeys = - { - label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys - } - } - -} -declare namespace oj { - class ojSelectMany extends ojSelect, ojSelectManySettableProperties> { - minimumResultsForSearch: number; - optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - renderMode: 'jet'|'native'; - required: boolean; - value: Array|null; - valueOptions: Array<{value: any, label?: string}> | null; - translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; - onMinimumResultsForSearchChanged: (event: CustomEvent)=> any; - onOptionRendererChanged: (event: CustomEvent)=> any; - onOptionsChanged: (event: CustomEvent)=> any; - onOptionsKeysChanged: (event: CustomEvent)=> any; - onPickerAttributesChanged: (event: CustomEvent)=> any; - onPlaceholderChanged: (event: CustomEvent)=> any; - onRenderModeChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onValueOptionsChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojSelectMany.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojSelectMany.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSelectManyEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojSelectMany { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojSelectManyEventMap extends oj.ojSelectEventMap { - 'ojAnimateEnd': oj.ojSelectMany.ojAnimateEnd; - 'ojAnimateStart': oj.ojSelectMany.ojAnimateStart; - 'minimumResultsForSearchChanged': CustomEvent; - 'optionRendererChanged': CustomEvent; - 'optionsChanged': CustomEvent; - 'optionsKeysChanged': CustomEvent; - 'pickerAttributesChanged': CustomEvent; - 'placeholderChanged': CustomEvent; - 'renderModeChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'valueOptionsChanged': CustomEvent; - } - interface ojSelectManySettableProperties extends ojSelectSettableProperties> { - minimumResultsForSearch: number; - optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - renderMode: 'jet'|'native'; - required: boolean; - value: Array|null; - valueOptions: Array<{value: any, label?: string}> | null; - translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; - } - -} -declare namespace oj { - class ojSelectOne extends ojSelect> { - minimumResultsForSearch: number; - optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - renderMode: 'jet'|'native'; - required: boolean; - value: any; - valueOption: {value: any, label?: string}; - translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; - onMinimumResultsForSearchChanged: (event: CustomEvent)=> any; - onOptionRendererChanged: (event: CustomEvent)=> any; - onOptionsChanged: (event: CustomEvent)=> any; - onOptionsKeysChanged: (event: CustomEvent)=> any; - onPickerAttributesChanged: (event: CustomEvent)=> any; - onPlaceholderChanged: (event: CustomEvent)=> any; - onRenderModeChanged: (event: CustomEvent)=> any; - onRequiredChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onValueOptionChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojSelectOne.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojSelectOne.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSelectOneEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojSelectOne { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojSelectOneEventMap extends oj.ojSelectEventMap { - 'ojAnimateEnd': oj.ojSelectOne.ojAnimateEnd; - 'ojAnimateStart': oj.ojSelectOne.ojAnimateStart; - 'minimumResultsForSearchChanged': CustomEvent; - 'optionRendererChanged': CustomEvent; - 'optionsChanged': CustomEvent; - 'optionsKeysChanged': CustomEvent; - 'pickerAttributesChanged': CustomEvent; - 'placeholderChanged': CustomEvent; - 'renderModeChanged': CustomEvent; - 'requiredChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'valueOptionChanged': CustomEvent; - } - interface ojSelectOneSettableProperties extends ojSelectSettableProperties { - minimumResultsForSearch: number; - optionRenderer?: ((param0: oj.ojSelect.OptionContext) => {insert: Element}|undefined)|null; - options: Array|oj.DataProvider|null; - optionsKeys: {childKeys?: {label?: string, value?: string, children?: string, childKeys?: oj.ojSelect.OptionsKeys}, children?: string, label?: string, value?: string}; - pickerAttributes: {style?: string, class?: string}; - placeholder: string|null; - renderMode: 'jet'|'native'; - required: boolean; - value: any; - valueOption: {value: any, label?: string}; - translations: {filterFurther?: string, moreMatchesFound?: string, noMatchesFound?: string, oneMatchesFound?: string, required?: {hint?: string, messageDetail?: string, messageSummary?: string}, searchField?: string}; - } - -} -declare namespace oj { - interface Optgroup { - children: Array<(oj.Option|oj.Optgroup)>; - disabled?: boolean; - label: string; - } - -} -declare namespace oj { - interface Option { - disabled?: boolean; - label?: string; - value: object; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojslider/index.d.ts b/types/@oracle/oraclejet/ojs/ojslider/index.d.ts deleted file mode 100644 index 467073e274..0000000000 --- a/types/@oracle/oraclejet/ojs/ojslider/index.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/// -declare namespace oj { - class ojSlider extends editableValue { - disabled: boolean|null; - max: number|null; - min: number|null; - orientation: 'horizontal'|'vertical'; - step: number|null; - readonly transientValue: number; - type: 'fromMin'|'fromMax'|'single'; - value: number|null; - translations: {invalidStep?: string, maxMin?: string, noValue?: string, optionNum?: string, valueRange?: string}; - onDisabledChanged: (event: CustomEvent)=> any; - onMaxChanged: (event: CustomEvent)=> any; - onMinChanged: (event: CustomEvent)=> any; - onOrientationChanged: (event: CustomEvent)=> any; - onStepChanged: (event: CustomEvent)=> any; - onTransientValueChanged: (event: CustomEvent)=> any; - onTypeChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojSlider.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojSlider.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSliderEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojSlider { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojSliderEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojSlider.ojAnimateEnd; - 'ojAnimateStart': oj.ojSlider.ojAnimateStart; - 'disabledChanged': CustomEvent; - 'maxChanged': CustomEvent; - 'minChanged': CustomEvent; - 'orientationChanged': CustomEvent; - 'stepChanged': CustomEvent; - 'transientValueChanged': CustomEvent; - 'typeChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojSliderSettableProperties extends editableValueSettableProperties { - disabled: boolean|null; - max: number|null; - min: number|null; - orientation: 'horizontal'|'vertical'; - step: number|null; - readonly transientValue: number; - type: 'fromMin'|'fromMax'|'single'; - value: number|null; - translations: {invalidStep?: string, maxMin?: string, noValue?: string, optionNum?: string, valueRange?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts b/types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts deleted file mode 100644 index 6ef93fd030..0000000000 --- a/types/@oracle/oraclejet/ojs/ojsunburst/index.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -/// -declare namespace oj { - class ojSunburst extends dvtBaseComponent> { - animationDuration: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - animationUpdateColor: string; - as: string; - colorLabel: string; - data: oj.DataProvider|null; - displayLevels: number; - drilling: 'on'|'off'; - expanded: KeySet.KeySet; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - nodeDefaults: {borderColor: string, borderWidth: number, hoverColor: string, labelDisplay: 'horizontal'|'rotated'|'off'|'auto', labelHalign: 'inner'|'outer'|'center', labelMinLength: number, labelStyle: object, selectedInnerColor: string, selectedOuterColor: string, showDisclosure: 'on'|'off'}; - rootNode: any; - rootNodeContent: {renderer: ((context: oj.ojSunburst.RootNodeContext) => ({insert: Element|string}))}; - rotation: 'off'|'on'; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - sizeLabel: string; - sorting: 'on'|'off'; - startAngle: number; - tooltip: {renderer: ((context: oj.ojSunburst.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipCollapse?: string, tooltipExpand?: string}; - onAnimationDurationChanged: (event: CustomEvent)=> any; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAnimationUpdateColorChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onColorLabelChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDisplayLevelsChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onExpandedChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHighlightMatchChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; - onNodeDefaultsChanged: (event: CustomEvent)=> any; - onRootNodeChanged: (event: CustomEvent)=> any; - onRootNodeContentChanged: (event: CustomEvent)=> any; - onRotationChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onSizeLabelChanged: (event: CustomEvent)=> any; - onSortingChanged: (event: CustomEvent)=> any; - onStartAngleChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTouchResponseChanged: (event: CustomEvent)=> any; - onOjBeforeCollapse: (event: oj.ojSunburst.ojBeforeCollapse)=> any; - onOjBeforeDrill: (event: oj.ojSunburst.ojBeforeDrill)=> any; - onOjBeforeExpand: (event: oj.ojSunburst.ojBeforeExpand)=> any; - onOjCollapse: (event: oj.ojSunburst.ojCollapse)=> any; - onOjDrill: (event: oj.ojSunburst.ojDrill)=> any; - onOjExpand: (event: oj.ojSunburst.ojExpand)=> any; - onOjRotateInput: (event: oj.ojSunburst.ojRotateInput)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSunburstEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojSunburst.NodeContext|null; - getNode(subIdPath: Array): oj.ojSunburst.DataContext|null; - } - namespace ojSunburst { - class ojBeforeCollapse extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - - class ojBeforeDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - - class ojBeforeExpand extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - - class ojCollapse extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - - class ojDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - - class ojExpand extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - - class ojRotateInput extends CustomEvent<{value: number, [propName: string]: any}> { - - } - } - interface ojSunburstEventMap extends oj.dvtBaseComponentEventMap { - 'ojBeforeCollapse': oj.ojSunburst.ojBeforeCollapse; - 'ojBeforeDrill': oj.ojSunburst.ojBeforeDrill; - 'ojBeforeExpand': oj.ojSunburst.ojBeforeExpand; - 'ojCollapse': oj.ojSunburst.ojCollapse; - 'ojDrill': oj.ojSunburst.ojDrill; - 'ojExpand': oj.ojSunburst.ojExpand; - 'ojRotateInput': oj.ojSunburst.ojRotateInput; - 'animationDurationChanged': CustomEvent; - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'animationUpdateColorChanged': CustomEvent; - 'asChanged': CustomEvent; - 'colorLabelChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'displayLevelsChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'expandedChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'highlightMatchChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'hoverBehaviorDelayChanged': CustomEvent; - 'nodeDefaultsChanged': CustomEvent; - 'rootNodeChanged': CustomEvent; - 'rootNodeContentChanged': CustomEvent; - 'rotationChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'sizeLabelChanged': CustomEvent; - 'sortingChanged': CustomEvent; - 'startAngleChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'touchResponseChanged': CustomEvent; - } - interface ojSunburstSettableProperties extends dvtBaseComponentSettableProperties { - animationDuration: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - animationUpdateColor: string; - as: string; - colorLabel: string; - data: oj.DataProvider|null; - displayLevels: number; - drilling: 'on'|'off'; - expanded: KeySet.KeySet; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - nodeDefaults: {borderColor: string, borderWidth: number, hoverColor: string, labelDisplay: 'horizontal'|'rotated'|'off'|'auto', labelHalign: 'inner'|'outer'|'center', labelMinLength: number, labelStyle: object, selectedInnerColor: string, selectedOuterColor: string, showDisclosure: 'on'|'off'}; - rootNode: any; - rootNodeContent: {renderer: ((context: oj.ojSunburst.RootNodeContext) => ({insert: Element|string}))}; - rotation: 'off'|'on'; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - sizeLabel: string; - sorting: 'on'|'off'; - startAngle: number; - tooltip: {renderer: ((context: oj.ojSunburst.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipCollapse?: string, tooltipExpand?: string}; - } - namespace ojSunburst { - type DataContext = - { - color: string, label: string, selected: boolean, size: number, tooltip: string - } - } - namespace ojSunburst { - type NodeContext = - { - subId: string, indexPath: Array - } - } - namespace ojSunburst { - type RootNodeContext = - { - outerBounds: {x: number, y: number, width: number, height: number}, innerBounds: {x: number, y: number, width: number, height: number}, id: K, data: object, itemData: D, componentElement: Element - } - } - namespace ojSunburst { - type TooltipContext = - { - parentElement: Element, id: K, label: string, value: number, radius: number, color: string, data: object, itemData: D, componentElement: Element - } - } - -} -declare namespace oj { - class ojSunburstNode extends JetElement { - borderColor?: string; - borderWidth?: number; - categories?: Array; - color?: string; - drilling?: 'on'|'off'|'inherit'; - label?: string; - labelDisplay?: 'horizontal'|'rotated'|'off'|'auto'; - labelHalign?: 'inner'|'outer'|'center'; - labelStyle?: object; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; - radius?: number; - selectable?: 'off'|'auto'; - shortDesc?: string; - showDisclosure?: 'on'|'off'|'inherit'; - svgClassName?: string; - svgStyle?: object; - value: number; - onBorderColorChanged: (event: CustomEvent)=> any; - onBorderWidthChanged: (event: CustomEvent)=> any; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onLabelDisplayChanged: (event: CustomEvent)=> any; - onLabelHalignChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - onPatternChanged: (event: CustomEvent)=> any; - onRadiusChanged: (event: CustomEvent)=> any; - onSelectableChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onShowDisclosureChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSunburstNodeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojSunburstNodeEventMap extends oj.JetElementEventMap { - 'borderColorChanged': CustomEvent; - 'borderWidthChanged': CustomEvent; - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'labelDisplayChanged': CustomEvent; - 'labelHalignChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - 'patternChanged': CustomEvent; - 'radiusChanged': CustomEvent; - 'selectableChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'showDisclosureChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojSunburstNodeSettableProperties extends JetSettableProperties { - borderColor?: string; - borderWidth?: number; - categories?: Array; - color?: string; - drilling?: 'on'|'off'|'inherit'; - label?: string; - labelDisplay?: 'horizontal'|'rotated'|'off'|'auto'; - labelHalign?: 'inner'|'outer'|'center'; - labelStyle?: object; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; - radius?: number; - selectable?: 'off'|'auto'; - shortDesc?: string; - showDisclosure?: 'on'|'off'|'inherit'; - svgClassName?: string; - svgStyle?: object; - value: number; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts b/types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts deleted file mode 100644 index 11ce95700d..0000000000 --- a/types/@oracle/oraclejet/ojs/ojswipeactions/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// -declare namespace oj { - class ojSwipeActions extends baseComponent { - translations: {ariaHideActionsDescription?: string, ariaShowEndActionsDescription?: string, ariaShowStartActionsDescription?: string}; - onOjAction: (event: oj.ojSwipeActions.ojAction)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwipeActionsEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - } - namespace ojSwipeActions { - class ojAction extends CustomEvent<{ [propName: string]: any}> { - - } - } - interface ojSwipeActionsEventMap extends oj.baseComponentEventMap { - 'ojAction': oj.ojSwipeActions.ojAction; - } - interface ojSwipeActionsSettableProperties extends baseComponentSettableProperties { - translations: {ariaHideActionsDescription?: string, ariaShowEndActionsDescription?: string, ariaShowStartActionsDescription?: string}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts b/types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts deleted file mode 100644 index da94a66d4b..0000000000 --- a/types/@oracle/oraclejet/ojs/ojswipetoreveal/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare namespace oj { - class SwipeToRevealUtils { - static setupSwipeActions(elem: Element, options?: {threshold?: number}): void; - static tearDownSwipeActions(elem: Element): void; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojswitch/index.d.ts b/types/@oracle/oraclejet/ojs/ojswitch/index.d.ts deleted file mode 100644 index 31f04cc1ee..0000000000 --- a/types/@oracle/oraclejet/ojs/ojswitch/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/// -declare namespace oj { - class ojSwitch extends editableValue { - disabled: boolean; - readonly: boolean; - value: boolean; - onDisabledChanged: (event: CustomEvent)=> any; - onReadonlyChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojSwitch.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojSwitch.ojAnimateStart)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwitchEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - namespace ojSwitch { - class ojAnimateEnd extends CustomEvent<{action: string, element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: string, element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - } - interface ojSwitchEventMap extends oj.editableValueEventMap { - 'ojAnimateEnd': oj.ojSwitch.ojAnimateEnd; - 'ojAnimateStart': oj.ojSwitch.ojAnimateStart; - 'disabledChanged': CustomEvent; - 'readonlyChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojSwitchSettableProperties extends editableValueSettableProperties { - disabled: boolean; - readonly: boolean; - value: boolean; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts b/types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts deleted file mode 100644 index d99477edf8..0000000000 --- a/types/@oracle/oraclejet/ojs/ojswitcher/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -declare namespace oj { - class ojSwitcher extends JetElement { - value: string; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwitcherEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getProperty(property: string): any; - refresh(): void; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - } - interface ojSwitcherEventMap extends oj.JetElementEventMap { - 'valueChanged': CustomEvent; - } - interface ojSwitcherSettableProperties extends JetSettableProperties { - value: string; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtable/index.d.ts b/types/@oracle/oraclejet/ojs/ojtable/index.d.ts deleted file mode 100644 index 5ee54785bd..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtable/index.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -/// -/// -declare namespace oj { - class ojTable extends baseComponent> { - accessibility: {rowHeader: string}; - as: string; - columns: Array<{className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, id?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}>|null; - columnsDefault: {className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}; - currentRow: oj.ojTable.CurrentRow | null; - data: oj.DataProvider; - display: 'list'|'grid'; - dnd: {drag: {rows: {dataTypes?: string|Array, dragStart?: ((param0: DragEvent, param1: oj.ojTable.DragRowContext)=> void), drag?: ((param0: DragEvent)=> void), dragEnd?: ((param0: DragEvent)=> void)}}, drop: {columns: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void)}, rows: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void)}}, reorder: {columns: 'enabled'|'disabled'}}; - editMode: 'none'|'rowEdit'; - readonly firstSelectedRow: object; - horizontalGridVisible: 'auto'|'enabled'|'disabled'; - rowRenderer: ((context: oj.ojTable.RowRendererContext) => string | HTMLElement | void) | null; - scrollPolicy: 'auto'|'loadMoreOnScroll'; - scrollPolicyOptions: {fetchSize: number, maxCount: number}; - scrollPosition: {x?: number, y?: number, columnIndex?: number, rowIndex?: number, columnKey?: any, rowKey?: any, offsetX?: number, offsetY?: number}; - selection: Array & oj.ojTable.RowSelectionEnd> | Array & oj.ojTable.ColumnSelectionEnd>; - selectionMode: {column: 'single'|'multiple', row: 'single'|'multiple'}; - selectionRequired: boolean; - verticalGridVisible: 'auto'|'enabled'|'disabled'; - translations: {labelAccSelectionAffordanceBottom?: string, labelAccSelectionAffordanceTop?: string, labelDisableNonContiguousSelection?: string, labelEditRow?: string, labelEnableNonContiguousSelection?: string, labelResize?: string, labelResizePopupSpinner?: string, labelResizePopupSubmit?: string, labelSelectAndEditRow?: string, labelSelectColum?: string, labelSelectRow?: string, labelSort?: string, labelSortAsc?: string, labelSortDsc?: string, msgColumnResizeWidthValidation?: string, msgFetchingData?: string, msgInitializing?: string, msgNoData?: string, msgScrollPolicyMaxCountDetail?: string, msgScrollPolicyMaxCountSummary?: string, msgStatusSortAscending?: string, msgStatusSortDescending?: string}; - onAccessibilityChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onColumnsChanged: (event: CustomEvent)=> any; - onColumnsDefaultChanged: (event: CustomEvent)=> any; - onCurrentRowChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDisplayChanged: (event: CustomEvent)=> any; - onDndChanged: (event: CustomEvent)=> any; - onEditModeChanged: (event: CustomEvent)=> any; - onFirstSelectedRowChanged: (event: CustomEvent)=> any; - onHorizontalGridVisibleChanged: (event: CustomEvent)=> any; - onRowRendererChanged: (event: CustomEvent)=> any; - onScrollPolicyChanged: (event: CustomEvent)=> any; - onScrollPolicyOptionsChanged: (event: CustomEvent)=> any; - onScrollPositionChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onSelectionRequiredChanged: (event: CustomEvent)=> any; - onVerticalGridVisibleChanged: (event: CustomEvent)=> any; - onOjAnimateEnd: (event: oj.ojTable.ojAnimateEnd)=> any; - onOjAnimateStart: (event: oj.ojTable.ojAnimateStart)=> any; - onOjBeforeCurrentRow: (event: oj.ojTable.ojBeforeCurrentRow)=> any; - onOjBeforeRowEdit: (event: oj.ojTable.ojBeforeRowEdit)=> any; - onOjBeforeRowEditEnd: (event: oj.ojTable.ojBeforeRowEditEnd)=> any; - onOjSort: (event: oj.ojTable.ojSort)=> any; - - addEventListener>(type: T, listener: (this: HTMLElement, ev: ojTableEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): {subId: 'oj-table-cell', rowIndex: number, columnIndex: number, key:string} | {subId: 'oj-table-footer'|'oj-table-header',index: number}; - getDataForVisibleRow(rowIndex: number) : {data: D, index: number, key: K} | null - refresh(): void; - refreshRow(rowIdx: number): Promise; - } - namespace ojTable { - class ojAnimateEnd extends CustomEvent<{action: 'add'|'remove'|'update', element: Element, [propName: string]: any}> { - - } - - class ojAnimateStart extends CustomEvent<{action: 'add'|'remove'|'update', element: Element, endCallback: (()=> void), [propName: string]: any}> { - - } - - class ojBeforeCurrentRow extends CustomEvent<{currentRow: oj.ojTable.CurrentRow, previousCurrentRow: oj.ojTable.CurrentRow, [propName: string]: any}> { - - } - - class ojBeforeRowEdit extends CustomEvent<{rowContext: object, [propName: string]: any}> { - - } - - class ojBeforeRowEditEnd extends CustomEvent<{rowContext: object, cancelEdit: object, [propName: string]: any}> { - - } - - class ojSort extends CustomEvent<{header: Element, direction: 'ascending'|'descending', [propName: string]: any}> { - - } - } - interface ojTableEventMap extends oj.baseComponentEventMap { - 'ojAnimateEnd': oj.ojTable.ojAnimateEnd; - 'ojAnimateStart': oj.ojTable.ojAnimateStart; - 'ojBeforeCurrentRow': oj.ojTable.ojBeforeCurrentRow; - 'ojBeforeRowEdit': oj.ojTable.ojBeforeRowEdit; - 'ojBeforeRowEditEnd': oj.ojTable.ojBeforeRowEditEnd; - 'ojSort': oj.ojTable.ojSort; - 'accessibilityChanged': CustomEvent; - 'asChanged': CustomEvent; - 'columnsChanged': CustomEvent; - 'columnsDefaultChanged': CustomEvent; - 'currentRowChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'displayChanged': CustomEvent; - 'dndChanged': CustomEvent; - 'editModeChanged': CustomEvent; - 'firstSelectedRowChanged': CustomEvent; - 'horizontalGridVisibleChanged': CustomEvent; - 'rowRendererChanged': CustomEvent; - 'scrollPolicyChanged': CustomEvent; - 'scrollPolicyOptionsChanged': CustomEvent; - 'scrollPositionChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'selectionRequiredChanged': CustomEvent; - 'verticalGridVisibleChanged': CustomEvent; - } - interface ojTableSettableProperties extends baseComponentSettableProperties { - accessibility: {rowHeader: string}; - as: string; - columns: Array<{className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, id?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}>|null; - columnsDefault: {className?: string|null, field?: string|null, footerClassName?: string|null, footerRenderer?: ((context: oj.ojTable.FooterRendererContext) => {insert: HTMLElement | string} | void) | null, footerStyle?: string|null, footerTemplate?: {componentElement: Element}, headerClassName?: string|null, headerRenderer?: ((context: oj.ojTable.HeaderRendererContext) => {insert: HTMLElement | string} | void) | null, headerStyle?: string|null, headerTemplate?: {componentElement: Element, data: object}, headerText?: string|null, renderer?: ((context: oj.ojTable.ColumnsRendererContext) => {insert: HTMLElement | string} | void) | null, resizable?: 'enabled'|'disabled', sortProperty?: string|null, sortable?: 'auto'|'enabled'|'disabled', style?: string|null, template?: {componentElement: Element, data: object, row: object, index: number, columnIndex: number, key: any, mode: string}, width?: number|null}; - currentRow: oj.ojTable.CurrentRow | null; - data: oj.DataProvider|null; - display: 'list'|'grid'; - dnd: {drag: {rows: {dataTypes?: string|Array, dragStart?: ((param0: DragEvent, param1: oj.ojTable.DragRowContext)=> void), drag?: ((param0: DragEvent)=> void), dragEnd?: ((param0: DragEvent)=> void)}}, drop: {columns: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropColumnContext)=> void)}, rows: {dataTypes: string|Array, dragEnter?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragOver?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), dragLeave?: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void), drop: ((param0: DragEvent, param1: oj.ojTable.DropRowContext)=> void)}}, reorder: {columns: 'enabled'|'disabled'}}; - editMode: 'none'|'rowEdit'; - readonly firstSelectedRow: object; - horizontalGridVisible: 'auto'|'enabled'|'disabled'; - rowRenderer: ((context: oj.ojTable.RowRendererContext) => string | HTMLElement | void) | null; - scrollPolicy: 'auto'|'loadMoreOnScroll'; - scrollPolicyOptions: {fetchSize: number, maxCount: number}; - scrollPosition: {x?: number, y?: number, columnIndex?: number, rowIndex?: number, columnKey?: any, rowKey?: any, offsetX?: number, offsetY?: number}; - selection: Array & oj.ojTable.RowSelectionEnd> | Array & oj.ojTable.ColumnSelectionEnd>; - selectionMode: {column: 'single'|'multiple', row: 'single'|'multiple'}; - selectionRequired: boolean; - verticalGridVisible: 'auto'|'enabled'|'disabled'; - translations: {labelAccSelectionAffordanceBottom?: string, labelAccSelectionAffordanceTop?: string, labelDisableNonContiguousSelection?: string, labelEditRow?: string, labelEnableNonContiguousSelection?: string, labelResize?: string, labelResizePopupSpinner?: string, labelResizePopupSubmit?: string, labelSelectAndEditRow?: string, labelSelectColum?: string, labelSelectRow?: string, labelSort?: string, labelSortAsc?: string, labelSortDsc?: string, msgColumnResizeWidthValidation?: string, msgFetchingData?: string, msgInitializing?: string, msgNoData?: string, msgScrollPolicyMaxCountDetail?: string, msgScrollPolicyMaxCountSummary?: string, msgStatusSortAscending?: string, msgStatusSortDescending?: string}; - } - namespace ojTable { - type ColumnSelectionEnd = {endIndex:{column:number},endKey?:{column:K}}|{endIndex?:{column:number}, endKey:{column:K}}; - } - namespace ojTable { - type ColumnSelectionStart = {startIndex:{column:number}, startKey?:{column:K}}|{startIndex?:{column:number}, startKey:{column:K}}; - } - namespace ojTable { - type ColumnsRendererContext = - { - cellContext: {datasource: oj.DataProvider|null, mode: 'edit'|'navigation', status: oj.ojTable.ContextStatus}, columnIndex: number, componentElement: Element, data: D, parentElement: Element, row: {[name: string]: any} - } - } - namespace ojTable { - type ContextStatus = - { - rowIndex: number, rowKey: K, currentRow: oj.ojTable.CurrentRow - } - } - namespace ojTable { - type CurrentRow = {rowIndex: number, rowKey?: K}|{rowIndex?: number, rowKey: K}; - } - namespace ojTable { - type DragRowContext = - { - rows: Array<{data: D, index: number, key: K}> - } - } - namespace ojTable { - type DropColumnContext = - { - columnIndex: number - } - } - namespace ojTable { - type DropRowContext = - { - rowIndex: number - } - } - namespace ojTable { - type FooterRendererContext = - { - columnIndex: number, componentElement: Element, footerContext: {datasource: oj.DataProvider|null}, parentElement: Element - } - } - namespace ojTable { - type HeaderRendererContext = - { - columnIndex: number, columnHeaderDefaultRenderer: ((param0: object, param1: ((param0: object)=>void))=> void), columnHeaderSortableIconRenderer: ((param0: object, param1: ((param0: Object)=>void))=> void), componentElement: Element, data: string, headerContext: {datasource: oj.DataProvider|null}, parentElement: Element - } - } - namespace ojTable { - type RowRendererContext = - { - componentElement: Element, data: {[name: string]: any}, parentElement: Element, rowContext: {datasource: oj.DataProvider|null, mode: 'edit'|'navigation', status: oj.ojTable.ContextStatus} - } - } - namespace ojTable { - type RowSelectionEnd = {endIndex: {row: number}, endKey?: {row: K}}|{endIndex?:{row: number}, endKey:{row: K}}; - } - namespace ojTable { - type RowSelectionStart = {startIndex: {row: number}, startKey?:{row: K}}|{startIndex?: {row: number}, startKey:{row: K}}; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts b/types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts deleted file mode 100644 index 9400b980f7..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtagcloud/index.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -/// -/// -declare namespace oj { - class ojTagCloud extends dvtBaseComponent> { - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - as: string; - data: oj.DataProvider|null; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - layout: 'cloud'|'rectangular'; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - styleDefaults: {animationDuration?: number, hoverBehaviorDelay?: number, svgStyle?: object}; - tooltip: {renderer: ((context: oj.ojTagCloud.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHighlightMatchChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onLayoutChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onStyleDefaultsChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTouchResponseChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTagCloudEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojTagCloud.NodeContext|null; - getItem(index: number): oj.ojTagCloud.ItemContext|null; - getItemCount(): number; - } - interface ojTagCloudEventMap extends oj.dvtBaseComponentEventMap { - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'asChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'highlightMatchChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'layoutChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'styleDefaultsChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'touchResponseChanged': CustomEvent; - } - interface ojTagCloudSettableProperties extends dvtBaseComponentSettableProperties { - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - as: string; - data: oj.DataProvider|null; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - layout: 'cloud'|'rectangular'; - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - styleDefaults: {animationDuration?: number, hoverBehaviorDelay?: number, svgStyle?: object}; - tooltip: {renderer: ((context: oj.ojTagCloud.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - namespace ojTagCloud { - type ItemContext = - { - color: string, label: string, selected: boolean, tooltip: string, value: number - } - } - namespace ojTagCloud { - type NodeContext = - { - subId: string, index: number - } - } - namespace ojTagCloud { - type TooltipContext = - { - color: string, componentElement: Element, id: K, label: string, parentElement: Element, value: number - } - } - -} -declare namespace oj { - class ojTagCloudItem extends JetElement { - categories: Array; - color?: string; - label: string; - shortDesc: string; - svgClassName: string; - svgStyle: object; - url: string; - value: number|null; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onUrlChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTagCloudItemEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojTagCloudItemEventMap extends oj.JetElementEventMap { - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'urlChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojTagCloudItemSettableProperties extends JetSettableProperties { - categories: Array; - color?: string; - label: string; - shortDesc: string; - svgClassName: string; - svgStyle: object; - url: string; - value: number|null; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts b/types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts deleted file mode 100644 index 81c012ce6d..0000000000 --- a/types/@oracle/oraclejet/ojs/ojthematicmap/index.d.ts +++ /dev/null @@ -1,376 +0,0 @@ -/// -/// -declare namespace oj { - class ojThematicMap extends dvtBaseComponent> { - animationDuration: number; - animationOnDisplay: 'auto'|'none'; - areaData: oj.DataProvider|null; - as: string; - focusRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - initialZooming: 'auto'|'none'; - isolatedItem: K1; - labelDisplay: 'on'|'off'|'auto'; - labelType: 'long'|'short'; - linkData: oj.DataProvider|null; - mapProvider: {geo: object, propertiesKeys: {id: string, longLabel?: string, shortLabel?: string}}; - markerData: oj.DataProvider|null; - markerZoomBehavior: 'zoom'|'fixed'; - maxZoom: number; - panning: 'auto'|'none'; - renderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - selectionRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - styleDefaults: {areaSvgStyle?: object, dataAreaDefaults?: {borderColor?: string, hoverColor?: string, selectedInnerColor?: string, selectedOuterColor?: string}, dataMarkerDefaults?: {borderColor?: string, borderStyle?: 'none'|'solid', borderWidth?: number, color?: string, height?: number, labelStyle?: object, opacity?: number, shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, width?: number}, hoverBehaviorDelay?: number, labelStyle?: object, linkDefaults?: {color?: string, width?: number}}; - tooltip: {renderer: ((context: oj.ojThematicMap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - tooltipDisplay: 'auto'|'labelAndShortDesc'|'none'|'shortDesc'; - touchResponse: 'touchStart'|'auto'; - zooming: 'auto'|'none'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onAnimationDurationChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAreaDataChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onFocusRendererChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHighlightMatchChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onHoverRendererChanged: (event: CustomEvent)=> any; - onInitialZoomingChanged: (event: CustomEvent)=> any; - onIsolatedItemChanged: (event: CustomEvent)=> any; - onLabelDisplayChanged: (event: CustomEvent)=> any; - onLabelTypeChanged: (event: CustomEvent)=> any; - onLinkDataChanged: (event: CustomEvent)=> any; - onMapProviderChanged: (event: CustomEvent)=> any; - onMarkerDataChanged: (event: CustomEvent)=> any; - onMarkerZoomBehaviorChanged: (event: CustomEvent)=> any; - onMaxZoomChanged: (event: CustomEvent)=> any; - onPanningChanged: (event: CustomEvent)=> any; - onRendererChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onSelectionRendererChanged: (event: CustomEvent)=> any; - onStyleDefaultsChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTooltipDisplayChanged: (event: CustomEvent)=> any; - onTouchResponseChanged: (event: CustomEvent)=> any; - onZoomingChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getArea(index: number): oj.ojThematicMap.DataContext|null; - getContextByNode(node: Element): oj.ojThematicMap.NodeContext|null; - getLink(index: number): oj.ojThematicMap.DataContext|null; - getMarker(index: number): oj.ojThematicMap.DataContext|null; - } - interface ojThematicMapEventMap extends oj.dvtBaseComponentEventMap { - 'animationDurationChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'areaDataChanged': CustomEvent; - 'asChanged': CustomEvent; - 'focusRendererChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'highlightMatchChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'hoverRendererChanged': CustomEvent; - 'initialZoomingChanged': CustomEvent; - 'isolatedItemChanged': CustomEvent; - 'labelDisplayChanged': CustomEvent; - 'labelTypeChanged': CustomEvent; - 'linkDataChanged': CustomEvent; - 'mapProviderChanged': CustomEvent; - 'markerDataChanged': CustomEvent; - 'markerZoomBehaviorChanged': CustomEvent; - 'maxZoomChanged': CustomEvent; - 'panningChanged': CustomEvent; - 'rendererChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'selectionRendererChanged': CustomEvent; - 'styleDefaultsChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'tooltipDisplayChanged': CustomEvent; - 'touchResponseChanged': CustomEvent; - 'zoomingChanged': CustomEvent; - } - interface ojThematicMapSettableProperties extends dvtBaseComponentSettableProperties { - animationDuration: number; - animationOnDisplay: 'auto'|'none'; - areaData: oj.DataProvider|null; - as: string; - focusRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - initialZooming: 'auto'|'none'; - isolatedItem: K1; - labelDisplay: 'on'|'off'|'auto'; - labelType: 'long'|'short'; - linkData: oj.DataProvider|null; - mapProvider: {geo: object, propertiesKeys: {id: string, longLabel?: string, shortLabel?: string}}; - markerData: oj.DataProvider|null; - markerZoomBehavior: 'zoom'|'fixed'; - maxZoom: number; - panning: 'auto'|'none'; - renderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - selection: Array; - selectionMode: 'single'|'multiple'|'none'; - selectionRenderer: ((context: oj.ojThematicMap.RendererContext) => ({insert: SVGElement}|void)); - styleDefaults: {areaSvgStyle?: object, dataAreaDefaults?: {borderColor?: string, hoverColor?: string, selectedInnerColor?: string, selectedOuterColor?: string}, dataMarkerDefaults?: {borderColor?: string, borderStyle?: 'none'|'solid', borderWidth?: number, color?: string, height?: number, labelStyle?: object, opacity?: number, shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string, width?: number}, hoverBehaviorDelay?: number, labelStyle?: object, linkDefaults?: {color?: string, width?: number}}; - tooltip: {renderer: ((context: oj.ojThematicMap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - tooltipDisplay: 'auto'|'labelAndShortDesc'|'none'|'shortDesc'; - touchResponse: 'touchStart'|'auto'; - zooming: 'auto'|'none'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - namespace ojThematicMap { - type DataContext = - { - color: string, label: string, selected: boolean, tooltip: string - } - } - namespace ojThematicMap { - type NodeContext = - { - subId: string, index: number - } - } - namespace ojThematicMap { - type RendererContext = - { - color: string, componentElement: Element, data: object, id: K1|K2|K3, itemData: D1|D2|D3, label: string, location: string|null, parentElement: Element, previousState: {hovered: boolean, selected: boolean, focused: boolean}, renderDefaultFocus: (()=> void), renderDefaultHover: (()=> void), renderDefaultSelection: (()=> void), root: Element|null, state: {hovered: boolean, selected: boolean, focused: boolean}, x: number|null, y: number|null - } - } - namespace ojThematicMap { - type TooltipContext = - { - color: string|null, componentElement: Element, data: object|null, id: K1|K2|K3, itemData: D1|D2|D3, label: string|null, location: string|null, locationName: string|null, parentElement: Element, tooltip: string, x: number, y: number - } - } - -} -declare namespace oj { - class ojThematicMapArea extends JetElement { - categories: Array; - color: string; - label: string; - labelStyle: object; - location: string; - opacity: number; - selectable: 'auto'|'off'; - shortDesc: string; - svgClassName: string; - svgStyle: object; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - onLocationChanged: (event: CustomEvent)=> any; - onOpacityChanged: (event: CustomEvent)=> any; - onSelectableChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapAreaEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojThematicMapAreaEventMap extends oj.JetElementEventMap { - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - 'locationChanged': CustomEvent; - 'opacityChanged': CustomEvent; - 'selectableChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - } - interface ojThematicMapAreaSettableProperties extends JetSettableProperties { - categories: Array; - color: string; - label: string; - labelStyle: object; - location: string; - opacity: number; - selectable: 'auto'|'off'; - shortDesc: string; - svgClassName: string; - svgStyle: object; - } - -} -declare namespace oj { - class ojThematicMapLink extends JetElement { - categories: Array; - color: string; - endLocation: {id?: any, location?: string, x?: number, y?: number}; - selectable: 'auto'|'off'; - shortDesc: string; - startLocation: {id?: any, location?: string, x?: number, y?: number}; - svgClassName: string; - svgStyle: object; - width: number; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onEndLocationChanged: (event: CustomEvent)=> any; - onSelectableChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onStartLocationChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onWidthChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapLinkEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojThematicMapLinkEventMap extends oj.JetElementEventMap { - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'endLocationChanged': CustomEvent; - 'selectableChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'startLocationChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'widthChanged': CustomEvent; - } - interface ojThematicMapLinkSettableProperties extends JetSettableProperties { - categories: Array; - color: string; - endLocation: {id?: any, location?: string, x?: number, y?: number}; - selectable: 'auto'|'off'; - shortDesc: string; - startLocation: {id?: any, location?: string, x?: number, y?: number}; - svgClassName: string; - svgStyle: object; - width: number; - } - -} -declare namespace oj { - class ojThematicMapMarker extends JetElement { - borderColor: string; - borderStyle: 'solid'|'none'; - borderWidth: number; - categories: Array; - color: string; - height: number; - label: string; - labelPosition: 'bottom'|'center'|'top'; - labelStyle: object; - location: string; - opacity: number; - rotation: number; - selectable: 'auto'|'off'; - shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; - shortDesc: string; - source: string; - sourceHover: string; - sourceHoverSelected: string; - sourceSelected: string; - svgClassName: string; - svgStyle: object; - value: number; - width: number; - x: number|null; - y: number|null; - onBorderColorChanged: (event: CustomEvent)=> any; - onBorderStyleChanged: (event: CustomEvent)=> any; - onBorderWidthChanged: (event: CustomEvent)=> any; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onHeightChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onLabelPositionChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - onLocationChanged: (event: CustomEvent)=> any; - onOpacityChanged: (event: CustomEvent)=> any; - onRotationChanged: (event: CustomEvent)=> any; - onSelectableChanged: (event: CustomEvent)=> any; - onShapeChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSourceChanged: (event: CustomEvent)=> any; - onSourceHoverChanged: (event: CustomEvent)=> any; - onSourceHoverSelectedChanged: (event: CustomEvent)=> any; - onSourceSelectedChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - onWidthChanged: (event: CustomEvent)=> any; - onXChanged: (event: CustomEvent)=> any; - onYChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapMarkerEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojThematicMapMarkerEventMap extends oj.JetElementEventMap { - 'borderColorChanged': CustomEvent; - 'borderStyleChanged': CustomEvent; - 'borderWidthChanged': CustomEvent; - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'heightChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'labelPositionChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - 'locationChanged': CustomEvent; - 'opacityChanged': CustomEvent; - 'rotationChanged': CustomEvent; - 'selectableChanged': CustomEvent; - 'shapeChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'sourceChanged': CustomEvent; - 'sourceHoverChanged': CustomEvent; - 'sourceHoverSelectedChanged': CustomEvent; - 'sourceSelectedChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'valueChanged': CustomEvent; - 'widthChanged': CustomEvent; - 'xChanged': CustomEvent; - 'yChanged': CustomEvent; - } - interface ojThematicMapMarkerSettableProperties extends JetSettableProperties { - borderColor: string; - borderStyle: 'solid'|'none'; - borderWidth: number; - categories: Array; - color: string; - height: number; - label: string; - labelPosition: 'bottom'|'center'|'top'; - labelStyle: object; - location: string; - opacity: number; - rotation: number; - selectable: 'auto'|'off'; - shape?: 'circle'|'diamond'|'ellipse'|'human'|'plus'|'rectangle'|'square'|'star'|'triangleDown'|'triangleUp'|string; - shortDesc: string; - source: string; - sourceHover: string; - sourceHoverSelected: string; - sourceSelected: string; - svgClassName: string; - svgStyle: object; - value: number; - width: number; - x: number|null; - y: number|null; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts b/types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts deleted file mode 100644 index ba23106a05..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtime-base/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// -/// -declare namespace oj { - abstract class dvtTimeComponent extends dvtBaseComponent { - - addEventListener(type: T, listener: (this: HTMLElement, ev: dvtTimeComponentEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface dvtTimeComponentEventMap extends oj.dvtBaseComponentEventMap { - } - interface dvtTimeComponentSettableProperties extends dvtBaseComponentSettableProperties { - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts b/types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts deleted file mode 100644 index 1710eb655d..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtimeaxis/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// -/// -/// -declare namespace oj { - class ojTimeAxis extends dvtBaseComponent { - converter: oj.ojTimeAxis.Converter|oj.Converter; - end: string; - scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years'; - start: string; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - onConverterChanged: (event: CustomEvent)=> any; - onEndChanged: (event: CustomEvent)=> any; - onScaleChanged: (event: CustomEvent)=> any; - onStartChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTimeAxisEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojTimeAxisEventMap extends oj.dvtBaseComponentEventMap { - 'converterChanged': CustomEvent; - 'endChanged': CustomEvent; - 'scaleChanged': CustomEvent; - 'startChanged': CustomEvent; - } - interface ojTimeAxisSettableProperties extends dvtBaseComponentSettableProperties { - converter: oj.ojTimeAxis.Converter|oj.Converter; - end: string; - scale: 'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'quarters'|'years'; - start: string; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string}; - } - namespace ojTimeAxis { - type Converter = - { - default?: oj.Converter, seconds?: oj.Converter, minutes?: oj.Converter, hours?: oj.Converter, days?: oj.Converter, weeks?: oj.Converter, months?: oj.Converter, quarters?: oj.Converter, years?: oj.Converter - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts b/types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts deleted file mode 100644 index 9252a83ed8..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtimeutils/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare namespace oj { - class TimeUtils { - static getDate(pos: number, rangeStartTime: Date|string|number, rangeEndTime: Date|string|number, rangeWidth: number): number; - static getLength(startTime: Date|string|number, endTime: Date|string|number, rangeStartTime: Date|string|number, rangeEndTime: Date|string|number, rangeWidth: number): number; - static getPosition(time: Date|string|number, rangeStartTime: Date|string|number, rangeEndTime: Date|string|number, rangeWidth: number): number; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts b/types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts deleted file mode 100644 index a8eec009ec..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtoolbar/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// -declare namespace oj { - class ojToolbar extends baseComponent { - chroming: 'full'|'half'|'outlined'; - onChromingChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojToolbarEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - refresh(): void; - } - interface ojToolbarEventMap extends oj.baseComponentEventMap { - 'chromingChanged': CustomEvent; - } - interface ojToolbarSettableProperties extends baseComponentSettableProperties { - chroming: 'full'|'half'|'outlined'; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtrain/index.d.ts b/types/@oracle/oraclejet/ojs/ojtrain/index.d.ts deleted file mode 100644 index db6720b353..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtrain/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/// -declare namespace oj { - class ojTrain extends baseComponent { - selectedStep: string; - steps: Array; - onSelectedStepChanged: (event: CustomEvent)=> any; - onStepsChanged: (event: CustomEvent)=> any; - onOjBeforeDeselect: (event: oj.ojTrain.ojBeforeDeselect)=> any; - onOjBeforeSelect: (event: oj.ojTrain.ojBeforeSelect)=> any; - onOjDeselect: (event: oj.ojTrain.ojDeselect)=> any; - onOjSelect: (event: oj.ojTrain.ojSelect)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTrainEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getNextSelectableStep(): string|null; - getPreviousSelectableStep(): string|null; - getStep(id: string): oj.ojTrain.Step|null; - refresh(): void; - updateStep(id: string, stepProperties: {id?: string, label?: string, disabled?: boolean, visited?: boolean, messageType?: 'info'|'error'|'fatal'|'warning'}): void; - } - namespace ojTrain { - class ojBeforeDeselect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { - - } - - class ojBeforeSelect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { - - } - - class ojDeselect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { - - } - - class ojSelect extends CustomEvent<{toStep: string, fromStep: string, [propName: string]: any}> { - - } - } - interface ojTrainEventMap extends oj.baseComponentEventMap { - 'ojBeforeDeselect': oj.ojTrain.ojBeforeDeselect; - 'ojBeforeSelect': oj.ojTrain.ojBeforeSelect; - 'ojDeselect': oj.ojTrain.ojDeselect; - 'ojSelect': oj.ojTrain.ojSelect; - 'selectedStepChanged': CustomEvent; - 'stepsChanged': CustomEvent; - } - interface ojTrainSettableProperties extends baseComponentSettableProperties { - selectedStep: string; - steps: Array; - } - namespace ojTrain { - type Step = - { - id: string, label: string, disabled?: boolean, visited?: boolean, messageType?: 'info'|'error'|'fatal'|'warning' - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts b/types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts deleted file mode 100644 index 333e0208ec..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtreedataprovider/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -declare namespace oj { - interface TreeDataProvider extends DataProvider { - getChildDataProvider(any): TreeDataProvider - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts b/types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts deleted file mode 100644 index 96a1db2873..0000000000 --- a/types/@oracle/oraclejet/ojs/ojtreemap/index.d.ts +++ /dev/null @@ -1,241 +0,0 @@ -/// -/// -declare namespace oj { - class ojTreemap extends dvtBaseComponent> { - animationDuration: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - animationUpdateColor: string; - as: string; - colorLabel: string; - data: oj.DataProvider|null; - displayLevels: number; - drilling: 'on'|'off'; - groupGaps: 'all'|'none'|'outer'; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - isolatedNode: any; - layout: 'sliceAndDiceHorizontal'|'sliceAndDiceVertical'|'squarified'; - nodeContent: {renderer: ((context: oj.ojTreemap.NodeContentContext) => ({insert: Element|string}))}; - nodeDefaults: {groupLabelDisplay: 'node'|'off'|'header', header: {backgroundColor: string, borderColor: string, hoverBackgroundColor: string, hoverInnerColor: string, hoverOuterColor: string, isolate: 'off'|'on', labelHalign: 'center'|'end'|'start', labelStyle: object, selectedBackgroundColor: string, selectedInnerColor: string, selectedOuterColor: string, useNodeColor: 'on'|'off'}, hoverColor: string, labelDisplay: 'off'|'node', labelHalign: 'start'|'end'|'center', labelMinLength: number, labelStyle: object, labelValign: 'top'|'bottom'|'center', selectedInnerColor: string, selectedOuterColor: string}; - nodeSeparators: 'bevels'|'gaps'; - rootNode: any; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - sizeLabel: string; - sorting: 'on'|'off'; - tooltip: {renderer: ((context: oj.ojTreemap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipIsolate?: string, tooltipRestore?: string}; - onAnimationDurationChanged: (event: CustomEvent)=> any; - onAnimationOnDataChangeChanged: (event: CustomEvent)=> any; - onAnimationOnDisplayChanged: (event: CustomEvent)=> any; - onAnimationUpdateColorChanged: (event: CustomEvent)=> any; - onAsChanged: (event: CustomEvent)=> any; - onColorLabelChanged: (event: CustomEvent)=> any; - onDataChanged: (event: CustomEvent)=> any; - onDisplayLevelsChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onGroupGapsChanged: (event: CustomEvent)=> any; - onHiddenCategoriesChanged: (event: CustomEvent)=> any; - onHighlightMatchChanged: (event: CustomEvent)=> any; - onHighlightedCategoriesChanged: (event: CustomEvent)=> any; - onHoverBehaviorChanged: (event: CustomEvent)=> any; - onHoverBehaviorDelayChanged: (event: CustomEvent)=> any; - onIsolatedNodeChanged: (event: CustomEvent)=> any; - onLayoutChanged: (event: CustomEvent)=> any; - onNodeContentChanged: (event: CustomEvent)=> any; - onNodeDefaultsChanged: (event: CustomEvent)=> any; - onNodeSeparatorsChanged: (event: CustomEvent)=> any; - onRootNodeChanged: (event: CustomEvent)=> any; - onSelectionChanged: (event: CustomEvent)=> any; - onSelectionModeChanged: (event: CustomEvent)=> any; - onSizeLabelChanged: (event: CustomEvent)=> any; - onSortingChanged: (event: CustomEvent)=> any; - onTooltipChanged: (event: CustomEvent)=> any; - onTouchResponseChanged: (event: CustomEvent)=> any; - onOjBeforeDrill: (event: oj.ojTreemap.ojBeforeDrill)=> any; - onOjDrill: (event: oj.ojTreemap.ojDrill)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTreemapEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - getContextByNode(node: Element): oj.ojTreemap.NodeContext|null; - getNode(subIdPath: Array): oj.ojTreemap.DataContext|null; - } - namespace ojTreemap { - class ojBeforeDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - - class ojDrill extends CustomEvent<{id: any, data: object, itemData: object, [propName: string]: any}> { - - } - } - interface ojTreemapEventMap extends oj.dvtBaseComponentEventMap { - 'ojBeforeDrill': oj.ojTreemap.ojBeforeDrill; - 'ojDrill': oj.ojTreemap.ojDrill; - 'animationDurationChanged': CustomEvent; - 'animationOnDataChangeChanged': CustomEvent; - 'animationOnDisplayChanged': CustomEvent; - 'animationUpdateColorChanged': CustomEvent; - 'asChanged': CustomEvent; - 'colorLabelChanged': CustomEvent; - 'dataChanged': CustomEvent; - 'displayLevelsChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'groupGapsChanged': CustomEvent; - 'hiddenCategoriesChanged': CustomEvent; - 'highlightMatchChanged': CustomEvent; - 'highlightedCategoriesChanged': CustomEvent; - 'hoverBehaviorChanged': CustomEvent; - 'hoverBehaviorDelayChanged': CustomEvent; - 'isolatedNodeChanged': CustomEvent; - 'layoutChanged': CustomEvent; - 'nodeContentChanged': CustomEvent; - 'nodeDefaultsChanged': CustomEvent; - 'nodeSeparatorsChanged': CustomEvent; - 'rootNodeChanged': CustomEvent; - 'selectionChanged': CustomEvent; - 'selectionModeChanged': CustomEvent; - 'sizeLabelChanged': CustomEvent; - 'sortingChanged': CustomEvent; - 'tooltipChanged': CustomEvent; - 'touchResponseChanged': CustomEvent; - } - interface ojTreemapSettableProperties extends dvtBaseComponentSettableProperties { - animationDuration: number; - animationOnDataChange: 'auto'|'none'; - animationOnDisplay: 'auto'|'none'; - animationUpdateColor: string; - as: string; - colorLabel: string; - data: oj.DataProvider|null; - displayLevels: number; - drilling: 'on'|'off'; - groupGaps: 'all'|'none'|'outer'; - hiddenCategories: Array; - highlightMatch: 'any'|'all'; - highlightedCategories: Array; - hoverBehavior: 'dim'|'none'; - hoverBehaviorDelay: number; - isolatedNode: any; - layout: 'sliceAndDiceHorizontal'|'sliceAndDiceVertical'|'squarified'; - nodeContent: {renderer: ((context: oj.ojTreemap.NodeContentContext) => ({insert: Element|string}))}; - nodeDefaults: {groupLabelDisplay: 'node'|'off'|'header', header: {backgroundColor: string, borderColor: string, hoverBackgroundColor: string, hoverInnerColor: string, hoverOuterColor: string, isolate: 'off'|'on', labelHalign: 'center'|'end'|'start', labelStyle: object, selectedBackgroundColor: string, selectedInnerColor: string, selectedOuterColor: string, useNodeColor: 'on'|'off'}, hoverColor: string, labelDisplay: 'off'|'node', labelHalign: 'start'|'end'|'center', labelMinLength: number, labelStyle: object, labelValign: 'top'|'bottom'|'center', selectedInnerColor: string, selectedOuterColor: string}; - nodeSeparators: 'bevels'|'gaps'; - rootNode: any; - selection: Array; - selectionMode: 'none'|'single'|'multiple'; - sizeLabel: string; - sorting: 'on'|'off'; - tooltip: {renderer: ((context: oj.ojTreemap.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))}; - touchResponse: 'touchStart'|'auto'; - translations: {componentName?: string, labelAndValue?: string, labelClearSelection?: string, labelColor?: string, labelCountWithTotal?: string, labelDataVisualization?: string, labelInvalidData?: string, labelNoData?: string, labelSize?: string, stateCollapsed?: string, stateDrillable?: string, stateExpanded?: string, stateHidden?: string, stateIsolated?: string, stateMaximized?: string, stateMinimized?: string, stateSelected?: string, stateUnselected?: string, stateVisible?: string, tooltipIsolate?: string, tooltipRestore?: string}; - } - namespace ojTreemap { - type DataContext = - { - color: string, label: string, selected: boolean, size: number, tooltip: string - } - } - namespace ojTreemap { - type NodeContentContext = - { - bounds: {x: number, y: number, width: number, height: number}, id: K, data: object, itemData: D, componentElement: Element - } - } - namespace ojTreemap { - type NodeContext = - { - subId: string, indexPath: Array - } - } - namespace ojTreemap { - type TooltipContext = - { - parentElement: Element, id: K, label: string, value: number, color: string, data: object, itemData: D, componentElement: Element - } - } - -} -declare namespace oj { - class ojTreemapNode extends JetElement { - categories?: Array; - color?: string; - drilling?: 'on'|'off'|'inherit'; - groupLabelDisplay?: 'node'|'off'|'header'; - header?: {isolate?: 'off'|'on', labelHalign?: 'center'|'end'|'start', labelStyle?: object, useNodeColor?: 'on'|'off'}; - label?: string; - labelDisplay?: 'off'|'node'; - labelHalign?: 'start'|'end'|'center'; - labelStyle?: object; - labelValign?: 'top'|'bottom'|'center'; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; - selectable?: 'off'|'auto'; - shortDesc?: string; - svgClassName?: string; - svgStyle?: object; - value: number; - onCategoriesChanged: (event: CustomEvent)=> any; - onColorChanged: (event: CustomEvent)=> any; - onDrillingChanged: (event: CustomEvent)=> any; - onGroupLabelDisplayChanged: (event: CustomEvent)=> any; - onHeaderChanged: (event: CustomEvent)=> any; - onLabelChanged: (event: CustomEvent)=> any; - onLabelDisplayChanged: (event: CustomEvent)=> any; - onLabelHalignChanged: (event: CustomEvent)=> any; - onLabelStyleChanged: (event: CustomEvent)=> any; - onLabelValignChanged: (event: CustomEvent)=> any; - onPatternChanged: (event: CustomEvent)=> any; - onSelectableChanged: (event: CustomEvent)=> any; - onShortDescChanged: (event: CustomEvent)=> any; - onSvgClassNameChanged: (event: CustomEvent)=> any; - onSvgStyleChanged: (event: CustomEvent)=> any; - onValueChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojTreemapNodeEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - } - interface ojTreemapNodeEventMap extends oj.JetElementEventMap { - 'categoriesChanged': CustomEvent; - 'colorChanged': CustomEvent; - 'drillingChanged': CustomEvent; - 'groupLabelDisplayChanged': CustomEvent; - 'headerChanged': CustomEvent; - 'labelChanged': CustomEvent; - 'labelDisplayChanged': CustomEvent; - 'labelHalignChanged': CustomEvent; - 'labelStyleChanged': CustomEvent; - 'labelValignChanged': CustomEvent; - 'patternChanged': CustomEvent; - 'selectableChanged': CustomEvent; - 'shortDescChanged': CustomEvent; - 'svgClassNameChanged': CustomEvent; - 'svgStyleChanged': CustomEvent; - 'valueChanged': CustomEvent; - } - interface ojTreemapNodeSettableProperties extends JetSettableProperties { - categories?: Array; - color?: string; - drilling?: 'on'|'off'|'inherit'; - groupLabelDisplay?: 'node'|'off'|'header'; - header?: {isolate?: 'off'|'on', labelHalign?: 'center'|'end'|'start', labelStyle?: object, useNodeColor?: 'on'|'off'}; - label?: string; - labelDisplay?: 'off'|'node'; - labelHalign?: 'start'|'end'|'center'; - labelStyle?: object; - labelValign?: 'top'|'bottom'|'center'; - pattern?: 'smallChecker'|'smallCrosshatch'|'smallDiagonalLeft'|'smallDiagonalRight'|'smallDiamond'|'smallTriangle'|'largeChecker'|'largeCrosshatch'|'largeDiagonalLeft'|'largeDiagonalRight'|'largeDiamond'|'largeTriangle'|'none'; - selectable?: 'off'|'auto'; - shortDesc?: string; - svgClassName?: string; - svgStyle?: object; - value: number; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts deleted file mode 100644 index 01a6280ff9..0000000000 --- a/types/@oracle/oraclejet/ojs/ojvalidation-base/index.d.ts +++ /dev/null @@ -1,188 +0,0 @@ -/// -/// -declare namespace oj { - interface AsyncValidator { - hint: Promise; - validate(value: V): Promise - } - -} -declare namespace oj { - class ColorConverter extends Converter { - constructor(options?: oj.ColorConverter.ConverterOptions); - format(color: oj.Color): string|null; - getHint(): string; - parse(value: string): oj.Color; - resolvedOptions(): oj.ColorConverter.ConverterOptions; - } - namespace ColorConverter { - type ConverterOptions = - { - format?: 'rgb'|'hsl'|'hsv'|'hex'|'hex3' - } - } - -} -declare namespace oj { - class ColorConverterFactory { - createConverter(options?: oj.ColorConverter.ConverterOptions): oj.ColorConverter; - } - -} -declare namespace oj { - class Converter { - format(value: V): string|null; - getHint?(): string|null - getOptions?(): object - parse(value: string): V; - resolvedOptions?(): object - } - -} -declare namespace oj { - class ConverterError { - constructor(summary: string, detail: string); - getMessage(): oj.Message; - } - -} -declare namespace oj { - class ConverterFactory { - static CONVERTER_TYPE_COLOR: string; - static CONVERTER_TYPE_DATETIME: string; - static CONVERTER_TYPE_NUMBER: string; - createConverter(options: object|null): oj.Converter; - } - -} -declare namespace oj { - class IntlConverterUtils { - static dateToLocalIso(date: Date): string; - static getConverterInstance(converterOption: string|oj.Validation.RegisteredConverter|oj.Converter): oj.Converter|null - static getInitials(firstName?: string, lastName?: string): string|undefined; - static getLocalTimeZoneOffset(): string; - static isoToDate(isoString: string): Date; - static isoToLocalDate(isoString: string): Date; - } - -} -declare namespace oj { - class LengthValidator extends Validator { - static defaults: {countBy: string}; - constructor(options?: oj.LengthValidator.ValidatorOptions); - getHint(): string|null; - validate(value: string|number): void; - } - namespace LengthValidator { - type ValidatorOptions = - { - countBy?: 'codeUnit'|'codePoint', min?: number, max?: number, hint?: {max?: string, min?: string, inRange?: string, exact?: string}, messageDetail?: {tooLong?: string, tooShort?: string}, messageSummary?: {tooLong?: string, tooShort?: string} - } - } - -} -declare namespace oj { - class LengthValidatorFactory { - createValidator(options?: oj.LengthValidator.ValidatorOptions): oj.LengthValidator; - } - -} -declare namespace oj { - class LocaleData { - static getDayNames(type?: 'abbreviated'|'narrow'|'wide'): Array; - static getFirstDayOfWeek(): number; - static getMonthNames(type?: 'abbreviated'|'narrow'|'wide'): Array; - static getWeekendEnd(): number; - static getWeekendStart(): number; - static isMonthPriorToYear(): boolean; - static setBundle(bundle: object): void; - } - -} -declare namespace oj { - class RegExpValidator extends Validator { - constructor(options?: oj.RegExpValidator.ValidatorOptions); - getHint(): string|null; - validate(value: string|number): void; - } - namespace RegExpValidator { - type ValidatorOptions = - { - pattern?: string, hint?: string, messageSummary?: string, messageDetail?: string - } - } - -} -declare namespace oj { - class RegExpValidatorFactory { - createValidator(options: oj.RegExpValidator.ValidatorOptions): oj.RegExpValidator; - } - -} -declare namespace oj { - class RequiredValidator extends Validator { - constructor(options?: oj.RequiredValidator.ValidatorOptions); - getHint(): string|null; - validate(value: object|string|number): void; - } - namespace RequiredValidator { - type ValidatorOptions = - { - hint?: string, messageSummary?: string, messageDetail?: string - } - } - -} -declare namespace oj { - class RequiredValidatorFactory { - createValidator(options?: oj.RequiredValidator.ValidatorOptions): oj.RequiredValidator; - } - -} -declare namespace oj { - class Validation { - static converterFactory>(type:'number'|'color'|'datetime'|string, instance?:CF): CF|null - static getDefaultConverterFactory(type: 'number'|'color'|'datetime'): oj.ConverterFactory|null - static getDefaultValidatorFactory(type: 'required'|'regexp'|'numberRange'|'length'|'dateTimeRange'|'dateRestriction'): oj.ValidatorFactory|null - static validatorFactory>(type:'required'|'regexp'|'numberRange'|'length'|'dateTimeRange'|'dateRestriction'|string, instance?:VF): VF|null - } - namespace Validation { - type RegisteredConverter = - { - type: string, options?: object - } - } - namespace Validation { - type RegisteredValidator = - { - type: string, options?: object - } - } - -} -declare namespace oj { - class Validator { - getHint?(): string|null - validate(value: V): void; - } - -} -declare namespace oj { - class ValidatorError { - constructor(summary: string, detail: string); - getMessage(): oj.Message; - } - -} -declare namespace oj { - class ValidatorFactory { - static VALIDATOR_TYPE_DATERESTRICTION: string; - static VALIDATOR_TYPE_DATETIMERANGE: string; - static VALIDATOR_TYPE_LENGTH: string; - static VALIDATOR_TYPE_NUMBERRANGE: string; - static VALIDATOR_TYPE_REGEXP: string; - static VALIDATOR_TYPE_REQUIRED: string; - createValidator(options: object|null): oj.Validator; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts deleted file mode 100644 index f4ab6b312b..0000000000 --- a/types/@oracle/oraclejet/ojs/ojvalidation-datetime/index.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -/// -declare namespace oj { - class DateRestrictionValidator extends Validator { - constructor(options?: oj.DateRestrictionValidator.ValidatorOptions); - getHint(): string|null; - validate(value: string): void; - } - namespace DateRestrictionValidator { - type DayFormatterInput = - { - fullYear: number, month: number, date: number - } - } - namespace DateRestrictionValidator { - type DayFormatterOutput = - { - disabled?: boolean, className?: string, tooltip?: string - } - } - namespace DateRestrictionValidator { - type ValidatorOptions = - { - dayFormatter?: ((param0: oj.DateRestrictionValidator.DayFormatterInput)=> oj.DateRestrictionValidator.DayFormatterOutput|null|'all'), messageSummary?: string, messageDetail?: string - } - } - -} -declare namespace oj { - class DateRestrictionValidatorFactory { - createValidator(options?: oj.DateRestrictionValidator.ValidatorOptions): oj.DateRestrictionValidator; - } - -} -declare namespace oj { - abstract class DateTimeConverter extends Converter { - abstract calculateWeek(value: string): number|undefined; - compareISODates(isoStr: string, isoStr2: string): number; - format(value: string): string|null; - getAvailableTimeZones(): Array; - abstract isDayNameSet():boolean - abstract isDaySet():boolean - abstract isHourInAMPMSet():boolean - abstract isHourInDaySet():boolean - abstract isMilliSecondSet():boolean - abstract isMinuteSet():boolean - abstract isMonthSet():boolean - abstract isSecondSet():boolean - abstract isYearSet():boolean - parse(value: string): string; - } - -} -declare namespace oj { - class DateTimeConverterFactory { - createConverter(options?: oj.IntlDateTimeConverter.ConverterOptions): oj.IntlDateTimeConverter; - } - -} -declare namespace oj { - class DateTimeRangeValidator extends Validator { - constructor(options?: oj.DateTimeRangeValidator.ValidatorOptions); - getHint(): string|null; - validate(value: string): void; - } - namespace DateTimeRangeValidator { - type ValidatorOptions = - { - converter: oj.DateTimeConverter, min?: string, max?: string, hint?: {max?: string, min?: string, inRange?: string}, translationKey?: string, messageDetail?: {rangeUnderflow?: string, rangeOverflow?: string}, messageSummary?: {rangeUnderflow?: string, rangeOverflow?: string} - } - } - -} -declare namespace oj { - class DateTimeRangeValidatorFactory { - createValidator(options?: oj.DateTimeRangeValidator.ValidatorOptions): oj.DateTimeRangeValidator; - } - -} -declare namespace oj { - class IntlDateTimeConverter extends DateTimeConverter { - constructor(options?: oj.IntlDateTimeConverter.ConverterOptions); - calculateWeek(value: string): number; - compareISODates(isoStr: string, isoStr2: string): number; - format(value: string): string|null; - formatRelative(value: string, relativeOptions?: {formatUsing?: string, dateField?: string, relativeTime?: string, dateOnly?: boolean, timeZone?: string}): string|null; - getAvailableTimeZones(): Array; - getHint(): null; - getOptions(): oj.IntlDateTimeConverter.ConverterOptions; - isDayNameSet(): boolean; - isDaySet(): boolean; - isHourInAMPMSet(): boolean; - isHourInDaySet(): boolean; - isMilliSecondSet(): boolean; - isMinuteSet(): boolean; - isMonthSet(): boolean; - isSecondSet(): boolean; - isYearSet(): boolean; - parse(value: string): string|null; - resolvedOptions(): oj.IntlDateTimeConverter.ConverterOptions; - } - namespace IntlDateTimeConverter { - type ConverterOptions = - { - year?: '2-digit'|'numeric', 'two-digit-year-start'?: number, month?: '2-digit'|'numeric'|'narrow'|'short'|'long', day?: '2-digit'|'numeric', hour?: '2-digit'|'numeric', minute?: '2-digit'|'numeric', second?: '2-digit'|'numeric', millisecond?: 'numeric', weekday?: 'narrow'|'short'|'long', era?: 'narrow'|'short'|'long', timeZoneName?: 'short'|'long', timeZone?: string, isoStrFormat?: 'offset'|'zulu'|'local'|'auto', dst?: boolean, hour12?: boolean, pattern?: string, formatType?: 'date'|'time'|'datetime', dateFormat?: 'short'|'medium'|'long'|'full', timeFormat?: 'short'|'medium'|'long'|'full', lenientParse?: 'full'|'none' - } - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts deleted file mode 100644 index d53b2b8258..0000000000 --- a/types/@oracle/oraclejet/ojs/ojvalidation-number/index.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/// -declare namespace oj { - class IntlNumberConverter extends NumberConverter { - constructor(options?: oj.IntlNumberConverter.ConverterOptions); - format(value: number): string; - getHint(): null; - getOptions(): oj.IntlNumberConverter.ConverterOptions; - parse(value: string): number|null; - resolvedOptions(): oj.IntlNumberConverter.ConverterOptions; - } - namespace IntlNumberConverter { - type ConverterOptions = - { - style?: 'decimal'|'currency'|'percent'|'unit', currency?: string, unit?: 'byte'|'bit', currencyDisplay?: 'code'|'symbol'|'name', decimalFormat?: 'standard'|'short'|'long', currencyFormat?: 'standard'|'short'|'long', minimumIntegerDigits?: number, minimumFractionDigits?: number, maximumFractionDigits?: number, useGrouping?: boolean, pattern?: string, roundingMode?: 'HALF_UP'|'HALF_DOWN'|'HALF_EVEN', roundDuringParse?: boolean, separators?: object, lenientParse?: 'full'|'none' - } - } - -} -declare namespace oj { - class NumberConverter extends Converter { - format(value: number): string|null; - parse(value: string): number; - } - -} -declare namespace oj { - class NumberConverterFactory { - createConverter(options?: oj.IntlNumberConverter.ConverterOptions): oj.IntlNumberConverter; - } - -} -declare namespace oj { - class NumberRangeValidator extends Validator { - constructor(options?: oj.NumberRangeValidator.ValidatorOptions); - getHint(): string|null; - validate(value: string|number): void; - } - namespace NumberRangeValidator { - type ValidatorOptions = - { - converter?: oj.NumberConverter, min?: number, max?: number, hint?: {max?: string, min?: string, inRange?: string, exact?: string}, messageDetail?: {rangeUnderflow?: string, rangeOverflow?: string, exact?: string}, messageSummary?: {rangeUnderflow?: string, rangeOverflow?: string} - } - } - -} -declare namespace oj { - class NumberRangeValidatorFactory { - createValidator(options?: oj.NumberRangeValidator.ValidatorOptions): oj.NumberRangeValidator; - } - -} diff --git a/types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts b/types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts deleted file mode 100644 index c714ed9ecc..0000000000 --- a/types/@oracle/oraclejet/ojs/ojvalidationgroup/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -declare namespace oj { - class ojValidationGroup extends JetElement { - readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; - onValidChanged: (event: CustomEvent)=> any; - - addEventListener(type: T, listener: (this: HTMLElement, ev: ojValidationGroupEventMap[T]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - - focusOn(key?: '@firstInvalidShown'): void; - getProperty(property: string): any; - setProperties(properties: object): void; - setProperty(property: string, value: any): void; - showMessages(): void; - } - interface ojValidationGroupEventMap extends oj.JetElementEventMap { - 'validChanged': CustomEvent; - } - interface ojValidationGroupSettableProperties extends JetSettableProperties { - readonly valid: 'valid'|'pending'|'invalidHidden'|'invalidShown'; - } - -} diff --git a/types/@oracle/tests/oraclejet/@oraclejet-tests.ts b/types/@oracle/tests/oraclejet/@oraclejet-tests.ts deleted file mode 100644 index 9fc8ff4951..0000000000 --- a/types/@oracle/tests/oraclejet/@oraclejet-tests.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. - * The Universal Permissive License (UPL), Version 1.0 - */ -import "ojs/ojcore"; -import "ojs/ojinputtext"; -import "ojs/ojinputnumber"; - -/** - * @public - * @export - */ -class Test { - value: string; - - constructor() { - let self = this; - self.value = "Good Morning"; - - let textInput = document.getElementById('text-input') as oj.ojInputText; - //test a custom API of the component - let rawVal: string = textInput.rawValue; - } -} - -export = Test; \ No newline at end of file diff --git a/types/@oracle/tslint.json b/types/@oracle/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/@oracle/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/oraclejet/index.d.ts b/types/oraclejet/index.d.ts new file mode 100644 index 0000000000..dd99802419 --- /dev/null +++ b/types/oraclejet/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for oraclejet 6.0 +// Project: https://github.com/oracle/oraclejet +// Definitions by: Naizam Olakara +// Jing Wu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 +import { Model, Collection } from './ojmodel'; +export namespace oj { + let revision: string; + let version: string; + function ajax(settings?: object): object; + function sync(method: string, model: Model | Collection, options?: object): object; +} +export interface baseComponent extends JetElement { + translations: object | null; + onTranslationsChanged: ((event: JetElementCustomEvent["translations"]>) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: baseComponentEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): baseComponent[T]; + getProperty(property: string): any; + setProperty(property: T, value: baseComponentSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: baseComponentSettablePropertiesLenient): void; + refresh(): void; +} +export interface baseComponentEventMap extends HTMLElementEventMap { + 'translationsChanged': JetElementCustomEvent["translations"]>; +} +export interface baseComponentSettableProperties extends JetSettableProperties { + translations: object | null; +} +export interface baseComponentSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface GenericSetter { + set(propertyName: K, propertyValue: SP[K]): void; + unset(propertyName: keyof SP): void; +} +export interface JetElement extends HTMLElement, GenericSetter { + set(propertyName: K, propertyValue: SP[K]): void; + unset(propertyName: keyof SP): void; +} +export interface JetElementCustomEvent extends CustomEvent<{ + value: V; + previousValue: V; + updatedFrom: 'external' | 'internal'; + subproperty: { + path: string; + value: any; + previousValue: any; + [key: string]: any; + }; + [key: string]: any; +}> { +} +// This interfaces is empty but required to keep the component chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface JetSettableProperties { +} +export type JetSetPropertyType = K extends keyof U ? U[K] : any; diff --git a/types/oraclejet/ojaccordion/index.d.ts b/types/oraclejet/ojaccordion/index.d.ts new file mode 100644 index 0000000000..15d843d90e --- /dev/null +++ b/types/oraclejet/ojaccordion/index.d.ts @@ -0,0 +1,66 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojAccordion extends baseComponent { + expanded: Array<{ + id?: string; + index?: number; + }> | null; + multiple: boolean; + onExpandedChanged: ((event: JetElementCustomEvent) => any) | null; + onMultipleChanged: ((event: JetElementCustomEvent) => any) | null; + onOjBeforeCollapse: ((event: ojAccordion.ojBeforeCollapse) => any) | null; + onOjBeforeExpand: ((event: ojAccordion.ojBeforeExpand) => any) | null; + onOjCollapse: ((event: ojAccordion.ojCollapse) => any) | null; + onOjExpand: ((event: ojAccordion.ojExpand) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojAccordionEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojAccordion[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojAccordionSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojAccordionSettablePropertiesLenient): void; + refresh(): void; +} +export namespace ojAccordion { + interface ojBeforeCollapse extends CustomEvent<{ + toCollapsible: Element; + fromCollapsible: Element; + [propName: string]: any; + }> { + } + interface ojBeforeExpand extends CustomEvent<{ + toCollapsible: Element; + fromCollapsible: Element; + [propName: string]: any; + }> { + } + interface ojCollapse extends CustomEvent<{ + toCollapsible: Element; + fromCollapsible: Element; + [propName: string]: any; + }> { + } + interface ojExpand extends CustomEvent<{ + toCollapsible: Element; + fromCollapsible: Element; + [propName: string]: any; + }> { + } +} +export interface ojAccordionEventMap extends baseComponentEventMap { + 'ojBeforeCollapse': ojAccordion.ojBeforeCollapse; + 'ojBeforeExpand': ojAccordion.ojBeforeExpand; + 'ojCollapse': ojAccordion.ojCollapse; + 'ojExpand': ojAccordion.ojExpand; + 'expandedChanged': JetElementCustomEvent; + 'multipleChanged': JetElementCustomEvent; +} +export interface ojAccordionSettableProperties extends baseComponentSettableProperties { + expanded: string[] | number[] | Array<{ + id?: string; + index?: number; + }> | null; + multiple: boolean; +} +export interface ojAccordionSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojanimation/index.d.ts b/types/oraclejet/ojanimation/index.d.ts new file mode 100644 index 0000000000..e4b1d6dbc2 --- /dev/null +++ b/types/oraclejet/ojanimation/index.d.ts @@ -0,0 +1,111 @@ +export function collapse(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + direction?: string; + startMaxHeight?: string; + endMaxHeight?: string; + startMaxWidth?: string; + endMaxWidth?: string; +}): Promise; +export function expand(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + direction?: string; + startMaxHeight?: string; + endMaxHeight?: string; + startMaxWidth?: string; + endMaxWidth?: string; +}): Promise; +export function fadeIn(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + startOpacity?: number; + endOpacity?: number; +}): Promise; +export function fadeOut(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + startOpacity?: number; + endOpacity?: number; +}): Promise; +export function flipIn(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + axis?: string; + startAngle?: string; + endAngle?: string; + backfaceVisibility?: string; + perspective?: string; + transformOrigin?: string; + flipTarget?: string; +}): Promise; +export function flipOut(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + axis?: string; + startAngle?: string; + endAngle?: string; + backfaceVisibility?: string; + perspective?: string; + transformOrigin?: string; + flipTarget?: string; +}): Promise; +export function ripple(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + offsetX?: string; + offsetY?: string; + color?: string; + diameter?: string; + startOpacity?: number; + endOpacity?: number; +}): Promise; +export function slideIn(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + direction?: string; + offsetX?: string; + offsetY?: string; +}): Promise; +export function slideOut(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + direction?: string; + offsetX?: string; + offsetY?: string; +}): Promise; +export function zoomIn(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + axis?: string; + transformOrigin?: string; +}): Promise; +export function zoomOut(element: Element, options?: { + delay?: string; + duration?: string; + timingFunction?: string; + persist?: string; + axis?: string; + transformOrigin?: string; +}): Promise; +// tslint:disable-next-line interface-over-type-literal +export type AnimationMethods = 'collapse' | 'expand' | 'fadeIn' | 'fadeOut' | 'flipIn' | 'flipOut' | 'ripple' | 'slideIn' | 'slideOut' | 'zoomIn' | 'zoomOut'; diff --git a/types/oraclejet/ojarraydataprovider/index.d.ts b/types/oraclejet/ojarraydataprovider/index.d.ts new file mode 100644 index 0000000000..884920c03e --- /dev/null +++ b/types/oraclejet/ojarraydataprovider/index.d.ts @@ -0,0 +1,27 @@ +import { DataProvider, SortCriterion, FetchByKeysParameters, ContainsKeysResults, FetchByKeysResults, FetchByOffsetParameters, FetchByOffsetResults, FetchListResult, + FetchListParameters } from '../ojdataprovider'; +declare class ArrayDataProvider implements DataProvider { + constructor(data: any[] | (() => any[]), options?: { + sortComparators?: ArrayDataProvider.SortComparators; + implicitSort?: Array>; + keys?: any[] | (() => any[]); + idAttribute?: string | string[]; + keyAttributes?: string | string[]; + }); + addEventListener(eventType: string, listener: EventListener): void; + containsKeys(params: FetchByKeysParameters): Promise>; + dispatchEvent(evt: Event): boolean; + fetchByKeys(params: FetchByKeysParameters): Promise>; + fetchByOffset(params: FetchByOffsetParameters): Promise>; + fetchFirst(params?: FetchListParameters): AsyncIterable>; + getCapability(capabilityName?: string): any; + getTotalSize(): Promise; + isEmpty(): 'yes' | 'no' | 'unknown'; + removeEventListener(eventType: string, listener: EventListener): void; +} +export = ArrayDataProvider; +declare namespace ArrayDataProvider { + interface SortComparators { + comparators: Map number>; + } +} diff --git a/types/oraclejet/ojarraytreedataprovider/index.d.ts b/types/oraclejet/ojarraytreedataprovider/index.d.ts new file mode 100644 index 0000000000..452b47a910 --- /dev/null +++ b/types/oraclejet/ojarraytreedataprovider/index.d.ts @@ -0,0 +1,25 @@ +import { DataProvider, SortCriterion, FetchByKeysParameters, ContainsKeysResults, FetchByKeysResults, FetchByOffsetParameters, FetchByOffsetResults, FetchListResult, + FetchListParameters } from '../ojdataprovider'; +import ArrayDataProvider = require('../ojarraydataprovider'); +import TreeDataProvider = require('../ojtreedataprovider'); +declare class ArrayTreeDataProvider implements TreeDataProvider { + constructor(data: any[] | (() => any[]), options?: { + sortComparators?: ArrayDataProvider.SortComparators; + implicitSort?: Array>; + keyAttributes?: string | string[]; + keyAttributesScope?: 'global' | 'siblings'; + childrenAttribute?: string; + }); + addEventListener(eventType: string, listener: EventListener): void; + containsKeys(params: FetchByKeysParameters): Promise>; + dispatchEvent(evt: Event): boolean; + fetchByKeys(params: FetchByKeysParameters): Promise>; + fetchByOffset(params: FetchByOffsetParameters): Promise>; + fetchFirst(params?: FetchListParameters): AsyncIterable>; + getCapability(capabilityName?: string): any; + getChildDataProvider(parentKey: any): ArrayTreeDataProvider; + getTotalSize(): Promise; + isEmpty(): 'yes' | 'no' | 'unknown'; + removeEventListener(eventType: string, listener: EventListener): void; +} +export = ArrayTreeDataProvider; diff --git a/types/oraclejet/ojattributegrouphandler/index.d.ts b/types/oraclejet/ojattributegrouphandler/index.d.ts new file mode 100644 index 0000000000..3442581069 --- /dev/null +++ b/types/oraclejet/ojattributegrouphandler/index.d.ts @@ -0,0 +1,23 @@ +export class AttributeGroupHandler { + constructor(matchRules?: { + [propName: string]: any; + }); + addMatchRule(category: string, attributeValue: any): void; + getCategoryAssignments(): Array<{ + [propName: string]: any; + }>; + getValue(category: string): any; + getValueRamp(): any[]; +} +export class ColorAttributeGroupHandler extends AttributeGroupHandler { + constructor(matchRules?: { + [propName: string]: any; + }); + getValueRamp(): string[]; +} +export class ShapeAttributeGroupHandler extends AttributeGroupHandler { + constructor(matchRules?: { + [propName: string]: any; + }); + getValueRamp(): string[]; +} diff --git a/types/oraclejet/ojavatar/index.d.ts b/types/oraclejet/ojavatar/index.d.ts new file mode 100644 index 0000000000..ed82db0a5e --- /dev/null +++ b/types/oraclejet/ojavatar/index.d.ts @@ -0,0 +1,29 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojAvatar extends JetElement { + initials: string; + size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; + src: string; + onInitialsChanged: ((event: JetElementCustomEvent) => any) | null; + onSizeChanged: ((event: JetElementCustomEvent) => any) | null; + onSrcChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojAvatarEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojAvatar[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojAvatarSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojAvatarSettablePropertiesLenient): void; +} +export interface ojAvatarEventMap extends HTMLElementEventMap { + 'initialsChanged': JetElementCustomEvent; + 'sizeChanged': JetElementCustomEvent; + 'srcChanged': JetElementCustomEvent; +} +export interface ojAvatarSettableProperties extends JetSettableProperties { + initials: string; + size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; + src: string; +} +export interface ojAvatarSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojbutton/index.d.ts b/types/oraclejet/ojbutton/index.d.ts new file mode 100644 index 0000000000..542f5eec9e --- /dev/null +++ b/types/oraclejet/ojbutton/index.d.ts @@ -0,0 +1,165 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojButton extends baseComponent { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; + onChromingChanged: ((event: JetElementCustomEvent["chroming"]>) => any) | null; + onDisabledChanged: ((event: JetElementCustomEvent["disabled"]>) => any) | null; + onDisplayChanged: ((event: JetElementCustomEvent["display"]>) => any) | null; + onOjAction: ((event: ojButton.ojAction) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojButtonEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojButton[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojButtonSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojButtonSettablePropertiesLenient): void; +} +export namespace ojButton { + interface ojAction extends CustomEvent<{ + [propName: string]: any; + }> { + } +} +export interface ojButtonEventMap extends baseComponentEventMap { + 'ojAction': ojButton.ojAction; + 'chromingChanged': JetElementCustomEvent["chroming"]>; + 'disabledChanged': JetElementCustomEvent["disabled"]>; + 'displayChanged': JetElementCustomEvent["display"]>; +} +export interface ojButtonSettableProperties extends baseComponentSettableProperties { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; +} +export interface ojButtonSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojButtonset extends baseComponent { + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojButtonsetEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojButtonset[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojButtonsetSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojButtonsetSettablePropertiesLenient): void; +} +// These interfaces are empty but required to keep the event chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface ojButtonsetEventMap extends baseComponentEventMap { +} +// These interfaces are empty but required to keep the component chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface ojButtonsetSettableProperties extends baseComponentSettableProperties { +} +export interface ojButtonsetSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojButtonsetMany extends ojButtonset { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; + focusManagement: 'oneTabstop' | 'none'; + value: any[] | null; + onChromingChanged: ((event: JetElementCustomEvent) => any) | null; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onFocusManagementChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojButtonsetMany[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojButtonsetManySettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojButtonsetManySettablePropertiesLenient): void; +} +export interface ojButtonsetManyEventMap extends ojButtonsetEventMap { + 'chromingChanged': JetElementCustomEvent; + 'disabledChanged': JetElementCustomEvent; + 'displayChanged': JetElementCustomEvent; + 'focusManagementChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojButtonsetManySettableProperties extends ojButtonsetSettableProperties { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; + focusManagement: 'oneTabstop' | 'none'; + value: any[] | null; +} +export interface ojButtonsetManySettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojButtonsetOne extends ojButtonset { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; + focusManagement: 'oneTabstop' | 'none'; + value: any; + onChromingChanged: ((event: JetElementCustomEvent) => any) | null; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onFocusManagementChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojButtonsetOneEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojButtonsetOne[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojButtonsetOneSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojButtonsetOneSettablePropertiesLenient): void; +} +export interface ojButtonsetOneEventMap extends ojButtonsetEventMap { + 'chromingChanged': JetElementCustomEvent; + 'disabledChanged': JetElementCustomEvent; + 'displayChanged': JetElementCustomEvent; + 'focusManagementChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojButtonsetOneSettableProperties extends ojButtonsetSettableProperties { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; + focusManagement: 'oneTabstop' | 'none'; + value: any; +} +export interface ojButtonsetOneSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojMenuButton extends ojButton { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; + onChromingChanged: ((event: JetElementCustomEvent) => any) | null; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAction: ((event: ojMenuButton.ojAction) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuButtonEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojMenuButton[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojMenuButtonSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojMenuButtonSettablePropertiesLenient): void; +} +export namespace ojMenuButton { + interface ojAction extends CustomEvent<{ + [propName: string]: any; + }> { + } +} +export interface ojMenuButtonEventMap extends ojButtonEventMap { + 'ojAction': ojMenuButton.ojAction; + 'chromingChanged': JetElementCustomEvent; + 'disabledChanged': JetElementCustomEvent; + 'displayChanged': JetElementCustomEvent; +} +export interface ojMenuButtonSettableProperties extends ojButtonSettableProperties { + chroming: 'full' | 'half' | 'outlined'; + disabled: boolean; + display: 'all' | 'icons'; +} +export interface ojMenuButtonSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojchart/index.d.ts b/types/oraclejet/ojchart/index.d.ts new file mode 100644 index 0000000000..25970f316e --- /dev/null +++ b/types/oraclejet/ojchart/index.d.ts @@ -0,0 +1,2104 @@ +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojChart extends dvtBaseComponent> { + animationOnDataChange: 'auto' | 'slideToLeft' | 'slideToRight' | 'none'; + animationOnDisplay: 'auto' | 'alphaFade' | 'zoom' | 'none'; + as: string; + coordinateSystem: 'polar' | 'cartesian'; + data: DataProvider | null; + dataCursor: 'off' | 'on' | 'auto'; + dataCursorBehavior: 'smooth' | 'snap' | 'auto'; + dataCursorPosition: { + x: number | string; + y: number; + y2: number; + }; + dataLabel: ((context: ojChart.DataLabelContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + dnd: { + drag: { + groups: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + items: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + series: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + }; + drop: { + legend: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + plotArea: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + xAxis: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + y2Axis: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + yAxis: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + }; + }; + dragMode: 'pan' | 'zoom' | 'select' | 'off' | 'user'; + drilling: 'on' | 'seriesOnly' | 'groupsOnly' | 'off'; + groupComparator: ((param0: object, param1: object) => number) | null; + hiddenCategories: string[]; + hideAndShowBehavior: 'withRescale' | 'withoutRescale' | 'none'; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + initialZooming: 'first' | 'last' | 'none'; + legend: { + backgroundColor: string; + borderColor: string; + maxSize: string; + position: 'start' | 'end' | 'bottom' | 'top' | 'auto'; + referenceObjectSection: { + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }; + rendered: 'on' | 'off' | 'auto'; + scrolling: 'off' | 'asNeeded'; + sections: Array<{ + items: Array<{ + borderColor: string; + categories: string[]; + categoryVisibility: 'hidden' | 'visible'; + color: string; + id: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + markerColor: string; + markerShape?: 'circle' | 'diamond' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shortDesc: string; + source: string; + symbolType: 'line' | 'lineWithMarker' | 'image' | 'marker'; + text: string; + }>; + sections: object[]; + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }>; + seriesSection: { + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }; + size: string; + symbolHeight: number; + symbolWidth: number; + textStyle: object; + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }; + orientation: 'horizontal' | 'vertical'; + otherThreshold: number; + overview: { + content: object; + height: string; + rendered: 'on' | 'off'; + }; + pieCenter: { + converter: object; + label: string; + labelStyle: object; + renderer: ((context: ojChart.PieCenterContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + }; + plotArea: { + backgroundColor: string; + borderColor: string; + borderWidth: number; + rendered: 'off' | 'on'; + }; + polarGridShape: 'polygon' | 'circle'; + selection: K[]; + selectionMode: 'single' | 'multiple' | 'none'; + seriesComparator: ((param0: object, param1: object) => number) | null; + sorting: 'ascending' | 'descending' | 'off'; + splitDualY: 'on' | 'off' | 'auto'; + splitterPosition: number; + stack: 'on' | 'off'; + stackLabel: 'on' | 'off'; + styleDefaults: { + animationDownColor: string; + animationDuration: number; + animationIndicators: 'none' | 'all'; + animationUpColor: string; + barGapRatio: number; + borderColor: string; + borderWidth: number; + boxPlot: { + medianSvgClassName: string; + medianSvgStyle: object; + whiskerEndLength: string; + whiskerEndSvgClassName: string; + whiskerEndSvgStyle: object; + whiskerSvgClassName: string; + whiskerSvgStyle: object; + }; + colors: string[]; + dataCursor: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + markerColor: string; + markerDisplayed: 'off' | 'on'; + markerSize: number; + }; + dataItemGaps: string; + dataLabelPosition: 'center' | 'outsideSlice' | 'aboveMarker' | 'belowMarker' | 'beforeMarker' | 'afterMarker' | 'insideBarEdge' | 'outsideBarEdge' | 'none' | 'auto'; + dataLabelStyle: object | object[]; + funnelBackgroundColor: string; + groupSeparators: { + color: string; + rendered: 'off' | 'auto'; + }; + hoverBehaviorDelay: number; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'straight' | 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'none' | 'auto'; + lineWidth: number; + markerColor: string; + markerDisplayed: 'on' | 'off' | 'auto'; + markerShape?: 'auto' | 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSize: number; + marqueeBorderColor: string; + marqueeColor: string; + maxBarWidth: number; + otherColor: string; + patterns: string[]; + pieFeelerColor: string; + pieInnerRadius: number; + selectionEffect: 'explode' | 'highlightAndExplode' | 'highlight'; + seriesEffect: 'color' | 'pattern' | 'gradient'; + shapes: string[]; + stackLabelStyle: object; + stockFallingColor: string; + stockRangeColor: string; + stockRisingColor: string; + stockVolumeColor: string; + threeDEffect: 'on' | 'off'; + tooltipLabelStyle: object; + tooltipValueStyle: object; + }; + timeAxisType: 'enabled' | 'mixedFrequency' | 'skipGaps' | 'disabled' | 'auto'; + tooltip: { + renderer: ((context: ojChart.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + type: 'line' | 'area' | 'lineWithArea' | 'stock' | 'boxPlot' | 'combo' | 'pie' | 'scatter' | 'bubble' | 'funnel' | 'pyramid' | 'bar'; + valueFormats: { + close: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + group: { + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string | string[]; + }; + high: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + label: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + }; + low: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + open: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + q1: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + q2: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + q3: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + series: { + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + targetValue: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + value: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + volume: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + x: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + y: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + y2: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + z: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + }; + xAxis: { + axisLine: { + lineColor: string; + lineWidth: number; + rendered: 'off' | 'on'; + }; + baselineScaling: 'min' | 'zero'; + dataMax: number; + dataMin: number; + majorTick: { + baselineColor: 'inherit' | 'auto'; + baselineStyle: 'dotted' | 'dashed' | 'solid'; + baselineWidth: number; + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + max: number | string; + maxSize: string; + min: number | string; + minStep: number; + minorStep: number; + minorTick: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + referenceObjects: Array<{ + categories: string[]; + color: string; + displayInLegend: 'on' | 'off'; + high: number; + id: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'straight'; + lineWidth: number; + location: 'front' | 'back'; + low: number; + shortDesc: string; + svgClassName: string; + svgStyle: object; + text: string; + type: 'area' | 'line'; + value: number; + }>; + rendered: 'off' | 'on'; + scale: 'log' | 'linear'; + size: string; + step: number; + tickLabel: { + converter: object; + rendered: 'off' | 'on'; + rotation: 'none' | 'auto'; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style: object; + }; + title: string; + titleStyle: object; + viewportEndGroup: number | string; + viewportMax: number | string; + viewportMin: number | string; + viewportStartGroup: number | string; + }; + y2Axis: { + alignTickMarks: 'off' | 'on'; + axisLine: { + lineColor: string; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + baselineScaling: 'min' | 'zero'; + dataMax: number; + dataMin: number; + majorTick: { + baselineColor: 'inherit' | 'auto'; + baselineStyle: 'dotted' | 'dashed' | 'solid'; + baselineWidth: number; + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + max: number; + maxSize: string; + min: number; + minStep: number; + minorStep: number; + minorTick: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + position: 'start' | 'end' | 'top' | 'bottom' | 'auto'; + referenceObjects: Array<{ + categories: string[]; + color: string; + displayInLegend: 'on' | 'off'; + high: number; + id: string; + items: Array<{ + high: number; + low: number; + value: number; + x: number | string; + }>; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'straight'; + lineWidth: number; + location: 'front' | 'back'; + low: number; + shortDesc: string; + svgClassName: string; + svgStyle: object; + text: string; + type: 'area' | 'line'; + value: number; + }>; + rendered: 'off' | 'on'; + scale: 'log' | 'linear'; + size: string; + step: number; + tickLabel: { + converter: object; + position: 'inside' | 'outside'; + rendered: 'off' | 'on'; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style: object; + }; + title: string; + titleStyle: object; + }; + yAxis: { + axisLine: { + lineColor: string; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + baselineScaling: 'min' | 'zero'; + dataMax: number; + dataMin: number; + majorTick: { + baselineColor: 'inherit' | 'auto'; + baselineStyle: 'dotted' | 'dashed' | 'solid'; + baselineWidth: number; + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + max: number; + maxSize: string; + min: number; + minStep: number; + minorStep: number; + minorTick: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + position: 'start' | 'end' | 'top' | 'bottom' | 'auto'; + referenceObjects: Array<{ + categories: string[]; + color: string; + displayInLegend: 'on' | 'off'; + high: number; + id: string; + items: Array<{ + high: number; + low: number; + value: number; + x: number | string; + }>; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'straight'; + lineWidth: number; + location: 'front' | 'back'; + low: number; + shortDesc: string; + svgClassName: string; + svgStyle: object; + text: string; + type: 'area' | 'line'; + value: number; + }>; + rendered: 'off' | 'on'; + scale: 'log' | 'linear'; + size: string; + step: number; + tickLabel: { + converter: object; + position: 'inside' | 'outside'; + rendered: 'off' | 'on'; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style: object; + }; + title: string; + titleStyle: object; + viewportMax: number; + viewportMin: number; + }; + zoomAndScroll: 'delayedScrollOnly' | 'liveScrollOnly' | 'delayed' | 'live' | 'off'; + zoomDirection: 'x' | 'y' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelClose?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelDate?: string; + labelDefaultGroupName?: string; + labelGroup?: string; + labelHigh?: string; + labelInvalidData?: string; + labelLow?: string; + labelNoData?: string; + labelOpen?: string; + labelOther?: string; + labelPercentage?: string; + labelQ1?: string; + labelQ2?: string; + labelQ3?: string; + labelSeries?: string; + labelTargetValue?: string; + labelValue?: string; + labelVolume?: string; + labelX?: string; + labelY?: string; + labelZ?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + tooltipPan?: string; + tooltipSelect?: string; + tooltipZoom?: string; + }; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onCoordinateSystemChanged: ((event: JetElementCustomEvent["coordinateSystem"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDataCursorChanged: ((event: JetElementCustomEvent["dataCursor"]>) => any) | null; + onDataCursorBehaviorChanged: ((event: JetElementCustomEvent["dataCursorBehavior"]>) => any) | null; + onDataCursorPositionChanged: ((event: JetElementCustomEvent["dataCursorPosition"]>) => any) | null; + onDataLabelChanged: ((event: JetElementCustomEvent["dataLabel"]>) => any) | null; + onDndChanged: ((event: JetElementCustomEvent["dnd"]>) => any) | null; + onDragModeChanged: ((event: JetElementCustomEvent["dragMode"]>) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent["drilling"]>) => any) | null; + onGroupComparatorChanged: ((event: JetElementCustomEvent["groupComparator"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHideAndShowBehaviorChanged: ((event: JetElementCustomEvent["hideAndShowBehavior"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onInitialZoomingChanged: ((event: JetElementCustomEvent["initialZooming"]>) => any) | null; + onLegendChanged: ((event: JetElementCustomEvent["legend"]>) => any) | null; + onOrientationChanged: ((event: JetElementCustomEvent["orientation"]>) => any) | null; + onOtherThresholdChanged: ((event: JetElementCustomEvent["otherThreshold"]>) => any) | null; + onOverviewChanged: ((event: JetElementCustomEvent["overview"]>) => any) | null; + onPieCenterChanged: ((event: JetElementCustomEvent["pieCenter"]>) => any) | null; + onPlotAreaChanged: ((event: JetElementCustomEvent["plotArea"]>) => any) | null; + onPolarGridShapeChanged: ((event: JetElementCustomEvent["polarGridShape"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onSeriesComparatorChanged: ((event: JetElementCustomEvent["seriesComparator"]>) => any) | null; + onSortingChanged: ((event: JetElementCustomEvent["sorting"]>) => any) | null; + onSplitDualYChanged: ((event: JetElementCustomEvent["splitDualY"]>) => any) | null; + onSplitterPositionChanged: ((event: JetElementCustomEvent["splitterPosition"]>) => any) | null; + onStackChanged: ((event: JetElementCustomEvent["stack"]>) => any) | null; + onStackLabelChanged: ((event: JetElementCustomEvent["stackLabel"]>) => any) | null; + onStyleDefaultsChanged: ((event: JetElementCustomEvent["styleDefaults"]>) => any) | null; + onTimeAxisTypeChanged: ((event: JetElementCustomEvent["timeAxisType"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTouchResponseChanged: ((event: JetElementCustomEvent["touchResponse"]>) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent["type"]>) => any) | null; + onValueFormatsChanged: ((event: JetElementCustomEvent["valueFormats"]>) => any) | null; + onXAxisChanged: ((event: JetElementCustomEvent["xAxis"]>) => any) | null; + onY2AxisChanged: ((event: JetElementCustomEvent["y2Axis"]>) => any) | null; + onYAxisChanged: ((event: JetElementCustomEvent["yAxis"]>) => any) | null; + onZoomAndScrollChanged: ((event: JetElementCustomEvent["zoomAndScroll"]>) => any) | null; + onZoomDirectionChanged: ((event: JetElementCustomEvent["zoomDirection"]>) => any) | null; + onOjDrill: ((event: ojChart.ojDrill) => any) | null; + onOjSelectInput: ((event: ojChart.ojSelectInput) => any) | null; + onOjViewportChange: ((event: ojChart.ojViewportChange) => any) | null; + onOjViewportChangeInput: ((event: ojChart.ojViewportChangeInput) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojChartEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojChart[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojChartSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojChartSettablePropertiesLenient): void; + getContextByNode(node: Element): ojChart.PieCenterLabelContext | ojChart.LegendItemContext | ojChart.ReferenceObject | ojChart.GroupContext | ojChart.AxisTitleContext | ojChart.ItemContext | + ojChart.SeriesContext; + getDataItem(seriesIndex: number, groupIndex: number): object | null; + getGroup(groupIndex: string): string; + getGroupCount(): number; + getLegend(): object; + getPlotArea(): object; + getSeries(seriesIndex: string): string; + getSeriesCount(): number; + getValuesAt(x: number, y: number): object; + getXAxis(): object; + getY2Axis(): object; + getYAxis(): object; +} +export namespace ojChart { + interface ojDrill extends CustomEvent<{ + id: string; + series: string; + group: string; + data: object; + itemData: object; + seriesData: object; + groupData: any[]; + [propName: string]: any; + }> { + } + interface ojSelectInput extends CustomEvent<{ + items: any[]; + selectionData: Array<{ + data: object; + itemData: object; + groupData: any[]; + seriesData: object; + }>; + endGroup: string; + startGroup: string; + xMax: number; + xMin: number; + yMax: number; + yMin: number; + [propName: string]: any; + }> { + } + interface ojViewportChange extends CustomEvent<{ + endGroup: string; + startGroup: string; + xMax: number; + xMin: number; + yMax: number; + yMin: number; + [propName: string]: any; + }> { + } + interface ojViewportChangeInput extends CustomEvent<{ + endGroup: string; + startGroup: string; + xMax: number; + xMin: number; + yMax: number; + yMin: number; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type AxisTitleContext = { + axis: 'xAxis' | 'yAxis' | 'y2Axis'; + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type DataLabelContext = { + id: any; + series: string; + group: string | string[]; + value: number; + targetValue: number; + x: number | string; + y: number; + z: number; + low: number; + high: number; + open: number; + close: number; + volume: number; + label: string; + totalValue: number; + data: object | null; + itemData: object | null; + seriesData: object | null; + groupData: object | null; + componentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type GroupContext = { + indexPath: any[]; + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + seriesIndex: number; + itemIndex: number; + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type LegendItemContext = { + sectionIndexPath: any[]; + itemIndex: number; + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type PieCenterContext = { + outerBounds: object; + innerBounds: object; + label: string; + componentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type PieCenterLabelContext = { + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type ReferenceObject = { + axis: 'xAxis' | 'yAxis' | 'y2Axis'; + index: number; + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type SeriesContext = { + itemIndex: number; + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + parentElement: Element; + id: any; + series: string; + group: string | string[]; + label: string; + value: number; + x: number | string; + y: number; + z: number; + low: number; + high: number; + open: number; + close: number; + volume: number; + targetValue: number; + data: object | null; + itemData: object | null; + seriesData: object | null; + groupData: object | null; + componentElement: Element; + color: string; + }; +} +export interface ojChartEventMap extends dvtBaseComponentEventMap> { + 'ojDrill': ojChart.ojDrill; + 'ojSelectInput': ojChart.ojSelectInput; + 'ojViewportChange': ojChart.ojViewportChange; + 'ojViewportChangeInput': ojChart.ojViewportChangeInput; + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'coordinateSystemChanged': JetElementCustomEvent["coordinateSystem"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'dataCursorChanged': JetElementCustomEvent["dataCursor"]>; + 'dataCursorBehaviorChanged': JetElementCustomEvent["dataCursorBehavior"]>; + 'dataCursorPositionChanged': JetElementCustomEvent["dataCursorPosition"]>; + 'dataLabelChanged': JetElementCustomEvent["dataLabel"]>; + 'dndChanged': JetElementCustomEvent["dnd"]>; + 'dragModeChanged': JetElementCustomEvent["dragMode"]>; + 'drillingChanged': JetElementCustomEvent["drilling"]>; + 'groupComparatorChanged': JetElementCustomEvent["groupComparator"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'hideAndShowBehaviorChanged': JetElementCustomEvent["hideAndShowBehavior"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'initialZoomingChanged': JetElementCustomEvent["initialZooming"]>; + 'legendChanged': JetElementCustomEvent["legend"]>; + 'orientationChanged': JetElementCustomEvent["orientation"]>; + 'otherThresholdChanged': JetElementCustomEvent["otherThreshold"]>; + 'overviewChanged': JetElementCustomEvent["overview"]>; + 'pieCenterChanged': JetElementCustomEvent["pieCenter"]>; + 'plotAreaChanged': JetElementCustomEvent["plotArea"]>; + 'polarGridShapeChanged': JetElementCustomEvent["polarGridShape"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'seriesComparatorChanged': JetElementCustomEvent["seriesComparator"]>; + 'sortingChanged': JetElementCustomEvent["sorting"]>; + 'splitDualYChanged': JetElementCustomEvent["splitDualY"]>; + 'splitterPositionChanged': JetElementCustomEvent["splitterPosition"]>; + 'stackChanged': JetElementCustomEvent["stack"]>; + 'stackLabelChanged': JetElementCustomEvent["stackLabel"]>; + 'styleDefaultsChanged': JetElementCustomEvent["styleDefaults"]>; + 'timeAxisTypeChanged': JetElementCustomEvent["timeAxisType"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'touchResponseChanged': JetElementCustomEvent["touchResponse"]>; + 'typeChanged': JetElementCustomEvent["type"]>; + 'valueFormatsChanged': JetElementCustomEvent["valueFormats"]>; + 'xAxisChanged': JetElementCustomEvent["xAxis"]>; + 'y2AxisChanged': JetElementCustomEvent["y2Axis"]>; + 'yAxisChanged': JetElementCustomEvent["yAxis"]>; + 'zoomAndScrollChanged': JetElementCustomEvent["zoomAndScroll"]>; + 'zoomDirectionChanged': JetElementCustomEvent["zoomDirection"]>; +} +export interface ojChartSettableProperties extends dvtBaseComponentSettableProperties { + animationOnDataChange: 'auto' | 'slideToLeft' | 'slideToRight' | 'none'; + animationOnDisplay: 'auto' | 'alphaFade' | 'zoom' | 'none'; + as: string; + coordinateSystem: 'polar' | 'cartesian'; + data: DataProvider | null; + dataCursor: 'off' | 'on' | 'auto'; + dataCursorBehavior: 'smooth' | 'snap' | 'auto'; + dataCursorPosition: { + x: number | string; + y: number; + y2: number; + }; + dataLabel: ((context: ojChart.DataLabelContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + dnd: { + drag: { + groups: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + items: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + series: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + }; + drop: { + legend: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + plotArea: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + xAxis: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + y2Axis: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + yAxis: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + }; + }; + dragMode: 'pan' | 'zoom' | 'select' | 'off' | 'user'; + drilling: 'on' | 'seriesOnly' | 'groupsOnly' | 'off'; + groupComparator: ((param0: object, param1: object) => number) | null; + hiddenCategories: string[]; + hideAndShowBehavior: 'withRescale' | 'withoutRescale' | 'none'; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + initialZooming: 'first' | 'last' | 'none'; + legend: { + backgroundColor: string; + borderColor: string; + maxSize: string; + position: 'start' | 'end' | 'bottom' | 'top' | 'auto'; + referenceObjectSection: { + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }; + rendered: 'on' | 'off' | 'auto'; + scrolling: 'off' | 'asNeeded'; + sections: Array<{ + items: Array<{ + borderColor: string; + categories: string[]; + categoryVisibility: 'hidden' | 'visible'; + color: string; + id: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + markerColor: string; + markerShape?: 'circle' | 'diamond' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shortDesc: string; + source: string; + symbolType: 'line' | 'lineWithMarker' | 'image' | 'marker'; + text: string; + }>; + sections: object[]; + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }>; + seriesSection: { + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }; + size: string; + symbolHeight: number; + symbolWidth: number; + textStyle: object; + title: string; + titleHalign: 'center' | 'end' | 'start'; + titleStyle: object; + }; + orientation: 'horizontal' | 'vertical'; + otherThreshold: number; + overview: { + content: object; + height: string; + rendered: 'on' | 'off'; + }; + pieCenter: { + converter: object; + label: string; + labelStyle: object; + renderer: ((context: ojChart.PieCenterContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + }; + plotArea: { + backgroundColor: string; + borderColor: string; + borderWidth: number; + rendered: 'off' | 'on'; + }; + polarGridShape: 'polygon' | 'circle'; + selection: K[]; + selectionMode: 'single' | 'multiple' | 'none'; + seriesComparator: ((param0: object, param1: object) => number) | null; + sorting: 'ascending' | 'descending' | 'off'; + splitDualY: 'on' | 'off' | 'auto'; + splitterPosition: number; + stack: 'on' | 'off'; + stackLabel: 'on' | 'off'; + styleDefaults: { + animationDownColor: string; + animationDuration: number; + animationIndicators: 'none' | 'all'; + animationUpColor: string; + barGapRatio: number; + borderColor: string; + borderWidth: number; + boxPlot: { + medianSvgClassName: string; + medianSvgStyle: object; + whiskerEndLength: string; + whiskerEndSvgClassName: string; + whiskerEndSvgStyle: object; + whiskerSvgClassName: string; + whiskerSvgStyle: object; + }; + colors: string[]; + dataCursor: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + markerColor: string; + markerDisplayed: 'off' | 'on'; + markerSize: number; + }; + dataItemGaps: string; + dataLabelPosition: 'center' | 'outsideSlice' | 'aboveMarker' | 'belowMarker' | 'beforeMarker' | 'afterMarker' | 'insideBarEdge' | 'outsideBarEdge' | 'none' | 'auto'; + dataLabelStyle: object | object[]; + funnelBackgroundColor: string; + groupSeparators: { + color: string; + rendered: 'off' | 'auto'; + }; + hoverBehaviorDelay: number; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'straight' | 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'none' | 'auto'; + lineWidth: number; + markerColor: string; + markerDisplayed: 'on' | 'off' | 'auto'; + markerShape?: 'auto' | 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSize: number; + marqueeBorderColor: string; + marqueeColor: string; + maxBarWidth: number; + otherColor: string; + patterns: string[]; + pieFeelerColor: string; + pieInnerRadius: number; + selectionEffect: 'explode' | 'highlightAndExplode' | 'highlight'; + seriesEffect: 'color' | 'pattern' | 'gradient'; + shapes: string[]; + stackLabelStyle: object; + stockFallingColor: string; + stockRangeColor: string; + stockRisingColor: string; + stockVolumeColor: string; + threeDEffect: 'on' | 'off'; + tooltipLabelStyle: object; + tooltipValueStyle: object; + }; + timeAxisType: 'enabled' | 'mixedFrequency' | 'skipGaps' | 'disabled' | 'auto'; + tooltip: { + renderer: ((context: ojChart.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + type: 'line' | 'area' | 'lineWithArea' | 'stock' | 'boxPlot' | 'combo' | 'pie' | 'scatter' | 'bubble' | 'funnel' | 'pyramid' | 'bar'; + valueFormats: { + close: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + group: { + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string | string[]; + }; + high: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + label: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + }; + low: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + open: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + q1: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + q2: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + q3: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + series: { + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + targetValue: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + value: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + volume: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + x: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + y: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + y2: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + z: { + converter: object; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + tooltipDisplay: 'off' | 'auto'; + tooltipLabel: string; + }; + }; + xAxis: { + axisLine: { + lineColor: string; + lineWidth: number; + rendered: 'off' | 'on'; + }; + baselineScaling: 'min' | 'zero'; + dataMax: number; + dataMin: number; + majorTick: { + baselineColor: 'inherit' | 'auto'; + baselineStyle: 'dotted' | 'dashed' | 'solid'; + baselineWidth: number; + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + max: number | string; + maxSize: string; + min: number | string; + minStep: number; + minorStep: number; + minorTick: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + referenceObjects: Array<{ + categories: string[]; + color: string; + displayInLegend: 'on' | 'off'; + high: number; + id: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'straight'; + lineWidth: number; + location: 'front' | 'back'; + low: number; + shortDesc: string; + svgClassName: string; + svgStyle: object; + text: string; + type: 'area' | 'line'; + value: number; + }>; + rendered: 'off' | 'on'; + scale: 'log' | 'linear'; + size: string; + step: number; + tickLabel: { + converter: object; + rendered: 'off' | 'on'; + rotation: 'none' | 'auto'; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style: object; + }; + title: string; + titleStyle: object; + viewportEndGroup: number | string; + viewportMax: number | string; + viewportMin: number | string; + viewportStartGroup: number | string; + }; + y2Axis: { + alignTickMarks: 'off' | 'on'; + axisLine: { + lineColor: string; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + baselineScaling: 'min' | 'zero'; + dataMax: number; + dataMin: number; + majorTick: { + baselineColor: 'inherit' | 'auto'; + baselineStyle: 'dotted' | 'dashed' | 'solid'; + baselineWidth: number; + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + max: number; + maxSize: string; + min: number; + minStep: number; + minorStep: number; + minorTick: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + position: 'start' | 'end' | 'top' | 'bottom' | 'auto'; + referenceObjects: Array<{ + categories: string[]; + color: string; + displayInLegend: 'on' | 'off'; + high: number; + id: string; + items: Array<{ + high: number; + low: number; + value: number; + x: number | string; + }>; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'straight'; + lineWidth: number; + location: 'front' | 'back'; + low: number; + shortDesc: string; + svgClassName: string; + svgStyle: object; + text: string; + type: 'area' | 'line'; + value: number; + }>; + rendered: 'off' | 'on'; + scale: 'log' | 'linear'; + size: string; + step: number; + tickLabel: { + converter: object; + position: 'inside' | 'outside'; + rendered: 'off' | 'on'; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style: object; + }; + title: string; + titleStyle: object; + }; + yAxis: { + axisLine: { + lineColor: string; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + baselineScaling: 'min' | 'zero'; + dataMax: number; + dataMin: number; + majorTick: { + baselineColor: 'inherit' | 'auto'; + baselineStyle: 'dotted' | 'dashed' | 'solid'; + baselineWidth: number; + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + max: number; + maxSize: string; + min: number; + minStep: number; + minorStep: number; + minorTick: { + lineColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineWidth: number; + rendered: 'on' | 'off' | 'auto'; + }; + position: 'start' | 'end' | 'top' | 'bottom' | 'auto'; + referenceObjects: Array<{ + categories: string[]; + color: string; + displayInLegend: 'on' | 'off'; + high: number; + id: string; + items: Array<{ + high: number; + low: number; + value: number; + x: number | string; + }>; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'straight'; + lineWidth: number; + location: 'front' | 'back'; + low: number; + shortDesc: string; + svgClassName: string; + svgStyle: object; + text: string; + type: 'area' | 'line'; + value: number; + }>; + rendered: 'off' | 'on'; + scale: 'log' | 'linear'; + size: string; + step: number; + tickLabel: { + converter: object; + position: 'inside' | 'outside'; + rendered: 'off' | 'on'; + scaling: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style: object; + }; + title: string; + titleStyle: object; + viewportMax: number; + viewportMin: number; + }; + zoomAndScroll: 'delayedScrollOnly' | 'liveScrollOnly' | 'delayed' | 'live' | 'off'; + zoomDirection: 'x' | 'y' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelClose?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelDate?: string; + labelDefaultGroupName?: string; + labelGroup?: string; + labelHigh?: string; + labelInvalidData?: string; + labelLow?: string; + labelNoData?: string; + labelOpen?: string; + labelOther?: string; + labelPercentage?: string; + labelQ1?: string; + labelQ2?: string; + labelQ3?: string; + labelSeries?: string; + labelTargetValue?: string; + labelValue?: string; + labelVolume?: string; + labelX?: string; + labelY?: string; + labelZ?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + tooltipPan?: string; + tooltipSelect?: string; + tooltipZoom?: string; + }; +} +export interface ojChartSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojChartGroup extends JetElement { + drilling?: 'on' | 'off' | 'inherit'; + labelStyle?: object; + name?: string; + shortDesc?: string; + onDrillingChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onNameChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartGroupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojChartGroup[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojChartGroupSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojChartGroupSettablePropertiesLenient): void; +} +export interface ojChartGroupEventMap extends HTMLElementEventMap { + 'drillingChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'nameChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; +} +export interface ojChartGroupSettableProperties extends JetSettableProperties { + drilling?: 'on' | 'off' | 'inherit'; + labelStyle?: object; + name?: string; + shortDesc?: string; +} +export interface ojChartGroupSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojChartItem extends JetElement { + borderColor?: string; + borderWidth?: number; + boxPlot?: { + medianSvgClassName?: string; + medianSvgStyle?: object; + q2Color?: string; + q2SvgClassName?: string; + q2SvgStyle?: object; + q3SvgClassName?: string; + q3SvgStyle?: object; + whiskerEndLength?: string; + whiskerEndSvgClassName?: string; + whiskerEndSvgStyle?: object; + whiskerSvgClassName?: string; + whiskerSvgStyle?: object; + }; + categories?: string[]; + close?: number; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + groupId: string[]; + high?: number; + items?: object[] | number[]; + label?: string | string[]; + labelPosition?: 'center' | 'outsideSlice' | 'aboveMarker' | 'belowMarker' | 'beforeMarker' | 'afterMarker' | 'insideBarEdge' | 'outsideBarEdge' | 'none' | 'auto'; + labelStyle?: object | object[]; + low?: number; + markerDisplayed?: 'on' | 'off' | 'auto'; + markerShape?: 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | 'auto' | string; + markerSize?: number; + open?: number; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'auto'; + q1?: number; + q2?: number; + q3?: number; + seriesId: string; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + svgClassName?: string; + svgStyle?: object; + targetValue?: number; + value?: number; + volume?: number; + x?: number | string; + y?: number; + z?: number; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onBoxPlotChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onCloseChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent) => any) | null; + onGroupIdChanged: ((event: JetElementCustomEvent) => any) | null; + onHighChanged: ((event: JetElementCustomEvent) => any) | null; + onItemsChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelPositionChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onLowChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerDisplayedChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerShapeChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerSizeChanged: ((event: JetElementCustomEvent) => any) | null; + onOpenChanged: ((event: JetElementCustomEvent) => any) | null; + onPatternChanged: ((event: JetElementCustomEvent) => any) | null; + onQ1Changed: ((event: JetElementCustomEvent) => any) | null; + onQ2Changed: ((event: JetElementCustomEvent) => any) | null; + onQ3Changed: ((event: JetElementCustomEvent) => any) | null; + onSeriesIdChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onTargetValueChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onVolumeChanged: ((event: JetElementCustomEvent) => any) | null; + onXChanged: ((event: JetElementCustomEvent) => any) | null; + onYChanged: ((event: JetElementCustomEvent) => any) | null; + onZChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojChartItem[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojChartItemSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojChartItemSettablePropertiesLenient): void; +} +export interface ojChartItemEventMap extends HTMLElementEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'borderWidthChanged': JetElementCustomEvent; + 'boxPlotChanged': JetElementCustomEvent; + 'categoriesChanged': JetElementCustomEvent; + 'closeChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'drillingChanged': JetElementCustomEvent; + 'groupIdChanged': JetElementCustomEvent; + 'highChanged': JetElementCustomEvent; + 'itemsChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelPositionChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'lowChanged': JetElementCustomEvent; + 'markerDisplayedChanged': JetElementCustomEvent; + 'markerShapeChanged': JetElementCustomEvent; + 'markerSizeChanged': JetElementCustomEvent; + 'openChanged': JetElementCustomEvent; + 'patternChanged': JetElementCustomEvent; + 'q1Changed': JetElementCustomEvent; + 'q2Changed': JetElementCustomEvent; + 'q3Changed': JetElementCustomEvent; + 'seriesIdChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'sourceChanged': JetElementCustomEvent; + 'sourceHoverChanged': JetElementCustomEvent; + 'sourceHoverSelectedChanged': JetElementCustomEvent; + 'sourceSelectedChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'targetValueChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; + 'volumeChanged': JetElementCustomEvent; + 'xChanged': JetElementCustomEvent; + 'yChanged': JetElementCustomEvent; + 'zChanged': JetElementCustomEvent; +} +export interface ojChartItemSettableProperties extends JetSettableProperties { + borderColor?: string; + borderWidth?: number; + boxPlot?: { + medianSvgClassName?: string; + medianSvgStyle?: object; + q2Color?: string; + q2SvgClassName?: string; + q2SvgStyle?: object; + q3SvgClassName?: string; + q3SvgStyle?: object; + whiskerEndLength?: string; + whiskerEndSvgClassName?: string; + whiskerEndSvgStyle?: object; + whiskerSvgClassName?: string; + whiskerSvgStyle?: object; + }; + categories?: string[]; + close?: number; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + groupId: string[]; + high?: number; + items?: object[] | number[]; + label?: string | string[]; + labelPosition?: 'center' | 'outsideSlice' | 'aboveMarker' | 'belowMarker' | 'beforeMarker' | 'afterMarker' | 'insideBarEdge' | 'outsideBarEdge' | 'none' | 'auto'; + labelStyle?: object | object[]; + low?: number; + markerDisplayed?: 'on' | 'off' | 'auto'; + markerShape?: 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | 'auto' | string; + markerSize?: number; + open?: number; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'auto'; + q1?: number; + q2?: number; + q3?: number; + seriesId: string; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + svgClassName?: string; + svgStyle?: object; + targetValue?: number; + value?: number; + volume?: number; + x?: number | string; + y?: number; + z?: number; +} +export interface ojChartItemSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojChartSeries extends JetElement { + areaColor?: string; + areaSvgClassName?: string; + areaSvgStyle?: object; + assignedToY2?: 'on' | 'off'; + borderColor?: string; + borderWidth?: number; + boxPlot?: { + medianSvgClassName?: string; + medianSvgStyle?: object; + q2Color?: string; + q2SvgClassName?: string; + q2SvgStyle?: object; + q3Color?: string; + q3SvgClassName?: string; + q3SvgStyle?: object; + whiskerEndLength?: string; + whiskerEndSvgClassName?: string; + whiskerEndSvgStyle?: object; + whiskerSvgClassName?: string; + whiskerSvgStyle?: object; + }; + categories?: string[]; + color?: string; + displayInLegend?: 'on' | 'off' | 'auto'; + drilling?: 'on' | 'off' | 'inherit'; + lineStyle?: 'dotted' | 'dashed' | 'solid'; + lineType?: 'straight' | 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'none' | 'auto'; + lineWidth?: number; + markerColor?: string; + markerDisplayed?: 'on' | 'off' | 'auto'; + markerShape?: 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | 'auto' | string; + markerSize?: number; + markerSvgClassName?: string; + markerSvgStyle?: object; + name?: string; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'auto'; + pieSliceExplode?: number; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + stackCategory?: string; + svgClassName?: string; + svgStyle?: object; + type?: 'bar' | 'line' | 'area' | 'lineWithArea' | 'candlestick' | 'boxPlot' | 'auto'; + onAreaColorChanged: ((event: JetElementCustomEvent) => any) | null; + onAreaSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onAreaSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onAssignedToY2Changed: ((event: JetElementCustomEvent) => any) | null; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onBoxPlotChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onDisplayInLegendChanged: ((event: JetElementCustomEvent) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent) => any) | null; + onLineStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onLineTypeChanged: ((event: JetElementCustomEvent) => any) | null; + onLineWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerColorChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerDisplayedChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerShapeChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerSizeChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onNameChanged: ((event: JetElementCustomEvent) => any) | null; + onPatternChanged: ((event: JetElementCustomEvent) => any) | null; + onPieSliceExplodeChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onStackCategoryChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojChartSeriesEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojChartSeries[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojChartSeriesSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojChartSeriesSettablePropertiesLenient): void; +} +export interface ojChartSeriesEventMap extends HTMLElementEventMap { + 'areaColorChanged': JetElementCustomEvent; + 'areaSvgClassNameChanged': JetElementCustomEvent; + 'areaSvgStyleChanged': JetElementCustomEvent; + 'assignedToY2Changed': JetElementCustomEvent; + 'borderColorChanged': JetElementCustomEvent; + 'borderWidthChanged': JetElementCustomEvent; + 'boxPlotChanged': JetElementCustomEvent; + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'displayInLegendChanged': JetElementCustomEvent; + 'drillingChanged': JetElementCustomEvent; + 'lineStyleChanged': JetElementCustomEvent; + 'lineTypeChanged': JetElementCustomEvent; + 'lineWidthChanged': JetElementCustomEvent; + 'markerColorChanged': JetElementCustomEvent; + 'markerDisplayedChanged': JetElementCustomEvent; + 'markerShapeChanged': JetElementCustomEvent; + 'markerSizeChanged': JetElementCustomEvent; + 'markerSvgClassNameChanged': JetElementCustomEvent; + 'markerSvgStyleChanged': JetElementCustomEvent; + 'nameChanged': JetElementCustomEvent; + 'patternChanged': JetElementCustomEvent; + 'pieSliceExplodeChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'sourceChanged': JetElementCustomEvent; + 'sourceHoverChanged': JetElementCustomEvent; + 'sourceHoverSelectedChanged': JetElementCustomEvent; + 'sourceSelectedChanged': JetElementCustomEvent; + 'stackCategoryChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'typeChanged': JetElementCustomEvent; +} +export interface ojChartSeriesSettableProperties extends JetSettableProperties { + areaColor?: string; + areaSvgClassName?: string; + areaSvgStyle?: object; + assignedToY2?: 'on' | 'off'; + borderColor?: string; + borderWidth?: number; + boxPlot?: { + medianSvgClassName?: string; + medianSvgStyle?: object; + q2Color?: string; + q2SvgClassName?: string; + q2SvgStyle?: object; + q3Color?: string; + q3SvgClassName?: string; + q3SvgStyle?: object; + whiskerEndLength?: string; + whiskerEndSvgClassName?: string; + whiskerEndSvgStyle?: object; + whiskerSvgClassName?: string; + whiskerSvgStyle?: object; + }; + categories?: string[]; + color?: string; + displayInLegend?: 'on' | 'off' | 'auto'; + drilling?: 'on' | 'off' | 'inherit'; + lineStyle?: 'dotted' | 'dashed' | 'solid'; + lineType?: 'straight' | 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'none' | 'auto'; + lineWidth?: number; + markerColor?: string; + markerDisplayed?: 'on' | 'off' | 'auto'; + markerShape?: 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | 'auto' | string; + markerSize?: number; + markerSvgClassName?: string; + markerSvgStyle?: object; + name?: string; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'auto'; + pieSliceExplode?: number; + shortDesc?: string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + stackCategory?: string; + svgClassName?: string; + svgStyle?: object; + type?: 'bar' | 'line' | 'area' | 'lineWithArea' | 'candlestick' | 'boxPlot' | 'auto'; +} +export interface ojChartSeriesSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojSparkChart extends dvtBaseComponent> { + animationDuration: number | null; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + areaColor: string; + areaSvgClassName: string; + areaSvgStyle: object; + as: string; + barGapRatio: number; + baselineScaling: 'zero' | 'min'; + color: string; + data: DataProvider | null; + firstColor: string; + highColor: string; + lastColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'none' | 'straight'; + lineWidth: number; + lowColor: string; + markerShape: 'auto' | 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSize: number; + referenceObjects: ojSparkChart.ReferenceObject[]; + svgClassName: string; + svgStyle: object; + tooltip: { + renderer: ((context: ojSparkChart.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })) | null; + }; + type: 'area' | 'lineWithArea' | 'bar' | 'line'; + visualEffects: 'none' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onAnimationDurationChanged: ((event: JetElementCustomEvent["animationDuration"]>) => any) | null; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAreaColorChanged: ((event: JetElementCustomEvent["areaColor"]>) => any) | null; + onAreaSvgClassNameChanged: ((event: JetElementCustomEvent["areaSvgClassName"]>) => any) | null; + onAreaSvgStyleChanged: ((event: JetElementCustomEvent["areaSvgStyle"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onBarGapRatioChanged: ((event: JetElementCustomEvent["barGapRatio"]>) => any) | null; + onBaselineScalingChanged: ((event: JetElementCustomEvent["baselineScaling"]>) => any) | null; + onColorChanged: ((event: JetElementCustomEvent["color"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onFirstColorChanged: ((event: JetElementCustomEvent["firstColor"]>) => any) | null; + onHighColorChanged: ((event: JetElementCustomEvent["highColor"]>) => any) | null; + onLastColorChanged: ((event: JetElementCustomEvent["lastColor"]>) => any) | null; + onLineStyleChanged: ((event: JetElementCustomEvent["lineStyle"]>) => any) | null; + onLineTypeChanged: ((event: JetElementCustomEvent["lineType"]>) => any) | null; + onLineWidthChanged: ((event: JetElementCustomEvent["lineWidth"]>) => any) | null; + onLowColorChanged: ((event: JetElementCustomEvent["lowColor"]>) => any) | null; + onMarkerShapeChanged: ((event: JetElementCustomEvent["markerShape"]>) => any) | null; + onMarkerSizeChanged: ((event: JetElementCustomEvent["markerSize"]>) => any) | null; + onReferenceObjectsChanged: ((event: JetElementCustomEvent["referenceObjects"]>) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent["svgClassName"]>) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent["svgStyle"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent["type"]>) => any) | null; + onVisualEffectsChanged: ((event: JetElementCustomEvent["visualEffects"]>) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojSparkChartEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojSparkChart[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojSparkChartSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojSparkChartSettablePropertiesLenient): void; + getDataItem(itemIndex: number): ojSparkChart.ItemContext | null; +} +export interface ojSparkChartEventMap extends dvtBaseComponentEventMap> { + 'animationDurationChanged': JetElementCustomEvent["animationDuration"]>; + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'areaColorChanged': JetElementCustomEvent["areaColor"]>; + 'areaSvgClassNameChanged': JetElementCustomEvent["areaSvgClassName"]>; + 'areaSvgStyleChanged': JetElementCustomEvent["areaSvgStyle"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'barGapRatioChanged': JetElementCustomEvent["barGapRatio"]>; + 'baselineScalingChanged': JetElementCustomEvent["baselineScaling"]>; + 'colorChanged': JetElementCustomEvent["color"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'firstColorChanged': JetElementCustomEvent["firstColor"]>; + 'highColorChanged': JetElementCustomEvent["highColor"]>; + 'lastColorChanged': JetElementCustomEvent["lastColor"]>; + 'lineStyleChanged': JetElementCustomEvent["lineStyle"]>; + 'lineTypeChanged': JetElementCustomEvent["lineType"]>; + 'lineWidthChanged': JetElementCustomEvent["lineWidth"]>; + 'lowColorChanged': JetElementCustomEvent["lowColor"]>; + 'markerShapeChanged': JetElementCustomEvent["markerShape"]>; + 'markerSizeChanged': JetElementCustomEvent["markerSize"]>; + 'referenceObjectsChanged': JetElementCustomEvent["referenceObjects"]>; + 'svgClassNameChanged': JetElementCustomEvent["svgClassName"]>; + 'svgStyleChanged': JetElementCustomEvent["svgStyle"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'typeChanged': JetElementCustomEvent["type"]>; + 'visualEffectsChanged': JetElementCustomEvent["visualEffects"]>; +} +export interface ojSparkChartSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number | null; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + areaColor: string; + areaSvgClassName: string; + areaSvgStyle: object; + as: string; + barGapRatio: number; + baselineScaling: 'zero' | 'min'; + color: string; + data: DataProvider | null; + firstColor: string; + highColor: string; + lastColor: string; + lineStyle: 'dotted' | 'dashed' | 'solid'; + lineType: 'curved' | 'stepped' | 'centeredStepped' | 'segmented' | 'centeredSegmented' | 'none' | 'straight'; + lineWidth: number; + lowColor: string; + markerShape: 'auto' | 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSize: number; + referenceObjects: ojSparkChart.ReferenceObject[]; + svgClassName: string; + svgStyle: object; + tooltip: { + renderer: ((context: ojSparkChart.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })) | null; + }; + type: 'area' | 'lineWithArea' | 'bar' | 'line'; + visualEffects: 'none' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojSparkChartSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export namespace ojSparkChart { + // tslint:disable-next-line interface-over-type-literal + type Item = { + borderColor: string; + color: string; + date: Date; + high: number; + low: number; + markerDisplayed: 'on' | 'off'; + markerShape: 'square' | 'circle' | 'diamond' | 'plus' | 'triangleDown' | 'triangleUp' | 'human' | 'star' | 'auto' | string; + markerSize: number; + svgClassName: string; + svgStyle: object; + value: number; + }; + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + borderColor: string; + color: string; + date: Date; + high: number; + low: number; + value: number; + }; + // tslint:disable-next-line interface-over-type-literal + type ReferenceObject = { + color?: string; + high?: number; + lineWidth?: number; + lineStyle: 'dotted' | 'dashed' | 'solid'; + location: 'front' | 'back'; + low?: number; + svgClassName?: string; + svgStyle?: object; + type: 'area' | 'line'; + value?: number; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + color: string; + componentElement: Element; + parentElement: Element; + }; +} +export interface ojSparkChartItem extends JetElement { + borderColor: string; + color: string; + date: string; + high: number | null; + low: number | null; + markerDisplayed: 'off' | 'on'; + markerShape?: 'auto' | 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSize: number; + svgClassName: string; + svgStyle: object; + value: number | null; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onDateChanged: ((event: JetElementCustomEvent) => any) | null; + onHighChanged: ((event: JetElementCustomEvent) => any) | null; + onLowChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerDisplayedChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerShapeChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerSizeChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSparkChartItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojSparkChartItem[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojSparkChartItemSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojSparkChartItemSettablePropertiesLenient): void; +} +export interface ojSparkChartItemEventMap extends HTMLElementEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'dateChanged': JetElementCustomEvent; + 'highChanged': JetElementCustomEvent; + 'lowChanged': JetElementCustomEvent; + 'markerDisplayedChanged': JetElementCustomEvent; + 'markerShapeChanged': JetElementCustomEvent; + 'markerSizeChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojSparkChartItemSettableProperties extends JetSettableProperties { + borderColor: string; + color: string; + date: string; + high: number | null; + low: number | null; + markerDisplayed: 'off' | 'on'; + markerShape?: 'auto' | 'circle' | 'diamond' | 'human' | 'plus' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSize: number; + svgClassName: string; + svgStyle: object; + value: number | null; +} +export interface ojSparkChartItemSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojcheckboxset/index.d.ts b/types/oraclejet/ojcheckboxset/index.d.ts new file mode 100644 index 0000000000..afed42d51c --- /dev/null +++ b/types/oraclejet/ojcheckboxset/index.d.ts @@ -0,0 +1,69 @@ +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojCheckboxset extends editableValue { + disabled: boolean; + labelledBy: string | null; + required: boolean; + value: any[]; + translations: { + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelledByChanged: ((event: JetElementCustomEvent) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojCheckboxset.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojCheckboxset.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojCheckboxsetEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojCheckboxset[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojCheckboxsetSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojCheckboxsetSettablePropertiesLenient): void; + refresh(): void; + validate(): Promise; +} +export namespace ojCheckboxset { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojCheckboxsetEventMap extends editableValueEventMap { + 'ojAnimateEnd': ojCheckboxset.ojAnimateEnd; + 'ojAnimateStart': ojCheckboxset.ojAnimateStart; + 'disabledChanged': JetElementCustomEvent; + 'labelledByChanged': JetElementCustomEvent; + 'requiredChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojCheckboxsetSettableProperties extends editableValueSettableProperties { + disabled: boolean; + labelledBy: string | null; + required: boolean; + value: any[]; + translations: { + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; +} +export interface ojCheckboxsetSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojcollapsible/index.d.ts b/types/oraclejet/ojcollapsible/index.d.ts new file mode 100644 index 0000000000..1d677ed1c1 --- /dev/null +++ b/types/oraclejet/ojcollapsible/index.d.ts @@ -0,0 +1,64 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojCollapsible extends baseComponent { + disabled: boolean; + expandArea: 'header' | 'disclosureIcon'; + expanded: boolean; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onExpandAreaChanged: ((event: JetElementCustomEvent) => any) | null; + onExpandedChanged: ((event: JetElementCustomEvent) => any) | null; + onOjBeforeCollapse: ((event: ojCollapsible.ojBeforeCollapse) => any) | null; + onOjBeforeExpand: ((event: ojCollapsible.ojBeforeExpand) => any) | null; + onOjCollapse: ((event: ojCollapsible.ojCollapse) => any) | null; + onOjExpand: ((event: ojCollapsible.ojExpand) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojCollapsibleEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojCollapsible[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojCollapsibleSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojCollapsibleSettablePropertiesLenient): void; + refresh(): void; +} +export namespace ojCollapsible { + interface ojBeforeCollapse extends CustomEvent<{ + header: Element; + content: Element; + [propName: string]: any; + }> { + } + interface ojBeforeExpand extends CustomEvent<{ + header: Element; + content: Element; + [propName: string]: any; + }> { + } + interface ojCollapse extends CustomEvent<{ + header: Element; + content: Element; + [propName: string]: any; + }> { + } + interface ojExpand extends CustomEvent<{ + header: Element; + content: Element; + [propName: string]: any; + }> { + } +} +export interface ojCollapsibleEventMap extends baseComponentEventMap { + 'ojBeforeCollapse': ojCollapsible.ojBeforeCollapse; + 'ojBeforeExpand': ojCollapsible.ojBeforeExpand; + 'ojCollapse': ojCollapsible.ojCollapse; + 'ojExpand': ojCollapsible.ojExpand; + 'disabledChanged': JetElementCustomEvent; + 'expandAreaChanged': JetElementCustomEvent; + 'expandedChanged': JetElementCustomEvent; +} +export interface ojCollapsibleSettableProperties extends baseComponentSettableProperties { + disabled: boolean; + expandArea: 'header' | 'disclosureIcon'; + expanded: boolean; +} +export interface ojCollapsibleSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojcollectiondataprovider/index.d.ts b/types/oraclejet/ojcollectiondataprovider/index.d.ts new file mode 100644 index 0000000000..19b87d4f8a --- /dev/null +++ b/types/oraclejet/ojcollectiondataprovider/index.d.ts @@ -0,0 +1,16 @@ +import { Collection } from '../ojmodel'; +import { DataProvider, FetchByKeysParameters, ContainsKeysResults, FetchByKeysResults, FetchByOffsetParameters, FetchByOffsetResults, FetchListResult, FetchListParameters } from '../ojdataprovider'; +declare class CollectionDataProvider implements DataProvider { + constructor(collection: Collection); + addEventListener(eventType: string, listener: EventListener): void; + containsKeys(params: FetchByKeysParameters): Promise>; + dispatchEvent(evt: Event): boolean; + fetchByKeys(params: FetchByKeysParameters): Promise>; + fetchByOffset(params: FetchByOffsetParameters): Promise>; + fetchFirst(params?: FetchListParameters): AsyncIterable>; + getCapability(capabilityName?: string): any; + getTotalSize(): Promise; + isEmpty(): 'yes' | 'no' | 'unknown'; + removeEventListener(eventType: string, listener: EventListener): void; +} +export = CollectionDataProvider; diff --git a/types/oraclejet/ojcolor/index.d.ts b/types/oraclejet/ojcolor/index.d.ts new file mode 100644 index 0000000000..b252df9ab7 --- /dev/null +++ b/types/oraclejet/ojcolor/index.d.ts @@ -0,0 +1,182 @@ +declare class Color { + static ALICEBLUE: Color; + static ANTIQUEWHITE: Color; + static AQUA: Color; + static AQUAMARINE: Color; + static AZURE: Color; + static BEIGE: Color; + static BISQUE: Color; + static BLACK: Color; + static BLANCHEDALMOND: Color; + static BLUE: Color; + static BLUEVIOLET: Color; + static BROWN: Color; + static BURLYWOOD: Color; + static CADETBLUE: Color; + static CHARTREUSE: Color; + static CHOCOLATE: Color; + static CORAL: Color; + static CORNFLOWERBLUE: Color; + static CORNSILK: Color; + static CRIMSON: Color; + static CYAN: Color; + static DARKBLUE: Color; + static DARKCYAN: Color; + static DARKGOLDENROD: Color; + static DARKGRAY: Color; + static DARKGREEN: Color; + static DARKGREY: Color; + static DARKKHAKI: Color; + static DARKMAGENTA: Color; + static DARKOLIVEGREEN: Color; + static DARKORANGE: Color; + static DARKORCHID: Color; + static DARKRED: Color; + static DARKSALMON: Color; + static DARKSEAGREEN: Color; + static DARKSLATEBLUE: Color; + static DARKSLATEGRAY: Color; + static DARKSLATEGREY: Color; + static DARKTURQUOISE: Color; + static DARKVIOLET: Color; + static DEEPPINK: Color; + static DEEPSKYBLUE: Color; + static DIMGRAY: Color; + static DIMGREY: Color; + static DODGERBLUE: Color; + static FIREBRICK: Color; + static FLORALWHITE: Color; + static FORESTGREEN: Color; + static FUCHSIA: Color; + static GAINSBORO: Color; + static GHOSTWHITE: Color; + static GOLD: Color; + static GOLDENROD: Color; + static GRAY: Color; + static GREEN: Color; + static GREENYELLOW: Color; + static GREY: Color; + static HONEYDEW: Color; + static HOTPINK: Color; + static INDIANRED: Color; + static INDIGO: Color; + static IVORY: Color; + static KHAKI: Color; + static LAVENDER: Color; + static LAVENDERBLUSH: Color; + static LAWNGREEN: Color; + static LEMONCHIFFON: Color; + static LIGHTBLUE: Color; + static LIGHTCORAL: Color; + static LIGHTCYAN: Color; + static LIGHTGOLDENRODYELLOW: Color; + static LIGHTGRAY: Color; + static LIGHTGREEN: Color; + static LIGHTGREY: Color; + static LIGHTPINK: Color; + static LIGHTSALMON: Color; + static LIGHTSEAGREEN: Color; + static LIGHTSKYBLUE: Color; + static LIGHTSLATEGRAY: Color; + static LIGHTSLATEGREY: Color; + static LIGHTSTEELBLUE: Color; + static LIGHTYELLOW: Color; + static LIME: Color; + static LIMEGREEN: Color; + static LINEN: Color; + static MAGENTA: Color; + static MAROON: Color; + static MEDIUMAQUAMARINE: Color; + static MEDIUMBLUE: Color; + static MEDIUMORCHID: Color; + static MEDIUMPURPLE: Color; + static MEDIUMSEAGREEN: Color; + static MEDIUMSLATEBLUE: Color; + static MEDIUMSPRINGGREEN: Color; + static MEDIUMTURQUOISE: Color; + static MEDIUMVIOLETRED: Color; + static MIDNIGHTBLUE: Color; + static MINTCREAM: Color; + static MISTYROSE: Color; + static MOCCASIN: Color; + static NAVAJOWHITE: Color; + static NAVY: Color; + static OLDLACE: Color; + static OLIVE: Color; + static OLIVEDRAB: Color; + static ORANGE: Color; + static ORANGERED: Color; + static ORCHID: Color; + static PALEGOLDENROD: Color; + static PALEGREEN: Color; + static PALETURQUOISE: Color; + static PALEVIOLETRED: Color; + static PAPAYAWHIP: Color; + static PEACHPUFF: Color; + static PERU: Color; + static PINK: Color; + static PLUM: Color; + static POWDERBLUE: Color; + static PURPLE: Color; + static REBECCAPURPLE: Color; + static RED: Color; + static ROSYBROWN: Color; + static ROYALBLUE: Color; + static SADDLEBROWN: Color; + static SALMON: Color; + static SANDYBROWN: Color; + static SEAGREEN: Color; + static SEASHELL: Color; + static SIENNA: Color; + static SILVER: Color; + static SKYBLUE: Color; + static SLATEBLUE: Color; + static SLATEGRAY: Color; + static SLATEGREY: Color; + static SNOW: Color; + static SPRINGGREEN: Color; + static STEELBLUE: Color; + static TAN: Color; + static TEAL: Color; + static THISTLE: Color; + static TOMATO: Color; + static TRANSPARENT: Color; + static TURQUOISE: Color; + static VIOLET: Color; + static WHEAT: Color; + static WHITE: Color; + static WHITESMOKE: Color; + static YELLOW: Color; + static YELLOWGREEN: Color; + constructor(color: string | Color.RGBA | Color.HSLA | Color.HSVA); + getAlpha(): number; + getBlue(doNotRound?: boolean): number; + getGreen(doNotRound?: boolean): number; + getRed(doNotRound?: boolean): number; + isEqual(color: Color): boolean; + toString(): string; +} +declare namespace Color { + // tslint:disable-next-line interface-over-type-literal + type HSLA = { + h: number; + s: number; + l: number; + a?: number; + }; + // tslint:disable-next-line interface-over-type-literal + type HSVA = { + h: number; + s: number; + v: number; + a?: number; + }; + // tslint:disable-next-line interface-over-type-literal + type RGBA = { + r: number; + g: number; + b: number; + a?: number; + }; +} +export = Color; diff --git a/types/oraclejet/ojcolorpalette/index.d.ts b/types/oraclejet/ojcolorpalette/index.d.ts new file mode 100644 index 0000000000..5e0b278199 --- /dev/null +++ b/types/oraclejet/ojcolorpalette/index.d.ts @@ -0,0 +1,74 @@ +import Color = require('../ojcolor'); +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojColorPalette extends editableValue { + labelDisplay: 'auto' | 'off'; + labelledBy: string | null; + layout: 'grid' | 'list'; + palette: Array<{ + color: Color; + label?: string; + }>; + swatchSize: 'xs' | 'sm' | 'lg'; + value: Color; + translations: { + labelNone?: string; + }; + onLabelDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelledByChanged: ((event: JetElementCustomEvent) => any) | null; + onLayoutChanged: ((event: JetElementCustomEvent) => any) | null; + onPaletteChanged: ((event: JetElementCustomEvent) => any) | null; + onSwatchSizeChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojColorPalette.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojColorPalette.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojColorPaletteEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojColorPalette[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojColorPaletteSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojColorPaletteSettablePropertiesLenient): void; +} +export namespace ojColorPalette { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojColorPaletteEventMap extends editableValueEventMap { + 'ojAnimateEnd': ojColorPalette.ojAnimateEnd; + 'ojAnimateStart': ojColorPalette.ojAnimateStart; + 'labelDisplayChanged': JetElementCustomEvent; + 'labelledByChanged': JetElementCustomEvent; + 'layoutChanged': JetElementCustomEvent; + 'paletteChanged': JetElementCustomEvent; + 'swatchSizeChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojColorPaletteSettableProperties extends editableValueSettableProperties { + labelDisplay: 'auto' | 'off'; + labelledBy: string | null; + layout: 'grid' | 'list'; + palette: Array<{ + color: Color; + label?: string; + }>; + swatchSize: 'xs' | 'sm' | 'lg'; + value: Color; + translations: { + labelNone?: string; + }; +} +export interface ojColorPaletteSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojcolorspectrum/index.d.ts b/types/oraclejet/ojcolorspectrum/index.d.ts new file mode 100644 index 0000000000..a96f0c1977 --- /dev/null +++ b/types/oraclejet/ojcolorspectrum/index.d.ts @@ -0,0 +1,62 @@ +import Color = require('../ojcolor'); +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojColorSpectrum extends editableValue { + labelledBy: string | null; + readonly transientValue: Color; + value: Color; + translations: { + labelHue?: string; + labelOpacity?: string; + labelSatLum?: string; + labelThumbDesc?: string; + }; + onLabelledByChanged: ((event: JetElementCustomEvent) => any) | null; + onTransientValueChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojColorSpectrum.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojColorSpectrum.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojColorSpectrumEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojColorSpectrum[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojColorSpectrumSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojColorSpectrumSettablePropertiesLenient): void; +} +export namespace ojColorSpectrum { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojColorSpectrumEventMap extends editableValueEventMap { + 'ojAnimateEnd': ojColorSpectrum.ojAnimateEnd; + 'ojAnimateStart': ojColorSpectrum.ojAnimateStart; + 'labelledByChanged': JetElementCustomEvent; + 'transientValueChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojColorSpectrumSettableProperties extends editableValueSettableProperties { + labelledBy: string | null; + readonly transientValue: Color; + value: Color; + translations: { + labelHue?: string; + labelOpacity?: string; + labelSatLum?: string; + labelThumbDesc?: string; + }; +} +export interface ojColorSpectrumSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojcomponentcore/index.d.ts b/types/oraclejet/ojcomponentcore/index.d.ts new file mode 100644 index 0000000000..17ab67c7b9 --- /dev/null +++ b/types/oraclejet/ojcomponentcore/index.d.ts @@ -0,0 +1,6 @@ +export function subtreeAttached(node: Element): void; +export function subtreeDetached(node: Element): void; +export function subtreeHidden(node: Element): void; +export function subtreeShown(node: Element, options?: { + initialRender: boolean; +}): void; diff --git a/types/oraclejet/ojcomposite/index.d.ts b/types/oraclejet/ojcomposite/index.d.ts new file mode 100644 index 0000000000..d8ed0bbb4e --- /dev/null +++ b/types/oraclejet/ojcomposite/index.d.ts @@ -0,0 +1,45 @@ +export function getComponentMetadata(name: string): Metadata | null; +export function register(name: string, descriptor: { + metadata: Metadata; + view: string; + viewModel: ((param0: ViewModelContext) => void | object); + parseFunction: ((value: string, name: string, meta: object, defaultParseFunction: (value: string) => any) => any); +}): void; +// tslint:disable-next-line interface-over-type-literal +export type Metadata = { + name: string; + version: string; + jetVersion: string; + properties?: object; + methods?: object; + events?: object; + slots?: object; +}; +// tslint:disable-next-line interface-over-type-literal +export type PropertyChangedContext = { + property: string; + value: any; + previousValue: any; + updatedFrom: 'external' | 'internal'; + subproperty?: { + path: string; + value: any; + previousValue: any; + }; +}; +// tslint:disable-next-line interface-over-type-literal +export type ViewModel = { + activated: ((param0: ViewModelContext) => Promise | void); + connected: ((param0: ViewModelContext) => void); + bindingsApplied: ((param0: ViewModelContext) => void); + propertyChanged: ((param0: PropertyChangedContext) => void); + disconnected: ((param0: Element) => void); +}; +// tslint:disable-next-line interface-over-type-literal +export type ViewModelContext = { + element: Element; + properties: object; + slotCounts: object; + unique: string; + uniqueId: string; +}; diff --git a/types/oraclejet/ojconfig/index.d.ts b/types/oraclejet/ojconfig/index.d.ts new file mode 100644 index 0000000000..6fefb1406c --- /dev/null +++ b/types/oraclejet/ojconfig/index.d.ts @@ -0,0 +1,9 @@ +export function getAutomationMode(): string; +export function getDeviceType(): 'phone' | 'tablet' | 'others'; +export function getLocale(): string; +export function getResourceUrl(relativePath: string): string; +export function getVersionInfo(): string; +export function logVersionInfo(): undefined; +export function setAutomationMode(mode: string): undefined; +export function setLocale(locale: string, callback?: (() => void)): undefined; +export function setResourceBaseUrl(baseUrl: string): undefined; diff --git a/types/oraclejet/ojcontext/index.d.ts b/types/oraclejet/ojcontext/index.d.ts new file mode 100644 index 0000000000..0bb6a856c7 --- /dev/null +++ b/types/oraclejet/ojcontext/index.d.ts @@ -0,0 +1,39 @@ +declare class BusyContext { + addBusyState(options: { + description: object | (() => string); + }): (() => void); + applicationBootstrapComplete(): undefined; + clear(): undefined; + dump(message?: string): undefined; + getBusyStates(): Array<{ + id: string; + description: string; + }>; + isReady(): boolean; + toString(): string; + whenReady(timeout?: number): Promise<(boolean | Error)>; +} +declare namespace Context { + interface BusyContext { + addBusyState(options: { + description: object | (() => string); + }): (() => void); + applicationBootstrapComplete(): undefined; + clear(): undefined; + dump(message?: string): undefined; + getBusyStates(): Array<{ + id: string; + description: string; + }>; + isReady(): boolean; + toString(): string; + whenReady(timeout?: number): Promise<(boolean | Error)>; + } +} +declare class Context { + static getContext(node: Element): Context; + static getPageContext(): Context; + static setBusyContextDefaultTimeout(timeout: number): any; + getBusyContext(): BusyContext; +} +export = Context; diff --git a/types/oraclejet/ojconveyorbelt/index.d.ts b/types/oraclejet/ojconveyorbelt/index.d.ts new file mode 100644 index 0000000000..bacc5f7a7f --- /dev/null +++ b/types/oraclejet/ojconveyorbelt/index.d.ts @@ -0,0 +1,26 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojConveyorBelt extends baseComponent { + contentParent: string | null; + orientation: 'horizontal' | 'vertical'; + onContentParentChanged: ((event: JetElementCustomEvent) => any) | null; + onOrientationChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojConveyorBeltEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojConveyorBelt[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojConveyorBeltSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojConveyorBeltSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojConveyorBeltEventMap extends baseComponentEventMap { + 'contentParentChanged': JetElementCustomEvent; + 'orientationChanged': JetElementCustomEvent; +} +export interface ojConveyorBeltSettableProperties extends baseComponentSettableProperties { + contentParent: string | null; + orientation: 'horizontal' | 'vertical'; +} +export interface ojConveyorBeltSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojdatagrid/index.d.ts b/types/oraclejet/ojdatagrid/index.d.ts new file mode 100644 index 0000000000..073f5de2af --- /dev/null +++ b/types/oraclejet/ojdatagrid/index.d.ts @@ -0,0 +1,520 @@ +import { DataProvider } from '../ojdataprovider'; +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojDataGrid extends baseComponent> { + bandingInterval: { + column: number; + row: number; + }; + cell: { + className?: ((context: ojDataGrid.CellContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.CellContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.CellContext) => string | void | null) | string | null; + }; + currentCell: ojDataGrid.CurrentCell | null; + data: DataProvider; + dnd: { + reorder: { + row: 'enable' | 'disable'; + }; + }; + editMode: 'none' | 'cellNavigation' | 'cellEdit'; + gridlines: { + horizontal: 'visible' | 'hidden'; + vertical: 'visible' | 'hidden'; + }; + header: { + column: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height: 'enable' | 'disable'; + width?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + }; + sortable?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + columnEnd: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height: 'enable' | 'disable'; + width?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + }; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + row: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + width: 'enable' | 'disable'; + }; + sortable?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + rowEnd: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + width: 'enable' | 'disable'; + }; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + }; + scrollPolicy: 'auto' | 'loadMoreOnScroll' | 'scroll'; + scrollPolicyOptions: { + maxColumnCount: number; + maxRowCount: number; + }; + scrollPosition: { + x?: number; + y?: number; + rowIndex?: number; + columnIndex?: number; + rowKey?: K; + columnKey?: K; + offsetX?: number; + offsetY?: number; + }; + selection: Array>; + selectionMode: { + cell: 'none' | 'single' | 'multiple'; + row: 'none' | 'single' | 'multiple'; + }; + translations: { + accessibleActionableMode?: string; + accessibleColumnContext?: string; + accessibleColumnEndHeaderContext?: string; + accessibleColumnHeaderContext?: string; + accessibleColumnSelected?: string; + accessibleColumnSpanContext?: string; + accessibleFirstColumn?: string; + accessibleFirstRow?: string; + accessibleLastColumn?: string; + accessibleLastRow?: string; + accessibleLevelContext?: string; + accessibleMultiCellSelected?: string; + accessibleNavigationMode?: string; + accessibleRangeSelectModeOff?: string; + accessibleRangeSelectModeOn?: string; + accessibleRowCollapsed?: string; + accessibleRowContext?: string; + accessibleRowEndHeaderContext?: string; + accessibleRowExpanded?: string; + accessibleRowHeaderContext?: string; + accessibleRowSelected?: string; + accessibleRowSpanContext?: string; + accessibleSelectionAffordanceBottom?: string; + accessibleSelectionAffordanceTop?: string; + accessibleSortAscending?: string; + accessibleSortDescending?: string; + accessibleStateSelected?: string; + accessibleSummaryEstimate?: string; + accessibleSummaryExact?: string; + accessibleSummaryExpanded?: string; + labelCut?: string; + labelDisableNonContiguous?: string; + labelEnableNonContiguous?: string; + labelPaste?: string; + labelResize?: string; + labelResizeDialogSubmit?: string; + labelResizeHeight?: string; + labelResizeWidth?: string; + labelSortCol?: string; + labelSortColAsc?: string; + labelSortColDsc?: string; + labelSortRow?: string; + labelSortRowAsc?: string; + labelSortRowDsc?: string; + msgFetchingData?: string; + msgNoData?: string; + }; + onBandingIntervalChanged: ((event: JetElementCustomEvent["bandingInterval"]>) => any) | null; + onCellChanged: ((event: JetElementCustomEvent["cell"]>) => any) | null; + onCurrentCellChanged: ((event: JetElementCustomEvent["currentCell"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDndChanged: ((event: JetElementCustomEvent["dnd"]>) => any) | null; + onEditModeChanged: ((event: JetElementCustomEvent["editMode"]>) => any) | null; + onGridlinesChanged: ((event: JetElementCustomEvent["gridlines"]>) => any) | null; + onHeaderChanged: ((event: JetElementCustomEvent["header"]>) => any) | null; + onScrollPolicyChanged: ((event: JetElementCustomEvent["scrollPolicy"]>) => any) | null; + onScrollPolicyOptionsChanged: ((event: JetElementCustomEvent["scrollPolicyOptions"]>) => any) | null; + onScrollPositionChanged: ((event: JetElementCustomEvent["scrollPosition"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onOjBeforeCurrentCell: ((event: ojDataGrid.ojBeforeCurrentCell) => any) | null; + onOjBeforeEdit: ((event: ojDataGrid.ojBeforeEdit) => any) | null; + onOjBeforeEditEnd: ((event: ojDataGrid.ojBeforeEditEnd) => any) | null; + onOjResize: ((event: ojDataGrid.ojResize) => any) | null; + onOjScroll: ((event: ojDataGrid.ojScroll) => any) | null; + onOjSort: ((event: ojDataGrid.ojSort) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojDataGridEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojDataGrid[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojDataGridSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojDataGridSettablePropertiesLenient): void; + getContextByNode(node: Element): ojDataGrid.CellContext & { + subId: 'oj-datagrid-cell'; + } | ojDataGrid.HeaderContext & { + subId: 'oj-datagrid-header'; + } | ojDataGrid.LabelContext & { + subId: 'oj-datagrid-header-label'; + }; + refresh(): void; +} +export namespace ojDataGrid { + interface ojBeforeCurrentCell extends CustomEvent<{ + currentCell: CurrentCell; + previousCurrentCell: CurrentCell; + [propName: string]: any; + }> { + } + interface ojBeforeEdit extends CustomEvent<{ + cellContext: CellContext; + [propName: string]: any; + }> { + } + interface ojBeforeEditEnd extends CustomEvent<{ + cellContext: CellContext; + cancelEdit: boolean; + [propName: string]: any; + }> { + } + interface ojResize extends CustomEvent<{ + header: string | number; + oldDimensions: { + width: number; + height: number; + }; + newDimensions: { + width: number; + height: number; + }; + [propName: string]: any; + }> { + } + interface ojScroll extends CustomEvent<{ + scrollX: number; + scrollY: number; + [propName: string]: any; + }> { + } + interface ojSort extends CustomEvent<{ + header: any; + direction: 'ascending' | 'descending'; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type CellContext = { + componentElement: Element; + parentElement: Element; + cell: D; + data: D; + datasource: DataProvider | null; + indexes: { + row: number; + column: number; + }; + keys: { + row: K; + column: K; + }; + extents: { + row: number; + column: number; + }; + mode: 'edit' | 'navigation'; + }; + // tslint:disable-next-line interface-over-type-literal + type CurrentCell = { + type: 'cell' | 'header' | 'label'; + axis?: 'column' | 'columnEnd' | 'row' | 'rowEnd'; + index?: number; + level?: number; + key?: any; + indexes?: { + row: number; + column: number; + }; + keys?: { + row: K; + column: K; + }; + }; + // tslint:disable-next-line interface-over-type-literal + type HeaderContext = { + componentElement: Element; + parentElement: Element; + data: D; + datasource: DataProvider | null; + axis: 'column' | 'columnEnd' | 'row' | 'rowEnd'; + index: number; + key: K; + level: number; + extent: number; + depth: number; + }; + // tslint:disable-next-line interface-over-type-literal + type LabelContext = { + componentElement: Element; + parentElement: Element; + datasource: DataProvider | null; + axis: 'column' | 'columnEnd' | 'row' | 'rowEnd'; + key: K; + level: number; + }; + // tslint:disable-next-line interface-over-type-literal + type Selection = { + startIndex?: { + row: number; + column?: number; + }; + startKey?: { + row: K; + column?: K; + }; + endIndex?: { + row: number; + column?: number; + }; + endKey?: { + row: K; + column?: K; + }; + }; +} +export interface ojDataGridEventMap extends baseComponentEventMap> { + 'ojBeforeCurrentCell': ojDataGrid.ojBeforeCurrentCell; + 'ojBeforeEdit': ojDataGrid.ojBeforeEdit; + 'ojBeforeEditEnd': ojDataGrid.ojBeforeEditEnd; + 'ojResize': ojDataGrid.ojResize; + 'ojScroll': ojDataGrid.ojScroll; + 'ojSort': ojDataGrid.ojSort; + 'bandingIntervalChanged': JetElementCustomEvent["bandingInterval"]>; + 'cellChanged': JetElementCustomEvent["cell"]>; + 'currentCellChanged': JetElementCustomEvent["currentCell"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'dndChanged': JetElementCustomEvent["dnd"]>; + 'editModeChanged': JetElementCustomEvent["editMode"]>; + 'gridlinesChanged': JetElementCustomEvent["gridlines"]>; + 'headerChanged': JetElementCustomEvent["header"]>; + 'scrollPolicyChanged': JetElementCustomEvent["scrollPolicy"]>; + 'scrollPolicyOptionsChanged': JetElementCustomEvent["scrollPolicyOptions"]>; + 'scrollPositionChanged': JetElementCustomEvent["scrollPosition"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; +} +export interface ojDataGridSettableProperties extends baseComponentSettableProperties { + bandingInterval: { + column: number; + row: number; + }; + cell: { + className?: ((context: ojDataGrid.CellContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.CellContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.CellContext) => string | void | null) | string | null; + }; + currentCell: ojDataGrid.CurrentCell | null; + data: DataProvider | null; + dnd: { + reorder: { + row: 'enable' | 'disable'; + }; + }; + editMode: 'none' | 'cellNavigation' | 'cellEdit'; + gridlines: { + horizontal: 'visible' | 'hidden'; + vertical: 'visible' | 'hidden'; + }; + header: { + column: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height: 'enable' | 'disable'; + width?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + }; + sortable?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + columnEnd: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height: 'enable' | 'disable'; + width?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + }; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + row: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + width: 'enable' | 'disable'; + }; + sortable?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + rowEnd: { + className?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + label: { + className?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + renderer?: ((context: ojDataGrid.LabelContext) => { + insert: HTMLElement | string; + } | void | null) | null; + style?: ((context: ojDataGrid.LabelContext) => string | void | null) | string | null; + }; + renderer?: ((context: ojDataGrid.HeaderContext) => { + insert: HTMLElement | string; + } | void | null) | null; + resizable: { + height?: ((context: ojDataGrid.HeaderContext) => string) | string | null; + width: 'enable' | 'disable'; + }; + style?: ((context: ojDataGrid.HeaderContext) => string | void | null) | string | null; + }; + }; + scrollPolicy: 'auto' | 'loadMoreOnScroll' | 'scroll'; + scrollPolicyOptions: { + maxColumnCount: number; + maxRowCount: number; + }; + scrollPosition: { + x?: number; + y?: number; + rowIndex?: number; + columnIndex?: number; + rowKey?: K; + columnKey?: K; + offsetX?: number; + offsetY?: number; + }; + selection: Array>; + selectionMode: { + cell: 'none' | 'single' | 'multiple'; + row: 'none' | 'single' | 'multiple'; + }; + translations: { + accessibleActionableMode?: string; + accessibleColumnContext?: string; + accessibleColumnEndHeaderContext?: string; + accessibleColumnHeaderContext?: string; + accessibleColumnSelected?: string; + accessibleColumnSpanContext?: string; + accessibleFirstColumn?: string; + accessibleFirstRow?: string; + accessibleLastColumn?: string; + accessibleLastRow?: string; + accessibleLevelContext?: string; + accessibleMultiCellSelected?: string; + accessibleNavigationMode?: string; + accessibleRangeSelectModeOff?: string; + accessibleRangeSelectModeOn?: string; + accessibleRowCollapsed?: string; + accessibleRowContext?: string; + accessibleRowEndHeaderContext?: string; + accessibleRowExpanded?: string; + accessibleRowHeaderContext?: string; + accessibleRowSelected?: string; + accessibleRowSpanContext?: string; + accessibleSelectionAffordanceBottom?: string; + accessibleSelectionAffordanceTop?: string; + accessibleSortAscending?: string; + accessibleSortDescending?: string; + accessibleStateSelected?: string; + accessibleSummaryEstimate?: string; + accessibleSummaryExact?: string; + accessibleSummaryExpanded?: string; + labelCut?: string; + labelDisableNonContiguous?: string; + labelEnableNonContiguous?: string; + labelPaste?: string; + labelResize?: string; + labelResizeDialogSubmit?: string; + labelResizeHeight?: string; + labelResizeWidth?: string; + labelSortCol?: string; + labelSortColAsc?: string; + labelSortColDsc?: string; + labelSortRow?: string; + labelSortRowAsc?: string; + labelSortRowDsc?: string; + msgFetchingData?: string; + msgNoData?: string; + }; +} +export interface ojDataGridSettablePropertiesLenient extends Partial> { + [key: string]: any; +} diff --git a/types/oraclejet/ojdataprovider/index.d.ts b/types/oraclejet/ojdataprovider/index.d.ts new file mode 100644 index 0000000000..accc1f25bc --- /dev/null +++ b/types/oraclejet/ojdataprovider/index.d.ts @@ -0,0 +1,111 @@ +export interface AttributeFilterOperator { + attribute: string; + op: AttributeFilterOperator.AttributeOperator; + value: any; +} +export namespace AttributeFilterOperator { + type AttributeOperator = "$co" | "$eq" | "$ew" | "$pr" | "$gt" | "$ge" | "$lt" | "$le" | "$ne" | "$regex" | "$sw"; +} +export interface CompoundFilterOperator { + criteria: Array>; + op: CompoundFilterOperator.CompoundOperator; +} +export namespace CompoundFilterOperator { + type CompoundOperator = "$and" | "$or"; +} +export interface ContainsKeysResults { + containsParameters: FetchByKeysParameters; + results: Set; +} +export interface DataMapping { + mapFields: (item: Item) => Item; + mapFilterCriterion?: (filterCriterion: Array>) => Array>; + mapSortCriteria?: (sortCriteria: Array>) => Array>; + unmapSortCriteria?: (sortCriteria: Array>) => Array>; +} +export interface DataProvider extends EventTarget { + containsKeys(parameters: FetchByKeysParameters): Promise>; + fetchByKeys(parameters: FetchByKeysParameters): Promise>; + fetchByOffset(parameters: FetchByOffsetParameters): Promise>; + fetchFirst(parameters?: FetchListParameters): AsyncIterable>; + getCapability(capabilityName: string): any; + getTotalSize(): Promise; + isEmpty(): 'yes' | 'no' | 'unknown'; +} +export interface DataProviderAddOperationEventDetail extends DataProviderOperationEventDetail { + addBeforeKeys?: K[]; + parentKeys?: K[]; +} +export interface DataProviderMutationEventDetail { + add?: DataProviderAddOperationEventDetail; + remove?: DataProviderOperationEventDetail; + update?: DataProviderOperationEventDetail; +} +export interface DataProviderOperationEventDetail { + data?: D[]; + indexes?: number[]; + keys: Set; + metadata?: Array>; +} +export interface FetchByKeysCapability { + implementation: 'iteration' | 'lookup'; +} +export namespace FetchByKeysMixin { + function applyMixin(derivedCtor: { + new (): DataProvider; + }): any; +} +export interface FetchByKeysParameters { + keys: Set; +} +export interface FetchByKeysResults { + fetchParameters: FetchByKeysParameters; + results: Map>; +} +export interface FetchByOffsetCapability { + implementation: 'iteration' | 'randomAccess'; +} +export namespace FetchByOffsetMixin { + function applyMixin(derivedCtor: { + new (): DataProvider; + }): any; +} +export interface FetchByOffsetParameters extends FetchListParameters { + offset: number; +} +export interface FetchByOffsetResults { + done: boolean; + fetchParameters: FetchByOffsetParameters; + results: Array>; +} +export interface FetchListParameters { + filterCriterion?: FilterOperator; + size: number; + sortCriteria?: Array>; +} +export interface FetchListResult { + data: D[]; + fetchParameters: FetchListParameters; + metadata: Array>; +} +export interface FilterCapability { + operators: string[]; +} +export interface FilterOperator { + op: AttributeFilterOperator.AttributeOperator | CompoundFilterOperator.CompoundOperator; + filter(data: any[]): any[]; +} +export interface Item { + data: D; + metadata: ItemMetadata; +} +export interface ItemMetadata { + key: K; +} +export interface SortCapability { + attributes: 'none' | 'single' | 'multiple'; +} +export interface SortCriterion { + attribute: keyof D; + direction: string; +} diff --git a/types/oraclejet/ojdatetimepicker/index.d.ts b/types/oraclejet/ojdatetimepicker/index.d.ts new file mode 100644 index 0000000000..914dd06df7 --- /dev/null +++ b/types/oraclejet/ojdatetimepicker/index.d.ts @@ -0,0 +1,639 @@ +import { Converter, Validator, Validation } from '../ojvalidation-base'; +import { inputBase, inputBaseEventMap, inputBaseSettableProperties } from '../ojinputtext'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojDatePicker extends ojInputDate { + keyboardEdit: 'disabled'; + max: string | null; + min: string | null; + renderMode: 'jet'; + value: string; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojDatePicker.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojDatePicker.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDatePickerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojDatePicker[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojDatePickerSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojDatePickerSettablePropertiesLenient): void; +} +export namespace ojDatePicker { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojDatePickerEventMap extends ojInputDateEventMap { + 'ojAnimateEnd': ojDatePicker.ojAnimateEnd; + 'ojAnimateStart': ojDatePicker.ojAnimateStart; + 'maxChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojDatePickerSettableProperties extends ojInputDateSettableProperties { + keyboardEdit: 'disabled'; + max: string | null; + min: string | null; + renderMode: 'jet'; + value: string; +} +export interface ojDatePickerSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojDateTimePicker extends ojInputDateTime { + keyboardEdit: 'disabled'; + max: string | null; + min: string | null; + renderMode: 'jet'; + value: string; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojDateTimePicker.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojDateTimePicker.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDateTimePickerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojDateTimePicker[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojDateTimePickerSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojDateTimePickerSettablePropertiesLenient): void; +} +export namespace ojDateTimePicker { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojDateTimePickerEventMap extends ojInputDateTimeEventMap { + 'ojAnimateEnd': ojDateTimePicker.ojAnimateEnd; + 'ojAnimateStart': ojDateTimePicker.ojAnimateStart; + 'maxChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojDateTimePickerSettableProperties extends ojInputDateTimeSettableProperties { + keyboardEdit: 'disabled'; + max: string | null; + min: string | null; + renderMode: 'jet'; + value: string; +} +export interface ojDateTimePickerSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojInputDate extends inputBase { + converter: Converter | Validation.RegisteredConverter; + datePicker: { + changeMonth: 'select' | 'none'; + changeYear: 'select' | 'none'; + currentMonthPos: number; + daysOutsideMonth: 'hidden' | 'visible' | 'selectable'; + footerLayout: '' | 'today'; + numberOfMonths: number; + showOn: 'focus' | 'image'; + stepBigMonths: number; + stepMonths: 'numberOfMonths' | number; + weekDisplay: 'number' | 'none'; + yearRange: string; + }; + dayFormatter: (param: ojInputDate.DayFormatterInput) => (null | 'all' | ojInputDate.DayFormatterOutput); + dayMetaData: { + [key: string]: { + [key: string]: { + [key: string]: { + disabled?: boolean; + className?: string; + tooltip?: string; + }; + }; + }; + }; + keyboardEdit: 'enabled' | 'disabled'; + max: string | null; + min: string | null; + pickerAttributes: { + style?: string; + class?: string; + }; + renderMode: 'jet' | 'native'; + validators: Array | Validation.RegisteredValidator> | null; + value: string; + translations: { + currentText?: string; + dateRestriction?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + dateTimeRange?: { + hint?: { + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + nextText?: string; + prevText?: string; + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipCalendar?: string; + tooltipCalendarDisabled?: string; + tooltipCalendarTime?: string; + tooltipCalendarTimeDisabled?: string; + weekHeader?: string; + }; + onConverterChanged: ((event: JetElementCustomEvent["converter"]>) => any) | null; + onDatePickerChanged: ((event: JetElementCustomEvent["datePicker"]>) => any) | null; + onDayFormatterChanged: ((event: JetElementCustomEvent["dayFormatter"]>) => any) | null; + onDayMetaDataChanged: ((event: JetElementCustomEvent["dayMetaData"]>) => any) | null; + onKeyboardEditChanged: ((event: JetElementCustomEvent["keyboardEdit"]>) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent["max"]>) => any) | null; + onMinChanged: ((event: JetElementCustomEvent["min"]>) => any) | null; + onPickerAttributesChanged: ((event: JetElementCustomEvent["pickerAttributes"]>) => any) | null; + onRenderModeChanged: ((event: JetElementCustomEvent["renderMode"]>) => any) | null; + onValidatorsChanged: ((event: JetElementCustomEvent["validators"]>) => any) | null; + onValueChanged: ((event: JetElementCustomEvent["value"]>) => any) | null; + onOjAnimateEnd: ((event: ojInputDate.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojInputDate.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojInputDateEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojInputDate[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojInputDateSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojInputDateSettablePropertiesLenient): void; + hide(): void; + refresh(): void; + show(): void; +} +export namespace ojInputDate { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type DayFormatterInput = { + fullYear: number; + month: number; + date: number; + }; + // tslint:disable-next-line interface-over-type-literal + type DayFormatterOutput = { + disabled?: boolean; + className?: string; + tooltip?: string; + }; +} +export interface ojInputDateEventMap extends inputBaseEventMap { + 'ojAnimateEnd': ojInputDate.ojAnimateEnd; + 'ojAnimateStart': ojInputDate.ojAnimateStart; + 'converterChanged': JetElementCustomEvent["converter"]>; + 'datePickerChanged': JetElementCustomEvent["datePicker"]>; + 'dayFormatterChanged': JetElementCustomEvent["dayFormatter"]>; + 'dayMetaDataChanged': JetElementCustomEvent["dayMetaData"]>; + 'keyboardEditChanged': JetElementCustomEvent["keyboardEdit"]>; + 'maxChanged': JetElementCustomEvent["max"]>; + 'minChanged': JetElementCustomEvent["min"]>; + 'pickerAttributesChanged': JetElementCustomEvent["pickerAttributes"]>; + 'renderModeChanged': JetElementCustomEvent["renderMode"]>; + 'validatorsChanged': JetElementCustomEvent["validators"]>; + 'valueChanged': JetElementCustomEvent["value"]>; +} +export interface ojInputDateSettableProperties extends inputBaseSettableProperties { + converter: Converter | Validation.RegisteredConverter; + datePicker: { + changeMonth: 'select' | 'none'; + changeYear: 'select' | 'none'; + currentMonthPos: number; + daysOutsideMonth: 'hidden' | 'visible' | 'selectable'; + footerLayout: '' | 'today'; + numberOfMonths: number; + showOn: 'focus' | 'image'; + stepBigMonths: number; + stepMonths: 'numberOfMonths' | number; + weekDisplay: 'number' | 'none'; + yearRange: string; + }; + dayFormatter: (param: ojInputDate.DayFormatterInput) => (null | 'all' | ojInputDate.DayFormatterOutput); + dayMetaData: { + [key: string]: { + [key: string]: { + [key: string]: { + disabled?: boolean; + className?: string; + tooltip?: string; + }; + }; + }; + }; + keyboardEdit: 'enabled' | 'disabled'; + max: string | null; + min: string | null; + pickerAttributes: { + style?: string; + class?: string; + }; + renderMode: 'jet' | 'native'; + validators: Array | Validation.RegisteredValidator> | null; + value: string; + translations: { + currentText?: string; + dateRestriction?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + dateTimeRange?: { + hint?: { + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + nextText?: string; + prevText?: string; + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipCalendar?: string; + tooltipCalendarDisabled?: string; + tooltipCalendarTime?: string; + tooltipCalendarTimeDisabled?: string; + weekHeader?: string; + }; +} +export interface ojInputDateSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojInputDateTime extends ojInputDate { + converter: Converter | Validation.RegisteredConverter; + max: string | null; + min: string | null; + renderMode: 'jet' | 'native'; + timePicker: { + footerLayout: '' | 'now'; + showOn: 'focus' | 'image'; + timeIncrement: string; + }; + validators: Array | Validation.RegisteredValidator> | null; + value: string; + translations: { + cancel?: string; + currentText?: string; + dateRestriction?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + dateTimeRange?: { + hint?: { + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + done?: string; + nextText?: string; + prevText?: string; + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipCalendar?: string; + tooltipCalendarDisabled?: string; + tooltipCalendarTime?: string; + tooltipCalendarTimeDisabled?: string; + weekHeader?: string; + }; + onConverterChanged: ((event: JetElementCustomEvent["converter"]>) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent["max"]>) => any) | null; + onMinChanged: ((event: JetElementCustomEvent["min"]>) => any) | null; + onRenderModeChanged: ((event: JetElementCustomEvent["renderMode"]>) => any) | null; + onTimePickerChanged: ((event: JetElementCustomEvent["timePicker"]>) => any) | null; + onValidatorsChanged: ((event: JetElementCustomEvent["validators"]>) => any) | null; + onValueChanged: ((event: JetElementCustomEvent["value"]>) => any) | null; + onOjAnimateEnd: ((event: ojInputDateTime.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojInputDateTime.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojInputDateTimeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojInputDateTime[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojInputDateTimeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojInputDateTimeSettablePropertiesLenient): void; + hideTimePicker(): void; + show(): void; + showTimePicker(): void; +} +export namespace ojInputDateTime { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojInputDateTimeEventMap extends ojInputDateEventMap { + 'ojAnimateEnd': ojInputDateTime.ojAnimateEnd; + 'ojAnimateStart': ojInputDateTime.ojAnimateStart; + 'converterChanged': JetElementCustomEvent["converter"]>; + 'maxChanged': JetElementCustomEvent["max"]>; + 'minChanged': JetElementCustomEvent["min"]>; + 'renderModeChanged': JetElementCustomEvent["renderMode"]>; + 'timePickerChanged': JetElementCustomEvent["timePicker"]>; + 'validatorsChanged': JetElementCustomEvent["validators"]>; + 'valueChanged': JetElementCustomEvent["value"]>; +} +export interface ojInputDateTimeSettableProperties extends ojInputDateSettableProperties { + converter: Converter | Validation.RegisteredConverter; + max: string | null; + min: string | null; + renderMode: 'jet' | 'native'; + timePicker: { + footerLayout: '' | 'now'; + showOn: 'focus' | 'image'; + timeIncrement: string; + }; + validators: Array | Validation.RegisteredValidator> | null; + value: string; + translations: { + cancel?: string; + currentText?: string; + dateRestriction?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + dateTimeRange?: { + hint?: { + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + done?: string; + nextText?: string; + prevText?: string; + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipCalendar?: string; + tooltipCalendarDisabled?: string; + tooltipCalendarTime?: string; + tooltipCalendarTimeDisabled?: string; + weekHeader?: string; + }; +} +export interface ojInputDateTimeSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojInputTime extends inputBase { + converter: Converter | Validation.RegisteredConverter; + keyboardEdit: 'enabled' | 'disabled'; + max: string | null; + min: string | null; + pickerAttributes: { + style?: string; + class?: string; + }; + renderMode: 'jet' | 'native'; + timePicker: { + footerLayout: '' | 'now'; + showOn: 'focus' | 'image'; + timeIncrement: string; + }; + validators: Array | Validation.RegisteredValidator> | null; + value: string; + translations: { + ampmWheelLabel?: string; + cancelText?: string; + currentTimeText?: string; + dateTimeRange?: { + hint?: { + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + hourWheelLabel?: string; + minuteWheelLabel?: string; + okText?: string; + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipTime?: string; + tooltipTimeDisabled?: string; + }; + onConverterChanged: ((event: JetElementCustomEvent) => any) | null; + onKeyboardEditChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onPickerAttributesChanged: ((event: JetElementCustomEvent) => any) | null; + onRenderModeChanged: ((event: JetElementCustomEvent) => any) | null; + onTimePickerChanged: ((event: JetElementCustomEvent) => any) | null; + onValidatorsChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojInputTime.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojInputTime.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputTimeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojInputTime[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojInputTimeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojInputTimeSettablePropertiesLenient): void; + hide(): void; + refresh(): void; + show(): void; +} +export namespace ojInputTime { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojInputTimeEventMap extends inputBaseEventMap { + 'ojAnimateEnd': ojInputTime.ojAnimateEnd; + 'ojAnimateStart': ojInputTime.ojAnimateStart; + 'converterChanged': JetElementCustomEvent; + 'keyboardEditChanged': JetElementCustomEvent; + 'maxChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'pickerAttributesChanged': JetElementCustomEvent; + 'renderModeChanged': JetElementCustomEvent; + 'timePickerChanged': JetElementCustomEvent; + 'validatorsChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojInputTimeSettableProperties extends inputBaseSettableProperties { + converter: Converter | Validation.RegisteredConverter; + keyboardEdit: 'enabled' | 'disabled'; + max: string | null; + min: string | null; + pickerAttributes: { + style?: string; + class?: string; + }; + renderMode: 'jet' | 'native'; + timePicker: { + footerLayout: '' | 'now'; + showOn: 'focus' | 'image'; + timeIncrement: string; + }; + validators: Array | Validation.RegisteredValidator> | null; + value: string; + translations: { + ampmWheelLabel?: string; + cancelText?: string; + currentTimeText?: string; + dateTimeRange?: { + hint?: { + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + hourWheelLabel?: string; + minuteWheelLabel?: string; + okText?: string; + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipTime?: string; + tooltipTimeDisabled?: string; + }; +} +export interface ojInputTimeSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojdefer/index.d.ts b/types/oraclejet/ojdefer/index.d.ts new file mode 100644 index 0000000000..03eefbd714 --- /dev/null +++ b/types/oraclejet/ojdefer/index.d.ts @@ -0,0 +1,21 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojDefer extends JetElement { + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDeferEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojDefer[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojDeferSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojDeferSettablePropertiesLenient): void; +} +// These interfaces are empty but required to keep the event chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface ojDeferEventMap extends HTMLElementEventMap { +} +// These interfaces are empty but required to keep the component chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface ojDeferSettableProperties extends JetSettableProperties { +} +export interface ojDeferSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojdeferreddataprovider/index.d.ts b/types/oraclejet/ojdeferreddataprovider/index.d.ts new file mode 100644 index 0000000000..e2332cac46 --- /dev/null +++ b/types/oraclejet/ojdeferreddataprovider/index.d.ts @@ -0,0 +1,16 @@ +import { DataProvider, SortCriterion, FetchByKeysParameters, ContainsKeysResults, FetchByKeysResults, FetchByOffsetParameters, FetchByOffsetResults, FetchListResult, + FetchListParameters } from '../ojdataprovider'; +declare class DeferredDataProvider implements DataProvider { + constructor(dataProvider: Promise>, capabilityFunc: (capabilityName: string) => any); + addEventListener(eventType: string, listener: EventListener): any; + containsKeys(params: FetchByKeysParameters): Promise>; + dispatchEvent(evt: Event): boolean; + fetchByKeys(params: FetchByKeysParameters): Promise>; + fetchByOffset(params: FetchByOffsetParameters): Promise>; + fetchFirst(params?: FetchListParameters): AsyncIterable>; + getCapability(capabilityName: string): object; + getTotalSize(): Promise; + isEmpty(): 'yes' | 'no' | 'unknown'; + removeEventListener(eventType: string, listener: EventListener): any; +} +export = DeferredDataProvider; diff --git a/types/oraclejet/ojdiagram/index.d.ts b/types/oraclejet/ojdiagram/index.d.ts new file mode 100644 index 0000000000..db79f4b2be --- /dev/null +++ b/types/oraclejet/ojdiagram/index.d.ts @@ -0,0 +1,790 @@ +import { KeySet } from '../ojkeyset'; +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface DvtDiagramLayoutContext { + getCommonContainer(nodeId1: any, nodeId2: any): any; + getComponentSize(): { + x: number; + y: number; + w: number; + h: number; + }; + getCurrentViewport(): { + x: number; + y: number; + w: number; + h: number; + }; + getEventData(): object; + getLinkById(id: any): DvtDiagramLayoutContextLink; + getLinkByIndex(index: number): DvtDiagramLayoutContextLink; + getLinkCount(): number; + getNodeById(id: any): DvtDiagramLayoutContextNode; + getNodeByIndex(index: number): DvtDiagramLayoutContextNode; + getNodeCount(): number; + getViewport(): { + x: number; + y: number; + w: number; + h: number; + }; + isLocaleR2L(): boolean; + setViewport(viewport: { + x: number; + y: number; + w: number; + h: number; + }): void; +} +export interface DvtDiagramLayoutContextLink { + getCoordinateSpace(): any; + getData(): object | any[]; + getEndConnectorOffset(): number; + getEndId(): any; + getId(): any; + getLabelBounds(): { + x: number; + y: number; + w: number; + h: number; + }; + getLabelHalign(): 'left' | 'center' | 'right'; + getLabelPosition(): { + x: number; + y: number; + }; + getLabelRotationAngle(): number; + getLabelRotationPoint(): { + x: number; + y: number; + }; + getLabelValign(): 'top' | 'middle' | 'bottom' | 'baseline'; + getLinkWidth(): number; + getPoints(): any[]; + getSelected(): boolean; + getStartConnectorOffset(): number; + getStartId(): any; + isPromoted(): boolean; + setCoordinateSpace(containerId: any): void; + setLabelHalign(halign: 'left' | 'center' | 'right'): void; + setLabelPosition(pos: { + x: number; + y: number; + }): void; + setLabelRotationAngle(angle: number): void; + setLabelRotationPoint(point: { + x: number; + y: number; + }): void; + setLabelValign(valign: 'top' | 'middle' | 'bottom' | 'baseline'): void; + setPoints(points: any[]): void; +} +export interface DvtDiagramLayoutContextNode { + getBounds(): { + x: number; + y: number; + w: number; + h: number; + }; + getChildNodes(): any[]; + getContentBounds(): { + x: number; + y: number; + w: number; + h: number; + }; + getData(): object; + getId(): any; + getLabelBounds(): { + x: number; + y: number; + w: number; + h: number; + }; + getLabelHalign(): 'left' | 'center' | 'right'; + getLabelPosition(): { + x: number; + y: number; + }; + getLabelRotationAngle(): number; + getLabelRotationPoint(): { + x: number; + y: number; + }; + getLabelValign(): 'top' | 'middle' | 'bottom' | 'baseline'; + getPosition(): { + x: number; + y: number; + }; + getRelativePosition(containerId: any): { + x: number; + y: number; + }; + getSelected(): boolean; + isDisclosed(): boolean; + setLabelHalign(halign: 'left' | 'center' | 'right'): void; + setLabelPosition(pos: { + x: number; + y: number; + }): void; + setLabelRotationAngle(angle: number): void; + setLabelRotationPoint(point: { + x: number; + y: number; + }): void; + setLabelValign(valign: 'top' | 'middle' | 'bottom' | 'baseline'): void; + setPosition(pos: { + x: number; + y: number; + }): void; +} +export interface ojDiagram extends dvtBaseComponent> { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + dnd: { + drag: { + nodes: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + ports: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + linkStyle: ((param0: object) => void); + selector: string; + }; + }; + drop: { + background: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + links: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + nodes: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + ports: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + selector: string; + }; + }; + }; + expanded: KeySet; + focusRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + layout: ((param0: DvtDiagramLayoutContext) => void); + linkData: DataProvider | null; + linkHighlightMode: 'linkAndNodes' | 'link'; + maxZoom: number; + minZoom: number; + nodeData: DataProvider | null; + nodeHighlightMode: 'nodeAndIncomingLinks' | 'nodeAndOutgoingLinks' | 'nodeAndLinks' | 'node'; + overview: { + halign: 'start' | 'end' | 'center'; + height: number; + rendered: 'on' | 'off'; + valign: 'top' | 'bottom' | 'middle'; + width: number; + }; + panDirection: 'x' | 'y' | 'auto'; + panning: 'auto' | 'none'; + promotedLinkBehavior: 'none' | 'full' | 'lazy'; + renderer: ((context: ojDiagram.RendererContext) => ({ + insert: SVGElement; + })); + selection: Array; + selectionMode: 'single' | 'multiple' | 'none'; + selectionRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + styleDefaults: { + animationDuration: number; + hoverBehaviorDelay: number; + linkDefaults: { + color: string; + endConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + labelStyle: object; + startConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + svgClassName: string; + svgStyle: object; + width: number; + }; + nodeDefaults: { + icon: { + borderColor: string; + borderRadius: string; + borderWidth: number; + color: string; + height: number; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + width: number; + }; + labelStyle: object; + showDisclosure: 'off' | 'on'; + }; + promotedLink: { + color: string; + endConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + startConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + svgClassName: string; + svgStyle: object; + width: number; + }; + }; + tooltip: { + renderer: ((context: ojDiagram.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + zoomRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + zooming: 'auto' | 'none'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + promotedLink?: string; + promotedLinkAriaDesc?: string; + promotedLinks?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onDndChanged: ((event: JetElementCustomEvent["dnd"]>) => any) | null; + onExpandedChanged: ((event: JetElementCustomEvent["expanded"]>) => any) | null; + onFocusRendererChanged: ((event: JetElementCustomEvent["focusRenderer"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onHoverRendererChanged: ((event: JetElementCustomEvent["hoverRenderer"]>) => any) | null; + onLayoutChanged: ((event: JetElementCustomEvent["layout"]>) => any) | null; + onLinkDataChanged: ((event: JetElementCustomEvent["linkData"]>) => any) | null; + onLinkHighlightModeChanged: ((event: JetElementCustomEvent["linkHighlightMode"]>) => any) | null; + onMaxZoomChanged: ((event: JetElementCustomEvent["maxZoom"]>) => any) | null; + onMinZoomChanged: ((event: JetElementCustomEvent["minZoom"]>) => any) | null; + onNodeDataChanged: ((event: JetElementCustomEvent["nodeData"]>) => any) | null; + onNodeHighlightModeChanged: ((event: JetElementCustomEvent["nodeHighlightMode"]>) => any) | null; + onOverviewChanged: ((event: JetElementCustomEvent["overview"]>) => any) | null; + onPanDirectionChanged: ((event: JetElementCustomEvent["panDirection"]>) => any) | null; + onPanningChanged: ((event: JetElementCustomEvent["panning"]>) => any) | null; + onPromotedLinkBehaviorChanged: ((event: JetElementCustomEvent["promotedLinkBehavior"]>) => any) | null; + onRendererChanged: ((event: JetElementCustomEvent["renderer"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onSelectionRendererChanged: ((event: JetElementCustomEvent["selectionRenderer"]>) => any) | null; + onStyleDefaultsChanged: ((event: JetElementCustomEvent["styleDefaults"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTouchResponseChanged: ((event: JetElementCustomEvent["touchResponse"]>) => any) | null; + onZoomRendererChanged: ((event: JetElementCustomEvent["zoomRenderer"]>) => any) | null; + onZoomingChanged: ((event: JetElementCustomEvent["zooming"]>) => any) | null; + onOjBeforeCollapse: ((event: ojDiagram.ojBeforeCollapse) => any) | null; + onOjBeforeExpand: ((event: ojDiagram.ojBeforeExpand) => any) | null; + onOjCollapse: ((event: ojDiagram.ojCollapse) => any) | null; + onOjExpand: ((event: ojDiagram.ojExpand) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojDiagramEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojDiagram[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojDiagramSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojDiagramSettablePropertiesLenient): void; + getContextByNode(node: Element): object | null; + getLink(linkIndex: number): object | null; + getLinkCount(): number; + getNode(nodeIndex: number): object | null; + getNodeCount(): number; + getPromotedLink(startNodeIndex: number, endNodeIndex: number): object | null; +} +export namespace ojDiagram { + interface ojBeforeCollapse extends CustomEvent<{ + nodeId: any; + [propName: string]: any; + }> { + } + interface ojBeforeExpand extends CustomEvent<{ + nodeId: any; + [propName: string]: any; + }> { + } + interface ojCollapse extends CustomEvent<{ + nodeId: any; + [propName: string]: any; + }> { + } + interface ojExpand extends CustomEvent<{ + nodeId: any; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type RendererContext = { + parentElement: Element; + componentElement: Element; + data: object; + itemData: D1; + content: { + element: Element; + width: number; + height: number; + }; + state: { + hovered: boolean; + selected: boolean; + focused: boolean; + expanded: boolean; + zoom: number; + }; + previousState: { + hovered: boolean; + selected: boolean; + focused: boolean; + expanded: boolean; + zoom: number; + }; + id: K1; + type: string; + renderDefaultFocus: (() => void); + renderDefaultHover: (() => void); + renderDefaultSelection: (() => void); + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + parentElement: Element; + componentElement: Element; + id: K1 | K2; + type: string; + label: string; + data: object | object[]; + itemData: D1 | D2 | D2[]; + }; +} +export interface ojDiagramEventMap extends dvtBaseComponentEventMap> { + 'ojBeforeCollapse': ojDiagram.ojBeforeCollapse; + 'ojBeforeExpand': ojDiagram.ojBeforeExpand; + 'ojCollapse': ojDiagram.ojCollapse; + 'ojExpand': ojDiagram.ojExpand; + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'dndChanged': JetElementCustomEvent["dnd"]>; + 'expandedChanged': JetElementCustomEvent["expanded"]>; + 'focusRendererChanged': JetElementCustomEvent["focusRenderer"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'hoverRendererChanged': JetElementCustomEvent["hoverRenderer"]>; + 'layoutChanged': JetElementCustomEvent["layout"]>; + 'linkDataChanged': JetElementCustomEvent["linkData"]>; + 'linkHighlightModeChanged': JetElementCustomEvent["linkHighlightMode"]>; + 'maxZoomChanged': JetElementCustomEvent["maxZoom"]>; + 'minZoomChanged': JetElementCustomEvent["minZoom"]>; + 'nodeDataChanged': JetElementCustomEvent["nodeData"]>; + 'nodeHighlightModeChanged': JetElementCustomEvent["nodeHighlightMode"]>; + 'overviewChanged': JetElementCustomEvent["overview"]>; + 'panDirectionChanged': JetElementCustomEvent["panDirection"]>; + 'panningChanged': JetElementCustomEvent["panning"]>; + 'promotedLinkBehaviorChanged': JetElementCustomEvent["promotedLinkBehavior"]>; + 'rendererChanged': JetElementCustomEvent["renderer"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'selectionRendererChanged': JetElementCustomEvent["selectionRenderer"]>; + 'styleDefaultsChanged': JetElementCustomEvent["styleDefaults"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'touchResponseChanged': JetElementCustomEvent["touchResponse"]>; + 'zoomRendererChanged': JetElementCustomEvent["zoomRenderer"]>; + 'zoomingChanged': JetElementCustomEvent["zooming"]>; +} +export interface ojDiagramSettableProperties extends dvtBaseComponentSettableProperties { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + dnd: { + drag: { + nodes: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + }; + ports: { + dataTypes: string | string[]; + drag: ((param0: Event) => void); + dragEnd: ((param0: Event) => void); + dragStart: ((param0: Event, param1: object) => void); + linkStyle: ((param0: object) => void); + selector: string; + }; + }; + drop: { + background: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + links: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + nodes: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + }; + ports: { + dataTypes: string | string[]; + dragEnter: ((param0: Event, param1: object) => void); + dragLeave: ((param0: Event, param1: object) => void); + dragOver: ((param0: Event, param1: object) => void); + drop: ((param0: Event, param1: object) => void); + selector: string; + }; + }; + }; + expanded: KeySet; + focusRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + layout: ((param0: DvtDiagramLayoutContext) => void); + linkData: DataProvider | null; + linkHighlightMode: 'linkAndNodes' | 'link'; + maxZoom: number; + minZoom: number; + nodeData: DataProvider | null; + nodeHighlightMode: 'nodeAndIncomingLinks' | 'nodeAndOutgoingLinks' | 'nodeAndLinks' | 'node'; + overview: { + halign: 'start' | 'end' | 'center'; + height: number; + rendered: 'on' | 'off'; + valign: 'top' | 'bottom' | 'middle'; + width: number; + }; + panDirection: 'x' | 'y' | 'auto'; + panning: 'auto' | 'none'; + promotedLinkBehavior: 'none' | 'full' | 'lazy'; + renderer: ((context: ojDiagram.RendererContext) => ({ + insert: SVGElement; + })); + selection: Array; + selectionMode: 'single' | 'multiple' | 'none'; + selectionRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + styleDefaults: { + animationDuration: number; + hoverBehaviorDelay: number; + linkDefaults: { + color: string; + endConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + labelStyle: object; + startConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + svgClassName: string; + svgStyle: object; + width: number; + }; + nodeDefaults: { + icon: { + borderColor: string; + borderRadius: string; + borderWidth: number; + color: string; + height: number; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + width: number; + }; + labelStyle: object; + showDisclosure: 'off' | 'on'; + }; + promotedLink: { + color: string; + endConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + startConnectorType: 'arrowOpen' | 'arrow' | 'arrowConcave' | 'circle' | 'rectangle' | 'rectangleRounded' | 'none'; + svgClassName: string; + svgStyle: object; + width: number; + }; + }; + tooltip: { + renderer: ((context: ojDiagram.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + zoomRenderer: ((context: ojDiagram.RendererContext) => { + insert: SVGElement; + } | void) | null; + zooming: 'auto' | 'none'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + promotedLink?: string; + promotedLinkAriaDesc?: string; + promotedLinks?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojDiagramSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojDiagramLink extends JetElement { + categories: string[]; + color?: string; + endConnectorType?: 'arrow' | 'arrowConcave' | 'arrowOpen' | 'circle' | 'none' | 'rectangle' | 'rectangleRounded'; + endNode: any; + label?: string; + labelStyle?: object | null; + selectable?: 'auto' | 'off'; + shortDesc?: string; + startConnectorType?: 'arrow' | 'arrowConcave' | 'arrowOpen' | 'circle' | 'none' | 'rectangle' | 'rectangleRounded'; + startNode: any; + svgClassName?: string; + svgStyle?: object; + width?: number; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onEndConnectorTypeChanged: ((event: JetElementCustomEvent) => any) | null; + onEndNodeChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectableChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onStartConnectorTypeChanged: ((event: JetElementCustomEvent) => any) | null; + onStartNodeChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onWidthChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDiagramLinkEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojDiagramLink[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojDiagramLinkSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojDiagramLinkSettablePropertiesLenient): void; +} +export interface ojDiagramLinkEventMap extends HTMLElementEventMap { + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'endConnectorTypeChanged': JetElementCustomEvent; + 'endNodeChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'selectableChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'startConnectorTypeChanged': JetElementCustomEvent; + 'startNodeChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'widthChanged': JetElementCustomEvent; +} +export interface ojDiagramLinkSettableProperties extends JetSettableProperties { + categories: string[]; + color?: string; + endConnectorType?: 'arrow' | 'arrowConcave' | 'arrowOpen' | 'circle' | 'none' | 'rectangle' | 'rectangleRounded'; + endNode: any; + label?: string; + labelStyle?: object | null; + selectable?: 'auto' | 'off'; + shortDesc?: string; + startConnectorType?: 'arrow' | 'arrowConcave' | 'arrowOpen' | 'circle' | 'none' | 'rectangle' | 'rectangleRounded'; + startNode: any; + svgClassName?: string; + svgStyle?: object; + width?: number; +} +export interface ojDiagramLinkSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojDiagramNode extends JetElement { + categories?: string[]; + descendantsConnectivity?: 'connected' | 'disjoint' | 'unknown'; + icon?: { + borderColor?: string; + borderRadius?: string; + borderWidth?: number; + color?: string; + height?: number; + opacity?: number; + pattern?: 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none' | 'mallChecker' | 'smallCrosshatch' | + 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + svgClassName?: string; + svgStyle?: object; + width?: number; + }; + label?: string; + labelStyle?: object | null; + overview?: { + icon?: { + shape?: 'inherit' | 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + svgClassName?: string; + svgStyle?: object; + }; + }; + selectable?: 'auto' | 'off'; + shortDesc?: string; + showDisclosure?: 'on' | 'off'; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onDescendantsConnectivityChanged: ((event: JetElementCustomEvent) => any) | null; + onIconChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onOverviewChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectableChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onShowDisclosureChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDiagramNodeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojDiagramNode[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojDiagramNodeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojDiagramNodeSettablePropertiesLenient): void; +} +export interface ojDiagramNodeEventMap extends HTMLElementEventMap { + 'categoriesChanged': JetElementCustomEvent; + 'descendantsConnectivityChanged': JetElementCustomEvent; + 'iconChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'overviewChanged': JetElementCustomEvent; + 'selectableChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'showDisclosureChanged': JetElementCustomEvent; +} +export interface ojDiagramNodeSettableProperties extends JetSettableProperties { + categories?: string[]; + descendantsConnectivity?: 'connected' | 'disjoint' | 'unknown'; + icon?: { + borderColor?: string; + borderRadius?: string; + borderWidth?: number; + color?: string; + height?: number; + opacity?: number; + pattern?: 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none' | 'mallChecker' | 'smallCrosshatch' | + 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source?: string; + sourceHover?: string; + sourceHoverSelected?: string; + sourceSelected?: string; + svgClassName?: string; + svgStyle?: object; + width?: number; + }; + label?: string; + labelStyle?: object | null; + overview?: { + icon?: { + shape?: 'inherit' | 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + svgClassName?: string; + svgStyle?: object; + }; + }; + selectable?: 'auto' | 'off'; + shortDesc?: string; + showDisclosure?: 'on' | 'off'; +} +export interface ojDiagramNodeSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojdialog/index.d.ts b/types/oraclejet/ojdialog/index.d.ts new file mode 100644 index 0000000000..42a8569bd4 --- /dev/null +++ b/types/oraclejet/ojdialog/index.d.ts @@ -0,0 +1,148 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojDialog extends baseComponent { + cancelBehavior: 'icon' | 'escape' | 'none'; + dragAffordance: 'title-bar' | 'none'; + initialVisibility: 'hide' | 'show'; + modality: 'modal' | 'modeless'; + position: ojDialog.Position; + resizeBehavior: 'resizable' | 'none'; + role: string; + translations: { + labelCloseIcon?: string; + }; + onCancelBehaviorChanged: ((event: JetElementCustomEvent) => any) | null; + onDragAffordanceChanged: ((event: JetElementCustomEvent) => any) | null; + onInitialVisibilityChanged: ((event: JetElementCustomEvent) => any) | null; + onModalityChanged: ((event: JetElementCustomEvent) => any) | null; + onPositionChanged: ((event: JetElementCustomEvent) => any) | null; + onResizeBehaviorChanged: ((event: JetElementCustomEvent) => any) | null; + onRoleChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojDialog.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojDialog.ojAnimateStart) => any) | null; + onOjBeforeClose: ((event: ojDialog.ojBeforeClose) => any) | null; + onOjBeforeOpen: ((event: ojDialog.ojBeforeOpen) => any) | null; + onOjClose: ((event: ojDialog.ojClose) => any) | null; + onOjFocus: ((event: ojDialog.ojFocus) => any) | null; + onOjOpen: ((event: ojDialog.ojOpen) => any) | null; + onOjResize: ((event: ojDialog.ojResize) => any) | null; + onOjResizeStart: ((event: ojDialog.ojResizeStart) => any) | null; + onOjResizeStop: ((event: ojDialog.ojResizeStop) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojDialogEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojDialog[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojDialogSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojDialogSettablePropertiesLenient): void; + close(): void; + isOpen(): boolean; + open(): void; + refresh(): void; +} +export namespace ojDialog { + interface ojAnimateEnd extends CustomEvent<{ + element: Element; + action: 'open' | 'close'; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: 'open' | 'close'; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeClose extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojBeforeOpen extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojClose extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojFocus extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojOpen extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojResize extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojResizeStart extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojResizeStop extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type Position = { + my?: PositionAlign; + at?: PositionAlign; + offset?: PositionPoint; + of?: string | PositionPoint; + collision?: 'flip' | 'fit' | 'flipfit' | 'none'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionAlign = { + vertical?: 'top' | 'bottom' | 'center'; + horizontal?: 'start' | 'end' | 'left' | 'center' | 'bottom'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionPoint = { + x?: number; + y?: number; + }; +} +export interface ojDialogEventMap extends baseComponentEventMap { + 'ojAnimateEnd': ojDialog.ojAnimateEnd; + 'ojAnimateStart': ojDialog.ojAnimateStart; + 'ojBeforeClose': ojDialog.ojBeforeClose; + 'ojBeforeOpen': ojDialog.ojBeforeOpen; + 'ojClose': ojDialog.ojClose; + 'ojFocus': ojDialog.ojFocus; + 'ojOpen': ojDialog.ojOpen; + 'ojResize': ojDialog.ojResize; + 'ojResizeStart': ojDialog.ojResizeStart; + 'ojResizeStop': ojDialog.ojResizeStop; + 'cancelBehaviorChanged': JetElementCustomEvent; + 'dragAffordanceChanged': JetElementCustomEvent; + 'initialVisibilityChanged': JetElementCustomEvent; + 'modalityChanged': JetElementCustomEvent; + 'positionChanged': JetElementCustomEvent; + 'resizeBehaviorChanged': JetElementCustomEvent; + 'roleChanged': JetElementCustomEvent; +} +export interface ojDialogSettableProperties extends baseComponentSettableProperties { + cancelBehavior: 'icon' | 'escape' | 'none'; + dragAffordance: 'title-bar' | 'none'; + initialVisibility: 'hide' | 'show'; + modality: 'modal' | 'modeless'; + position: ojDialog.Position; + resizeBehavior: 'resizable' | 'none'; + role: string; + translations: { + labelCloseIcon?: string; + }; +} +export interface ojDialogSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojdvt-base/index.d.ts b/types/oraclejet/ojdvt-base/index.d.ts new file mode 100644 index 0000000000..04e1cca484 --- /dev/null +++ b/types/oraclejet/ojdvt-base/index.d.ts @@ -0,0 +1,57 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface dvtBaseComponent extends baseComponent { + trackResize: 'on' | 'off'; + translations: { + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onTrackResizeChanged: ((event: JetElementCustomEvent["trackResize"]>) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: dvtBaseComponentEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): dvtBaseComponent[T]; + getProperty(property: string): any; + setProperty(property: T, value: dvtBaseComponentSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: dvtBaseComponentSettablePropertiesLenient): void; +} +export interface dvtBaseComponentEventMap extends baseComponentEventMap { + 'trackResizeChanged': JetElementCustomEvent["trackResize"]>; +} +export interface dvtBaseComponentSettableProperties extends baseComponentSettableProperties { + trackResize: 'on' | 'off'; + translations: { + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface dvtBaseComponentSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojeditablevalue/index.d.ts b/types/oraclejet/ojeditablevalue/index.d.ts new file mode 100644 index 0000000000..44f714b3a7 --- /dev/null +++ b/types/oraclejet/ojeditablevalue/index.d.ts @@ -0,0 +1,96 @@ +import Message = require('../ojmessaging'); +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface editableValue, SV = V, RV = V> extends baseComponent { + describedBy: string | null; + disabled: boolean; + displayOptions: { + converterHint: Array<'placeholder' | 'notewindow' | 'none'> | 'placeholder' | 'notewindow' | 'none'; + helpInstruction: Array<'notewindow' | 'none'> | 'notewindow' | 'none'; + messages: Array<'inline' | 'notewindow' | 'none'> | 'inline' | 'notewindow' | 'none'; + validatorHint: Array<'notewindow' | 'none'> | 'notewindow' | 'none'; + }; + help: { + instruction?: string; + }; + helpHints: { + definition?: string; + source?: string; + }; + labelHint: string; + messagesCustom: Message[]; + readonly valid: 'valid' | 'pending' | 'invalidHidden' | 'invalidShown'; + value: V; + onDescribedByChanged: ((event: JetElementCustomEvent["describedBy"]>) => any) | null; + onDisabledChanged: ((event: JetElementCustomEvent["disabled"]>) => any) | null; + onDisplayOptionsChanged: ((event: JetElementCustomEvent["displayOptions"]>) => any) | null; + onHelpChanged: ((event: JetElementCustomEvent["help"]>) => any) | null; + onHelpHintsChanged: ((event: JetElementCustomEvent["helpHints"]>) => any) | null; + onLabelHintChanged: ((event: JetElementCustomEvent["labelHint"]>) => any) | null; + onMessagesCustomChanged: ((event: JetElementCustomEvent["messagesCustom"]>) => any) | null; + onValidChanged: ((event: JetElementCustomEvent["valid"]>) => any) | null; + onValueChanged: ((event: JetElementCustomEvent["value"]>) => any) | null; + onOjAnimateEnd: ((event: editableValue.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: editableValue.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: editableValueEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): editableValue[T]; + getProperty(property: string): any; + setProperty>(property: T, value: editableValueSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: editableValueSettablePropertiesLenient): void; + refresh(): void; + reset(): void; + showMessages(): void; +} +export namespace editableValue { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface editableValueEventMap, SV = V, RV = V> extends baseComponentEventMap { + 'ojAnimateEnd': editableValue.ojAnimateEnd; + 'ojAnimateStart': editableValue.ojAnimateStart; + 'describedByChanged': JetElementCustomEvent["describedBy"]>; + 'disabledChanged': JetElementCustomEvent["disabled"]>; + 'displayOptionsChanged': JetElementCustomEvent["displayOptions"]>; + 'helpChanged': JetElementCustomEvent["help"]>; + 'helpHintsChanged': JetElementCustomEvent["helpHints"]>; + 'labelHintChanged': JetElementCustomEvent["labelHint"]>; + 'messagesCustomChanged': JetElementCustomEvent["messagesCustom"]>; + 'validChanged': JetElementCustomEvent["valid"]>; + 'valueChanged': JetElementCustomEvent["value"]>; +} +export interface editableValueSettableProperties extends baseComponentSettableProperties { + describedBy: string | null; + disabled: boolean; + displayOptions: { + converterHint: Array<'placeholder' | 'notewindow' | 'none'> | 'placeholder' | 'notewindow' | 'none'; + helpInstruction: Array<'notewindow' | 'none'> | 'notewindow' | 'none'; + messages: Array<'inline' | 'notewindow' | 'none'> | 'inline' | 'notewindow' | 'none'; + validatorHint: Array<'notewindow' | 'none'> | 'notewindow' | 'none'; + }; + help: { + instruction?: string; + }; + helpHints: { + definition?: string; + source?: string; + }; + labelHint: string; + messagesCustom: Message[]; + readonly valid: 'valid' | 'pending' | 'invalidHidden' | 'invalidShown'; + value: SV; +} +export interface editableValueSettablePropertiesLenient extends Partial> { + [key: string]: any; +} diff --git a/types/oraclejet/ojexpressionutils/index.d.ts b/types/oraclejet/ojexpressionutils/index.d.ts new file mode 100644 index 0000000000..e8c48ff994 --- /dev/null +++ b/types/oraclejet/ojexpressionutils/index.d.ts @@ -0,0 +1,5 @@ +export function createGenericExpressionEvaluator(expressionText: string): (context: any) => any; +export function getExpressionInfo(expression: string): { + expr: (null | string); + downstreamOnly: boolean; +}; diff --git a/types/oraclejet/ojfilepicker/index.d.ts b/types/oraclejet/ojfilepicker/index.d.ts new file mode 100644 index 0000000000..69f63531fa --- /dev/null +++ b/types/oraclejet/ojfilepicker/index.d.ts @@ -0,0 +1,43 @@ +import { ProgressItem } from '../ojprogresslist'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface FileUploadTransport { + flush(): void; + queue(fileList: FileList): ProgressItem[]; +} +export interface ojFilePicker extends JetElement { + accept: string[] | null; + selectOn: 'auto' | 'click' | 'drop' | 'clickAndDrop'; + selectionMode: 'multiple' | 'single'; + onAcceptChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectOnChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent) => any) | null; + onOjSelect: ((event: ojFilePicker.ojSelect) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojFilePickerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojFilePicker[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojFilePickerSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojFilePickerSettablePropertiesLenient): void; +} +export namespace ojFilePicker { + interface ojSelect extends CustomEvent<{ + files: FileList; + [propName: string]: any; + }> { + } +} +export interface ojFilePickerEventMap extends HTMLElementEventMap { + 'ojSelect': ojFilePicker.ojSelect; + 'acceptChanged': JetElementCustomEvent; + 'selectOnChanged': JetElementCustomEvent; + 'selectionModeChanged': JetElementCustomEvent; +} +export interface ojFilePickerSettableProperties extends JetSettableProperties { + accept: string[] | null; + selectOn: 'auto' | 'click' | 'drop' | 'clickAndDrop'; + selectionMode: 'multiple' | 'single'; +} +export interface ojFilePickerSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojfilmstrip/index.d.ts b/types/oraclejet/ojfilmstrip/index.d.ts new file mode 100644 index 0000000000..35716daf3e --- /dev/null +++ b/types/oraclejet/ojfilmstrip/index.d.ts @@ -0,0 +1,63 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojFilmStrip extends baseComponent { + arrowPlacement: 'adjacent' | 'overlay'; + arrowVisibility: 'visible' | 'hidden' | 'hover' | 'auto'; + currentItem: { + id?: string; + index?: number; + }; + looping: 'off' | 'page'; + maxItemsPerPage: number; + orientation: 'horizontal' | 'vertical'; + translations: { + labelAccArrowNextPage?: string; + labelAccArrowPreviousPage?: string; + labelAccFilmStrip?: string; + tipArrowNextPage?: string; + tipArrowPreviousPage?: string; + }; + onArrowPlacementChanged: ((event: JetElementCustomEvent) => any) | null; + onArrowVisibilityChanged: ((event: JetElementCustomEvent) => any) | null; + onCurrentItemChanged: ((event: JetElementCustomEvent) => any) | null; + onLoopingChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxItemsPerPageChanged: ((event: JetElementCustomEvent) => any) | null; + onOrientationChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojFilmStripEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojFilmStrip[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojFilmStripSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojFilmStripSettablePropertiesLenient): void; + getItemsPerPage(): number; + refresh(): void; +} +export interface ojFilmStripEventMap extends baseComponentEventMap { + 'arrowPlacementChanged': JetElementCustomEvent; + 'arrowVisibilityChanged': JetElementCustomEvent; + 'currentItemChanged': JetElementCustomEvent; + 'loopingChanged': JetElementCustomEvent; + 'maxItemsPerPageChanged': JetElementCustomEvent; + 'orientationChanged': JetElementCustomEvent; +} +export interface ojFilmStripSettableProperties extends baseComponentSettableProperties { + arrowPlacement: 'adjacent' | 'overlay'; + arrowVisibility: 'visible' | 'hidden' | 'hover' | 'auto'; + currentItem: { + id?: string; + index?: number; + }; + looping: 'off' | 'page'; + maxItemsPerPage: number; + orientation: 'horizontal' | 'vertical'; + translations: { + labelAccArrowNextPage?: string; + labelAccArrowPreviousPage?: string; + labelAccFilmStrip?: string; + tipArrowNextPage?: string; + tipArrowPreviousPage?: string; + }; +} +export interface ojFilmStripSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojformlayout/index.d.ts b/types/oraclejet/ojformlayout/index.d.ts new file mode 100644 index 0000000000..c9fe49b34a --- /dev/null +++ b/types/oraclejet/ojformlayout/index.d.ts @@ -0,0 +1,38 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojFormLayout extends JetElement { + direction: 'column' | 'row'; + labelEdge: 'start' | 'top'; + labelWidth: string; + labelWrapping: 'truncate' | 'wrap'; + maxColumns: number; + onDirectionChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelEdgeChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelWrappingChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxColumnsChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojFormLayoutEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojFormLayout[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojFormLayoutSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojFormLayoutSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojFormLayoutEventMap extends HTMLElementEventMap { + 'directionChanged': JetElementCustomEvent; + 'labelEdgeChanged': JetElementCustomEvent; + 'labelWidthChanged': JetElementCustomEvent; + 'labelWrappingChanged': JetElementCustomEvent; + 'maxColumnsChanged': JetElementCustomEvent; +} +export interface ojFormLayoutSettableProperties extends JetSettableProperties { + direction: 'column' | 'row'; + labelEdge: 'start' | 'top'; + labelWidth: string; + labelWrapping: 'truncate' | 'wrap'; + maxColumns: number; +} +export interface ojFormLayoutSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojgantt/index.d.ts b/types/oraclejet/ojgantt/index.d.ts new file mode 100644 index 0000000000..18ded2ebeb --- /dev/null +++ b/types/oraclejet/ojgantt/index.d.ts @@ -0,0 +1,679 @@ +import { ojTimeAxis } from '../ojtimeaxis'; +import { Converter } from '../ojvalidation-base'; +import { DataProvider } from '../ojdataprovider'; +import { dvtTimeComponent, dvtTimeComponentEventMap, dvtTimeComponentSettableProperties } from '../ojtime-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojGantt extends dvtTimeComponent> { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + axisPosition: 'bottom' | 'top'; + dependencyData?: (DataProvider); + dnd: { + move?: { + tasks?: 'disabled' | 'enabled'; + }; + }; + end: string; + gridlines: { + horizontal?: 'hidden' | 'visible' | 'auto'; + vertical?: 'hidden' | 'visible' | 'auto'; + }; + majorAxis: { + converter?: (ojTimeAxis.Converters | Converter); + height?: number; + scale: 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; + zoomOrder?: string[]; + }; + minorAxis: { + converter?: (ojTimeAxis.Converters | Converter); + height?: number; + scale: 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; + zoomOrder?: string[]; + }; + referenceObjects: ojGantt.ReferenceObject[]; + rowAxis: { + label?: { + renderer: ((context: ojGantt.RowAxisLabelRendererContext) => ({ + insert: Element; + })); + }; + maxWidth?: string; + rendered?: 'on' | 'off'; + width?: string; + }; + rowDefaults: { + height?: number; + }; + scrollPosition: { + offsetY?: number; + rowIndex?: number; + y?: number; + }; + selection: K2[]; + selectionMode: 'single' | 'multiple' | 'none'; + start: string; + taskData?: (DataProvider); + taskDefaults: { + baseline?: { + borderRadius?: string; + height?: number; + svgClassName?: string; + svgStyle?: object; + }; + borderRadius?: string; + height?: number; + labelPosition?: (string | string[]); + progress?: { + borderRadius?: string; + height?: string; + svgClassName?: string; + svgStyle?: object; + }; + svgClassName?: string; + svgStyle?: object; + type?: 'normal' | 'milestone' | 'summary' | 'auto'; + }; + tooltip: { + renderer: ((context: ojGantt.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + valueFormats: { + baselineDate?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + baselineEnd?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + baselineStart?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + date?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + end?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + label?: { + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + progress?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + row?: { + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + start?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + }; + viewportEnd: string; + viewportStart: string; + translations: { + accessibleDependencyInfo?: string; + accessiblePredecessorInfo?: string; + accessibleSuccessorInfo?: string; + accessibleTaskTypeMilestone?: string; + accessibleTaskTypeSummary?: string; + componentName?: string; + finishFinishDependencyAriaDesc?: string; + finishStartDependencyAriaDesc?: string; + labelAndValue?: string; + labelBaselineDate?: string; + labelBaselineEnd?: string; + labelBaselineStart?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelDate?: string; + labelEnd?: string; + labelInvalidData?: string; + labelLabel?: string; + labelMoveBy?: string; + labelNoData?: string; + labelProgress?: string; + labelRow?: string; + labelStart?: string; + startFinishDependencyAriaDesc?: string; + startStartDependencyAriaDesc?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + taskMoveCancelled?: string; + taskMoveFinalized?: string; + taskMoveInitiated?: string; + taskMoveInitiatedInstruction?: string; + taskMoveSelectionInfo?: string; + tooltipZoomIn?: string; + tooltipZoomOut?: string; + }; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onAxisPositionChanged: ((event: JetElementCustomEvent["axisPosition"]>) => any) | null; + onDependencyDataChanged: ((event: JetElementCustomEvent["dependencyData"]>) => any) | null; + onDndChanged: ((event: JetElementCustomEvent["dnd"]>) => any) | null; + onEndChanged: ((event: JetElementCustomEvent["end"]>) => any) | null; + onGridlinesChanged: ((event: JetElementCustomEvent["gridlines"]>) => any) | null; + onMajorAxisChanged: ((event: JetElementCustomEvent["majorAxis"]>) => any) | null; + onMinorAxisChanged: ((event: JetElementCustomEvent["minorAxis"]>) => any) | null; + onReferenceObjectsChanged: ((event: JetElementCustomEvent["referenceObjects"]>) => any) | null; + onRowAxisChanged: ((event: JetElementCustomEvent["rowAxis"]>) => any) | null; + onRowDefaultsChanged: ((event: JetElementCustomEvent["rowDefaults"]>) => any) | null; + onScrollPositionChanged: ((event: JetElementCustomEvent["scrollPosition"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onStartChanged: ((event: JetElementCustomEvent["start"]>) => any) | null; + onTaskDataChanged: ((event: JetElementCustomEvent["taskData"]>) => any) | null; + onTaskDefaultsChanged: ((event: JetElementCustomEvent["taskDefaults"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onValueFormatsChanged: ((event: JetElementCustomEvent["valueFormats"]>) => any) | null; + onViewportEndChanged: ((event: JetElementCustomEvent["viewportEnd"]>) => any) | null; + onViewportStartChanged: ((event: JetElementCustomEvent["viewportStart"]>) => any) | null; + onOjMove: ((event: ojGantt.ojMove) => any) | null; + onOjViewportChange: ((event: ojGantt.ojViewportChange) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojGanttEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojGantt[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojGanttSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojGanttSettablePropertiesLenient): void; + getContextByNode(node: Element): { + subId: 'oj-gantt-row-label'; + index: number; + } | { + subId: 'oj-gantt-taskbar'; + rowIndex: number; + index: number; + } | null; +} +export namespace ojGantt { + interface ojMove extends CustomEvent<{ + taskContexts: Array<{ + data: RowTask; + rowData: Row; + itemData: D2 | null; + color: string; + }>; + value: string; + start: string; + end: string; + baselineStart: string; + baselineEnd: string; + rowContext: { + rowData: Row; + componentElement: Element; + }; + [propName: string]: any; + }> { + } + interface ojViewportChange extends CustomEvent<{ + viewportStart: string; + viewportEnd: string; + majorAxisScale: string; + minorAxisScale: string; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type Dependency = { + id: K1; + predecessorTaskId: K2; + shortDesc?: string; + successorTaskId: K2; + svgClassName?: string; + svgStyle?: object; + type?: 'startStart' | 'startFinish' | 'finishFinish' | 'finishStart'; + }; + // tslint:disable-next-line interface-over-type-literal + type ReferenceObject = { + svgClassName?: string; + svgStyle?: object; + value?: string; + }; + // tslint:disable-next-line interface-over-type-literal + type Row = { + id?: any; + label?: string; + labelStyle?: object; + tasks?: Array>; + }; + // tslint:disable-next-line interface-over-type-literal + type RowAxisLabelRendererContext = { + parentElement: Element; + rowData: Row; + itemData: D2[]; + componentElement: Element; + maxWidth: number; + maxHeight: number; + }; + // tslint:disable-next-line interface-over-type-literal + type RowTask = { + borderRadius?: string; + end?: string; + height?: number; + id: K2; + label?: string; + labelPosition?: string | string[]; + labelStyle?: object; + start?: string; + shortDesc?: string; + svgClassName?: string; + svgStyle?: object; + type?: 'normal' | 'milestone' | 'summary' | 'auto'; + progress?: { + borderRadius?: string; + height?: string; + svgClassName?: string; + svgStyle?: object; + value?: number; + }; + baseline?: { + borderRadius?: string; + end?: string; + height?: number; + start?: string; + svgClassName?: string; + svgStyle?: object; + }; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + parentElement: Element; + data: RowTask; + rowData: Row; + itemData: D2; + componentElement: Element; + color: string; + }; +} +export interface ojGanttEventMap extends dvtTimeComponentEventMap> { + 'ojMove': ojGantt.ojMove; + 'ojViewportChange': ojGantt.ojViewportChange; + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'axisPositionChanged': JetElementCustomEvent["axisPosition"]>; + 'dependencyDataChanged': JetElementCustomEvent["dependencyData"]>; + 'dndChanged': JetElementCustomEvent["dnd"]>; + 'endChanged': JetElementCustomEvent["end"]>; + 'gridlinesChanged': JetElementCustomEvent["gridlines"]>; + 'majorAxisChanged': JetElementCustomEvent["majorAxis"]>; + 'minorAxisChanged': JetElementCustomEvent["minorAxis"]>; + 'referenceObjectsChanged': JetElementCustomEvent["referenceObjects"]>; + 'rowAxisChanged': JetElementCustomEvent["rowAxis"]>; + 'rowDefaultsChanged': JetElementCustomEvent["rowDefaults"]>; + 'scrollPositionChanged': JetElementCustomEvent["scrollPosition"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'startChanged': JetElementCustomEvent["start"]>; + 'taskDataChanged': JetElementCustomEvent["taskData"]>; + 'taskDefaultsChanged': JetElementCustomEvent["taskDefaults"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'valueFormatsChanged': JetElementCustomEvent["valueFormats"]>; + 'viewportEndChanged': JetElementCustomEvent["viewportEnd"]>; + 'viewportStartChanged': JetElementCustomEvent["viewportStart"]>; +} +export interface ojGanttSettableProperties extends dvtTimeComponentSettableProperties { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + axisPosition: 'bottom' | 'top'; + dependencyData?: (DataProvider); + dnd: { + move?: { + tasks?: 'disabled' | 'enabled'; + }; + }; + end: string; + gridlines: { + horizontal?: 'hidden' | 'visible' | 'auto'; + vertical?: 'hidden' | 'visible' | 'auto'; + }; + majorAxis: { + converter?: (ojTimeAxis.Converters | Converter); + height?: number; + scale: 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; + zoomOrder?: string[]; + }; + minorAxis: { + converter?: (ojTimeAxis.Converters | Converter); + height?: number; + scale: 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; + zoomOrder?: string[]; + }; + referenceObjects: ojGantt.ReferenceObject[]; + rowAxis: { + label?: { + renderer: ((context: ojGantt.RowAxisLabelRendererContext) => ({ + insert: Element; + })); + }; + maxWidth?: string; + rendered?: 'on' | 'off'; + width?: string; + }; + rowDefaults: { + height?: number; + }; + scrollPosition: { + offsetY?: number; + rowIndex?: number; + y?: number; + }; + selection: K2[]; + selectionMode: 'single' | 'multiple' | 'none'; + start: string; + taskData?: (DataProvider); + taskDefaults: { + baseline?: { + borderRadius?: string; + height?: number; + svgClassName?: string; + svgStyle?: object; + }; + borderRadius?: string; + height?: number; + labelPosition?: (string | string[]); + progress?: { + borderRadius?: string; + height?: string; + svgClassName?: string; + svgStyle?: object; + }; + svgClassName?: string; + svgStyle?: object; + type?: 'normal' | 'milestone' | 'summary' | 'auto'; + }; + tooltip: { + renderer: ((context: ojGantt.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + valueFormats: { + baselineDate?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + baselineEnd?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + baselineStart?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + date?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + end?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + label?: { + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + progress?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + row?: { + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + start?: { + converter?: (Converter); + tooltipDisplay?: 'off' | 'auto'; + tooltipLabel?: string; + }; + }; + viewportEnd: string; + viewportStart: string; + translations: { + accessibleDependencyInfo?: string; + accessiblePredecessorInfo?: string; + accessibleSuccessorInfo?: string; + accessibleTaskTypeMilestone?: string; + accessibleTaskTypeSummary?: string; + componentName?: string; + finishFinishDependencyAriaDesc?: string; + finishStartDependencyAriaDesc?: string; + labelAndValue?: string; + labelBaselineDate?: string; + labelBaselineEnd?: string; + labelBaselineStart?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelDate?: string; + labelEnd?: string; + labelInvalidData?: string; + labelLabel?: string; + labelMoveBy?: string; + labelNoData?: string; + labelProgress?: string; + labelRow?: string; + labelStart?: string; + startFinishDependencyAriaDesc?: string; + startStartDependencyAriaDesc?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + taskMoveCancelled?: string; + taskMoveFinalized?: string; + taskMoveInitiated?: string; + taskMoveInitiatedInstruction?: string; + taskMoveSelectionInfo?: string; + tooltipZoomIn?: string; + tooltipZoomOut?: string; + }; +} +export interface ojGanttSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojGanttDependency extends JetElement { + predecessorTaskId: any; + shortDesc: string | null; + successorTaskId: any; + svgClassName: string; + svgStyle: object; + type: 'finishStart' | 'finishFinish' | 'startStart' | 'startFinish'; + onPredecessorTaskIdChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSuccessorTaskIdChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttDependencyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojGanttDependency[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojGanttDependencySettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojGanttDependencySettablePropertiesLenient): void; +} +export interface ojGanttDependencyEventMap extends HTMLElementEventMap { + 'predecessorTaskIdChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'successorTaskIdChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'typeChanged': JetElementCustomEvent; +} +export interface ojGanttDependencySettableProperties extends JetSettableProperties { + predecessorTaskId: any; + shortDesc: string | null; + successorTaskId: any; + svgClassName: string; + svgStyle: object; + type: 'finishStart' | 'finishFinish' | 'startStart' | 'startFinish'; +} +export interface ojGanttDependencySettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojGanttRow extends JetElement { + label: string; + labelStyle: object; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttRowEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojGanttRow[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojGanttRowSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojGanttRowSettablePropertiesLenient): void; +} +export interface ojGanttRowEventMap extends HTMLElementEventMap { + 'labelChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; +} +export interface ojGanttRowSettableProperties extends JetSettableProperties { + label: string; + labelStyle: object; +} +export interface ojGanttRowSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojGanttTask extends JetElement { + baseline: { + borderRadius?: string; + end?: string; + height?: number; + start?: string; + svgClassName?: string; + svgStyle?: object; + }; + borderRadius: string; + end: string; + height: number | null; + label: string; + labelPosition: 'start' | 'innerCenter' | 'innerStart' | 'innerEnd' | 'end' | 'none'; + labelStyle: object; + progress: { + borderRadius?: string; + height?: string; + svgClassName?: string; + svgStyle?: object; + value?: number; + }; + rowId?: any; + shortDesc: string | null; + start: string; + svgClassName: string; + svgStyle: object; + type: 'normal' | 'milestone' | 'summary' | 'auto'; + onBaselineChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderRadiusChanged: ((event: JetElementCustomEvent) => any) | null; + onEndChanged: ((event: JetElementCustomEvent) => any) | null; + onHeightChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelPositionChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onProgressChanged: ((event: JetElementCustomEvent) => any) | null; + onRowIdChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onStartChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojGanttTaskEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojGanttTask[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojGanttTaskSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojGanttTaskSettablePropertiesLenient): void; +} +export interface ojGanttTaskEventMap extends HTMLElementEventMap { + 'baselineChanged': JetElementCustomEvent; + 'borderRadiusChanged': JetElementCustomEvent; + 'endChanged': JetElementCustomEvent; + 'heightChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelPositionChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'progressChanged': JetElementCustomEvent; + 'rowIdChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'startChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'typeChanged': JetElementCustomEvent; +} +export interface ojGanttTaskSettableProperties extends JetSettableProperties { + baseline: { + borderRadius?: string; + end?: string; + height?: number; + start?: string; + svgClassName?: string; + svgStyle?: object; + }; + borderRadius: string; + end: string; + height: number | null; + label: string; + labelPosition: 'start' | 'innerCenter' | 'innerStart' | 'innerEnd' | 'end' | 'none'; + labelStyle: object; + progress: { + borderRadius?: string; + height?: string; + svgClassName?: string; + svgStyle?: object; + value?: number; + }; + rowId?: any; + shortDesc: string | null; + start: string; + svgClassName: string; + svgStyle: object; + type: 'normal' | 'milestone' | 'summary' | 'auto'; +} +export interface ojGanttTaskSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojganttutils/index.d.ts b/types/oraclejet/ojganttutils/index.d.ts new file mode 100644 index 0000000000..0eb146049c --- /dev/null +++ b/types/oraclejet/ojganttutils/index.d.ts @@ -0,0 +1,4 @@ +export function computeTableColumnHeaderHeight(table: Element, gantt: Element, axisInfo: { + majorAxis: object; + minorAxis: object; +}): number; diff --git a/types/oraclejet/ojgauge/index.d.ts b/types/oraclejet/ojgauge/index.d.ts new file mode 100644 index 0000000000..d3ccbbd487 --- /dev/null +++ b/types/oraclejet/ojgauge/index.d.ts @@ -0,0 +1,574 @@ +import { Converter } from '../ojvalidation-base'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface dvtBaseGauge extends dvtBaseComponent { + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + addEventListener>(type: T, listener: (this: HTMLElement, ev: dvtBaseGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): dvtBaseGauge[T]; + getProperty(property: string): any; + setProperty(property: T, value: dvtBaseGaugeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: dvtBaseGaugeSettablePropertiesLenient): void; +} +// These interfaces are empty but required to keep the event chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface dvtBaseGaugeEventMap extends dvtBaseComponentEventMap { +} +export interface dvtBaseGaugeSettableProperties extends dvtBaseComponentSettableProperties { + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface dvtBaseGaugeSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojLedGauge extends dvtBaseGauge { + borderColor: string; + color: string; + label: { + style?: object; + text?: string; + }; + max: number; + metricLabel: { + converter?: Converter; + rendered?: 'on' | 'off'; + scaling?: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style?: object; + text?: string; + textType?: 'percent' | 'number'; + }; + min: number; + rotation: 90 | 180 | 270 | 0; + size: number; + svgClassName: string; + svgStyle: object; + thresholds: ojLedGauge.Threshold[]; + tooltip: { + renderer: ((context: ojLedGauge.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + type: 'arrow' | 'diamond' | 'square' | 'rectangle' | 'triangle' | 'star' | 'human' | 'circle'; + value: number | null; + visualEffects: 'none' | 'auto'; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMetricLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onRotationChanged: ((event: JetElementCustomEvent) => any) | null; + onSizeChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onThresholdsChanged: ((event: JetElementCustomEvent) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onVisualEffectsChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLedGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojLedGauge[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojLedGaugeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojLedGaugeSettablePropertiesLenient): void; + getMetricLabel(): string; +} +export interface ojLedGaugeEventMap extends dvtBaseGaugeEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'maxChanged': JetElementCustomEvent; + 'metricLabelChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'rotationChanged': JetElementCustomEvent; + 'sizeChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'thresholdsChanged': JetElementCustomEvent; + 'tooltipChanged': JetElementCustomEvent; + 'typeChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; + 'visualEffectsChanged': JetElementCustomEvent; +} +export interface ojLedGaugeSettableProperties extends dvtBaseGaugeSettableProperties { + borderColor: string; + color: string; + label: { + style?: object; + text?: string; + }; + max: number; + metricLabel: { + converter?: Converter; + rendered?: 'on' | 'off'; + scaling?: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style?: object; + text?: string; + textType?: 'percent' | 'number'; + }; + min: number; + rotation: 90 | 180 | 270 | 0; + size: number; + svgClassName: string; + svgStyle: object; + thresholds: ojLedGauge.Threshold[]; + tooltip: { + renderer: ((context: ojLedGauge.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + type: 'arrow' | 'diamond' | 'square' | 'rectangle' | 'triangle' | 'star' | 'human' | 'circle'; + value: number | null; + visualEffects: 'none' | 'auto'; +} +export interface ojLedGaugeSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export namespace ojLedGauge { + // tslint:disable-next-line interface-over-type-literal + type Threshold = { + borderColor?: string; + color?: string; + max?: number; + shortDesc?: string; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + color: string; + componentElement: Element; + label: string; + parentElement: Element; + }; +} +export interface ojRatingGauge extends dvtBaseGauge { + changed: boolean; + changedState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + hoverState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + max: number; + min: number; + orientation: 'vertical' | 'horizontal'; + preserveAspectRatio: 'none' | 'meet'; + readonly: boolean; + selectedState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + step: 0.5 | 1; + thresholds: ojRatingGauge.Threshold[]; + tooltip: { + renderer: ((context: ojRatingGauge.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + readonly transientValue: number | null; + unselectedState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + value: number | null; + visualEffects: 'none' | 'auto'; + onChangedChanged: ((event: JetElementCustomEvent) => any) | null; + onChangedStateChanged: ((event: JetElementCustomEvent) => any) | null; + onHoverStateChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onOrientationChanged: ((event: JetElementCustomEvent) => any) | null; + onPreserveAspectRatioChanged: ((event: JetElementCustomEvent) => any) | null; + onReadonlyChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectedStateChanged: ((event: JetElementCustomEvent) => any) | null; + onStepChanged: ((event: JetElementCustomEvent) => any) | null; + onThresholdsChanged: ((event: JetElementCustomEvent) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent) => any) | null; + onTransientValueChanged: ((event: JetElementCustomEvent) => any) | null; + onUnselectedStateChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onVisualEffectsChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojRatingGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojRatingGauge[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojRatingGaugeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojRatingGaugeSettablePropertiesLenient): void; +} +export interface ojRatingGaugeEventMap extends dvtBaseGaugeEventMap { + 'changedChanged': JetElementCustomEvent; + 'changedStateChanged': JetElementCustomEvent; + 'hoverStateChanged': JetElementCustomEvent; + 'maxChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'orientationChanged': JetElementCustomEvent; + 'preserveAspectRatioChanged': JetElementCustomEvent; + 'readonlyChanged': JetElementCustomEvent; + 'selectedStateChanged': JetElementCustomEvent; + 'stepChanged': JetElementCustomEvent; + 'thresholdsChanged': JetElementCustomEvent; + 'tooltipChanged': JetElementCustomEvent; + 'transientValueChanged': JetElementCustomEvent; + 'unselectedStateChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; + 'visualEffectsChanged': JetElementCustomEvent; +} +export interface ojRatingGaugeSettableProperties extends dvtBaseGaugeSettableProperties { + changed: boolean; + changedState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + hoverState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + max: number; + min: number; + orientation: 'vertical' | 'horizontal'; + preserveAspectRatio: 'none' | 'meet'; + readonly: boolean; + selectedState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + step: 0.5 | 1; + thresholds: ojRatingGauge.Threshold[]; + tooltip: { + renderer: ((context: ojRatingGauge.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + readonly transientValue: number | null; + unselectedState: { + borderColor?: string; + color?: string; + shape?: 'circle' | 'diamond' | 'human' | 'square' | 'star' | 'triangle' | string; + source?: string; + svgClassName?: string; + svgStyle?: object; + }; + value: number | null; + visualEffects: 'none' | 'auto'; +} +export interface ojRatingGaugeSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export namespace ojRatingGauge { + // tslint:disable-next-line interface-over-type-literal + type Threshold = { + borderColor?: string; + color?: string; + max?: number; + shortDesc?: string; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + color: string; + componentElement: Element; + label: string; + parentElement: Element; + }; +} +export interface ojStatusMeterGauge extends dvtBaseGauge { + angleExtent: number; + animationDuration?: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + borderColor: string; + borderRadius: string; + center: { + renderer: ((context: ojStatusMeterGauge.CenterContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + color: string; + indicatorSize: number; + innerRadius: number; + label: { + position?: 'center' | 'start' | 'auto'; + style?: object; + text?: string; + }; + max: number; + metricLabel: { + converter?: Converter; + position?: 'center' | 'insideIndicatorEdge' | 'outsideIndicatorEdge' | 'outsidePlotArea' | 'withLabel' | 'auto'; + rendered?: 'on' | 'off' | 'auto'; + scaling?: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style?: object; + text?: string; + textType?: 'percent' | 'number'; + }; + min: number; + orientation: 'circular' | 'vertical' | 'horizontal'; + plotArea: { + borderColor?: string; + borderRadius?: string; + color?: string; + rendered?: 'on' | 'off' | 'auto'; + svgClassName?: string; + svgStyle?: object; + }; + readonly: boolean; + referenceLines: ojStatusMeterGauge.ReferenceLine[]; + startAngle: number; + step: number | null; + svgClassName: string; + svgStyle: object; + thresholdDisplay: 'currentOnly' | 'all' | 'onIndicator'; + thresholds: ojStatusMeterGauge.Threshold[]; + tooltip: { + renderer: ((context: ojStatusMeterGauge.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + readonly transientValue: number | null; + value: number | null; + visualEffects: 'none' | 'auto'; + onAngleExtentChanged: ((event: JetElementCustomEvent) => any) | null; + onAnimationDurationChanged: ((event: JetElementCustomEvent) => any) | null; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderRadiusChanged: ((event: JetElementCustomEvent) => any) | null; + onCenterChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onIndicatorSizeChanged: ((event: JetElementCustomEvent) => any) | null; + onInnerRadiusChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMetricLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onOrientationChanged: ((event: JetElementCustomEvent) => any) | null; + onPlotAreaChanged: ((event: JetElementCustomEvent) => any) | null; + onReadonlyChanged: ((event: JetElementCustomEvent) => any) | null; + onReferenceLinesChanged: ((event: JetElementCustomEvent) => any) | null; + onStartAngleChanged: ((event: JetElementCustomEvent) => any) | null; + onStepChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onThresholdDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onThresholdsChanged: ((event: JetElementCustomEvent) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent) => any) | null; + onTransientValueChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onVisualEffectsChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojStatusMeterGaugeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojStatusMeterGauge[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojStatusMeterGaugeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojStatusMeterGaugeSettablePropertiesLenient): void; + getMetricLabel(): string; +} +export interface ojStatusMeterGaugeEventMap extends dvtBaseGaugeEventMap { + 'angleExtentChanged': JetElementCustomEvent; + 'animationDurationChanged': JetElementCustomEvent; + 'animationOnDataChangeChanged': JetElementCustomEvent; + 'animationOnDisplayChanged': JetElementCustomEvent; + 'borderColorChanged': JetElementCustomEvent; + 'borderRadiusChanged': JetElementCustomEvent; + 'centerChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'indicatorSizeChanged': JetElementCustomEvent; + 'innerRadiusChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'maxChanged': JetElementCustomEvent; + 'metricLabelChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'orientationChanged': JetElementCustomEvent; + 'plotAreaChanged': JetElementCustomEvent; + 'readonlyChanged': JetElementCustomEvent; + 'referenceLinesChanged': JetElementCustomEvent; + 'startAngleChanged': JetElementCustomEvent; + 'stepChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'thresholdDisplayChanged': JetElementCustomEvent; + 'thresholdsChanged': JetElementCustomEvent; + 'tooltipChanged': JetElementCustomEvent; + 'transientValueChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; + 'visualEffectsChanged': JetElementCustomEvent; +} +export interface ojStatusMeterGaugeSettableProperties extends dvtBaseGaugeSettableProperties { + angleExtent: number; + animationDuration?: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + borderColor: string; + borderRadius: string; + center: { + renderer: ((context: ojStatusMeterGauge.CenterContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + color: string; + indicatorSize: number; + innerRadius: number; + label: { + position?: 'center' | 'start' | 'auto'; + style?: object; + text?: string; + }; + max: number; + metricLabel: { + converter?: Converter; + position?: 'center' | 'insideIndicatorEdge' | 'outsideIndicatorEdge' | 'outsidePlotArea' | 'withLabel' | 'auto'; + rendered?: 'on' | 'off' | 'auto'; + scaling?: 'none' | 'thousand' | 'million' | 'billion' | 'trillion' | 'quadrillion' | 'auto'; + style?: object; + text?: string; + textType?: 'percent' | 'number'; + }; + min: number; + orientation: 'circular' | 'vertical' | 'horizontal'; + plotArea: { + borderColor?: string; + borderRadius?: string; + color?: string; + rendered?: 'on' | 'off' | 'auto'; + svgClassName?: string; + svgStyle?: object; + }; + readonly: boolean; + referenceLines: ojStatusMeterGauge.ReferenceLine[]; + startAngle: number; + step: number | null; + svgClassName: string; + svgStyle: object; + thresholdDisplay: 'currentOnly' | 'all' | 'onIndicator'; + thresholds: ojStatusMeterGauge.Threshold[]; + tooltip: { + renderer: ((context: ojStatusMeterGauge.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + readonly transientValue: number | null; + value: number | null; + visualEffects: 'none' | 'auto'; +} +export interface ojStatusMeterGaugeSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export namespace ojStatusMeterGauge { + // tslint:disable-next-line interface-over-type-literal + type Bounds = { + x: number; + y: number; + width: number; + height: number; + }; + // tslint:disable-next-line interface-over-type-literal + type CenterContext = { + componentElement: Element; + innerBounds: Bounds; + metricLabel: string; + outerBounds: Bounds; + }; + // tslint:disable-next-line interface-over-type-literal + type ReferenceLine = { + color?: string; + value?: number; + }; + // tslint:disable-next-line interface-over-type-literal + type Threshold = { + borderColor?: string; + color?: string; + max?: number; + shortDesc?: string; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + color: string; + componentElement: Element; + label: string; + parentElement: Element; + }; +} diff --git a/types/oraclejet/ojinputnumber/index.d.ts b/types/oraclejet/ojinputnumber/index.d.ts new file mode 100644 index 0000000000..533ec04873 --- /dev/null +++ b/types/oraclejet/ojinputnumber/index.d.ts @@ -0,0 +1,150 @@ +import { Converter, Validator, Validation, AsyncValidator } from '../ojvalidation-base'; +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojInputNumber extends editableValue { + asyncValidators: Array>; + autocomplete: 'on' | 'off' | string; + autofocus: boolean; + converter: Converter | Validation.RegisteredConverter; + max: number | null; + min: number | null; + placeholder: string | null; + readonly rawValue: string; + readonly: boolean | null; + required: boolean; + step: number | null; + validators: Array | Validation.RegisteredValidator>; + value: number | null; + virtualKeyboard: 'auto' | 'number' | 'text'; + translations: { + numberRange?: { + hint?: { + exact?: string; + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + exact?: string; + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipDecrement?: string; + tooltipIncrement?: string; + }; + onAsyncValidatorsChanged: ((event: JetElementCustomEvent) => any) | null; + onAutocompleteChanged: ((event: JetElementCustomEvent) => any) | null; + onAutofocusChanged: ((event: JetElementCustomEvent) => any) | null; + onConverterChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onPlaceholderChanged: ((event: JetElementCustomEvent) => any) | null; + onRawValueChanged: ((event: JetElementCustomEvent) => any) | null; + onReadonlyChanged: ((event: JetElementCustomEvent) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent) => any) | null; + onStepChanged: ((event: JetElementCustomEvent) => any) | null; + onValidatorsChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onVirtualKeyboardChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojInputNumber.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojInputNumber.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputNumberEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojInputNumber[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojInputNumberSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojInputNumberSettablePropertiesLenient): void; + refresh(): void; + stepDown(steps?: number): void; + stepUp(steps?: number): void; + validate(): Promise; +} +export namespace ojInputNumber { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojInputNumberEventMap extends editableValueEventMap { + 'ojAnimateEnd': ojInputNumber.ojAnimateEnd; + 'ojAnimateStart': ojInputNumber.ojAnimateStart; + 'asyncValidatorsChanged': JetElementCustomEvent; + 'autocompleteChanged': JetElementCustomEvent; + 'autofocusChanged': JetElementCustomEvent; + 'converterChanged': JetElementCustomEvent; + 'maxChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'placeholderChanged': JetElementCustomEvent; + 'rawValueChanged': JetElementCustomEvent; + 'readonlyChanged': JetElementCustomEvent; + 'requiredChanged': JetElementCustomEvent; + 'stepChanged': JetElementCustomEvent; + 'validatorsChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; + 'virtualKeyboardChanged': JetElementCustomEvent; +} +export interface ojInputNumberSettableProperties extends editableValueSettableProperties { + asyncValidators: Array>; + autocomplete: 'on' | 'off' | string; + autofocus: boolean; + converter: Converter | Validation.RegisteredConverter; + max: number | null; + min: number | null; + placeholder: string | null; + readonly rawValue: string; + readonly: boolean | null; + required: boolean; + step: number | null; + validators: Array | Validation.RegisteredValidator>; + value: number | null; + virtualKeyboard: 'auto' | 'number' | 'text'; + translations: { + numberRange?: { + hint?: { + exact?: string; + inRange?: string; + max?: string; + min?: string; + }; + messageDetail?: { + exact?: string; + rangeOverflow?: string; + rangeUnderflow?: string; + }; + messageSummary?: { + rangeOverflow?: string; + rangeUnderflow?: string; + }; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + tooltipDecrement?: string; + tooltipIncrement?: string; + }; +} +export interface ojInputNumberSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojinputtext/index.d.ts b/types/oraclejet/ojinputtext/index.d.ts new file mode 100644 index 0000000000..6caca00923 --- /dev/null +++ b/types/oraclejet/ojinputtext/index.d.ts @@ -0,0 +1,249 @@ +import { Converter, Validator, Validation, AsyncValidator } from '../ojvalidation-base'; +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface inputBase, SV = V, RV = V> extends editableValue { + asyncValidators: Array>; + autocomplete: 'on' | 'off' | string; + autofocus: boolean; + placeholder: string; + readonly rawValue: RV; + readonly: boolean; + required: boolean; + validators: Array | Validation.RegisteredValidator> | null; + translations: { + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; + onAsyncValidatorsChanged: ((event: JetElementCustomEvent["asyncValidators"]>) => any) | null; + onAutocompleteChanged: ((event: JetElementCustomEvent["autocomplete"]>) => any) | null; + onAutofocusChanged: ((event: JetElementCustomEvent["autofocus"]>) => any) | null; + onPlaceholderChanged: ((event: JetElementCustomEvent["placeholder"]>) => any) | null; + onRawValueChanged: ((event: JetElementCustomEvent["rawValue"]>) => any) | null; + onReadonlyChanged: ((event: JetElementCustomEvent["readonly"]>) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent["required"]>) => any) | null; + onValidatorsChanged: ((event: JetElementCustomEvent["validators"]>) => any) | null; + onOjAnimateEnd: ((event: inputBase.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: inputBase.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: inputBaseEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): inputBase[T]; + getProperty(property: string): any; + setProperty>(property: T, value: inputBaseSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: inputBaseSettablePropertiesLenient): void; + refresh(): void; + validate(): Promise<'valid' | 'invalid'>; +} +export namespace inputBase { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface inputBaseEventMap, SV = V, RV = V> extends editableValueEventMap { + 'ojAnimateEnd': inputBase.ojAnimateEnd; + 'ojAnimateStart': inputBase.ojAnimateStart; + 'asyncValidatorsChanged': JetElementCustomEvent["asyncValidators"]>; + 'autocompleteChanged': JetElementCustomEvent["autocomplete"]>; + 'autofocusChanged': JetElementCustomEvent["autofocus"]>; + 'placeholderChanged': JetElementCustomEvent["placeholder"]>; + 'rawValueChanged': JetElementCustomEvent["rawValue"]>; + 'readonlyChanged': JetElementCustomEvent["readonly"]>; + 'requiredChanged': JetElementCustomEvent["required"]>; + 'validatorsChanged': JetElementCustomEvent["validators"]>; +} +export interface inputBaseSettableProperties extends editableValueSettableProperties { + asyncValidators: Array>; + autocomplete: 'on' | 'off' | string; + autofocus: boolean; + placeholder: string; + readonly rawValue: RV; + readonly: boolean; + required: boolean; + validators: Array | Validation.RegisteredValidator> | null; + translations: { + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; +} +export interface inputBaseSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojInputPassword extends inputBase { + value: string | null; + translations: { + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojInputPassword.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojInputPassword.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputPasswordEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojInputPassword[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojInputPasswordSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojInputPasswordSettablePropertiesLenient): void; +} +export namespace ojInputPassword { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojInputPasswordEventMap extends inputBaseEventMap { + 'ojAnimateEnd': ojInputPassword.ojAnimateEnd; + 'ojAnimateStart': ojInputPassword.ojAnimateStart; + 'valueChanged': JetElementCustomEvent; +} +export interface ojInputPasswordSettableProperties extends inputBaseSettableProperties { + value: string | null; + translations: { + regexp?: { + messageDetail?: string; + messageSummary?: string; + }; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; +} +export interface ojInputPasswordSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojInputText extends inputBase { + clearIcon: 'never' | 'always' | 'conditional'; + converter: Converter | Validation.RegisteredConverter | null; + list: string; + virtualKeyboard: 'auto' | 'email' | 'number' | 'search' | 'tel' | 'text' | 'url'; + onClearIconChanged: ((event: JetElementCustomEvent) => any) | null; + onConverterChanged: ((event: JetElementCustomEvent) => any) | null; + onListChanged: ((event: JetElementCustomEvent) => any) | null; + onVirtualKeyboardChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojInputText.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojInputText.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojInputTextEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojInputText[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojInputTextSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojInputTextSettablePropertiesLenient): void; +} +export namespace ojInputText { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojInputTextEventMap extends inputBaseEventMap { + 'ojAnimateEnd': ojInputText.ojAnimateEnd; + 'ojAnimateStart': ojInputText.ojAnimateStart; + 'clearIconChanged': JetElementCustomEvent; + 'converterChanged': JetElementCustomEvent; + 'listChanged': JetElementCustomEvent; + 'virtualKeyboardChanged': JetElementCustomEvent; +} +export interface ojInputTextSettableProperties extends inputBaseSettableProperties { + clearIcon: 'never' | 'always' | 'conditional'; + converter: Converter | Validation.RegisteredConverter | null; + list: string; + virtualKeyboard: 'auto' | 'email' | 'number' | 'search' | 'tel' | 'text' | 'url'; +} +export interface ojInputTextSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojTextArea extends inputBase { + converter: Converter | Validation.RegisteredConverter | null; + rows: number; + onConverterChanged: ((event: JetElementCustomEvent) => any) | null; + onRowsChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojTextArea.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojTextArea.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTextAreaEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojTextArea[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojTextAreaSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojTextAreaSettablePropertiesLenient): void; +} +export namespace ojTextArea { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojTextAreaEventMap extends inputBaseEventMap { + 'ojAnimateEnd': ojTextArea.ojAnimateEnd; + 'ojAnimateStart': ojTextArea.ojAnimateStart; + 'converterChanged': JetElementCustomEvent; + 'rowsChanged': JetElementCustomEvent; +} +export interface ojTextAreaSettableProperties extends inputBaseSettableProperties { + converter: Converter | Validation.RegisteredConverter | null; + rows: number; +} +export interface ojTextAreaSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojkeyset/index.d.ts b/types/oraclejet/ojkeyset/index.d.ts new file mode 100644 index 0000000000..7ffa8547b4 --- /dev/null +++ b/types/oraclejet/ojkeyset/index.d.ts @@ -0,0 +1,28 @@ +export class ExpandAllKeySet extends KeySet { + constructor(); + add(keys: Set | K[]): ExpandAllKeySet; + addAll(): ExpandAllKeySet; + clear(): ExpandedKeySet; + delete(keys: Set | K[]): ExpandAllKeySet; + deletedValues(): Set; + has(key: K): boolean; + isAddAll(): boolean; +} +export class ExpandedKeySet extends KeySet { + constructor(keys?: Set | K[]); + add(keys: Set | K[]): ExpandedKeySet; + addAll(): ExpandAllKeySet; + clear(): ExpandedKeySet; + delete(keys: Set | K[]): ExpandedKeySet; + has(key: K): boolean; + isAddAll(): boolean; + values(): Set; +} +export abstract class KeySet { + abstract add(keys: Set | K[]): KeySet; + abstract addAll(): KeySet; + abstract clear(): KeySet; + abstract delete(keys: Set | K[]): KeySet; + abstract has(key: K): boolean; + abstract isAddAll(): boolean; +} diff --git a/types/oraclejet/ojknockout-keyset/index.d.ts b/types/oraclejet/ojknockout-keyset/index.d.ts new file mode 100644 index 0000000000..55b1beebc0 --- /dev/null +++ b/types/oraclejet/ojknockout-keyset/index.d.ts @@ -0,0 +1,8 @@ +import { ExpandedKeySet, ExpandAllKeySet } from '../ojkeyset'; +export class ObservableExpandedKeySet { + constructor(initialValue?: ExpandedKeySet | ExpandAllKeySet); + add(keys: Set | K[]): ObservableExpandedKeySet; + addAll(): ObservableExpandedKeySet; + clear(): ObservableExpandedKeySet; + delete(keys: Set | K[]): ObservableExpandedKeySet; +} diff --git a/types/oraclejet/ojknockout-model/index.d.ts b/types/oraclejet/ojknockout-model/index.d.ts new file mode 100644 index 0000000000..f73c4773c7 --- /dev/null +++ b/types/oraclejet/ojknockout-model/index.d.ts @@ -0,0 +1,3 @@ +/// +/// +export function map(m: object, callback?: ((param0: object) => void), array?: boolean): Array> | KnockoutObservableArray; diff --git a/types/oraclejet/ojknockouttemplateutils/index.d.ts b/types/oraclejet/ojknockouttemplateutils/index.d.ts new file mode 100644 index 0000000000..3c307cb427 --- /dev/null +++ b/types/oraclejet/ojknockouttemplateutils/index.d.ts @@ -0,0 +1 @@ +export function getRenderer(template: string, bReplaceNode?: boolean): ((param0: object) => void); diff --git a/types/oraclejet/ojlabel/index.d.ts b/types/oraclejet/ojlabel/index.d.ts new file mode 100644 index 0000000000..f6b0de7c4f --- /dev/null +++ b/types/oraclejet/ojlabel/index.d.ts @@ -0,0 +1,48 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojLabel extends baseComponent { + for: string | null; + help: { + definition?: string | null; + source?: string | null; + }; + labelId: string | null; + showRequired: boolean | null; + translations: { + tooltipHelp?: string; + tooltipRequired?: string; + }; + onForChanged: ((event: JetElementCustomEvent) => any) | null; + onHelpChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelIdChanged: ((event: JetElementCustomEvent) => any) | null; + onShowRequiredChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLabelEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojLabel[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojLabelSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojLabelSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojLabelEventMap extends baseComponentEventMap { + 'forChanged': JetElementCustomEvent; + 'helpChanged': JetElementCustomEvent; + 'labelIdChanged': JetElementCustomEvent; + 'showRequiredChanged': JetElementCustomEvent; +} +export interface ojLabelSettableProperties extends baseComponentSettableProperties { + for: string | null; + help: { + definition?: string | null; + source?: string | null; + }; + labelId: string | null; + showRequired: boolean | null; + translations: { + tooltipHelp?: string; + tooltipRequired?: string; + }; +} +export interface ojLabelSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojlabelvalue/index.d.ts b/types/oraclejet/ojlabelvalue/index.d.ts new file mode 100644 index 0000000000..0f51f259a6 --- /dev/null +++ b/types/oraclejet/ojlabelvalue/index.d.ts @@ -0,0 +1,26 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojLabelValue extends JetElement { + labelEdge: 'start' | 'top' | 'inherit'; + labelWidth: string; + onLabelEdgeChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelWidthChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLabelValueEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojLabelValue[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojLabelValueSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojLabelValueSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojLabelValueEventMap extends HTMLElementEventMap { + 'labelEdgeChanged': JetElementCustomEvent; + 'labelWidthChanged': JetElementCustomEvent; +} +export interface ojLabelValueSettableProperties extends JetSettableProperties { + labelEdge: 'start' | 'top' | 'inherit'; + labelWidth: string; +} +export interface ojLabelValueSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojlegend/index.d.ts b/types/oraclejet/ojlegend/index.d.ts new file mode 100644 index 0000000000..609212c1a5 --- /dev/null +++ b/types/oraclejet/ojlegend/index.d.ts @@ -0,0 +1,286 @@ +import { KeySet } from '../ojkeyset'; +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojLegend extends dvtBaseComponent> { + as: string; + data: DataProvider | null; + drilling: 'on' | 'off'; + expanded: KeySet | null; + halign: 'center' | 'end' | 'start'; + hiddenCategories: string[]; + hideAndShowBehavior: 'on' | 'off'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + orientation: 'horizontal' | 'vertical'; + scrolling: 'off' | 'asNeeded'; + symbolHeight: number; + symbolWidth: number; + textStyle?: object; + valign: 'middle' | 'bottom' | 'top'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent["drilling"]>) => any) | null; + onExpandedChanged: ((event: JetElementCustomEvent["expanded"]>) => any) | null; + onHalignChanged: ((event: JetElementCustomEvent["halign"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHideAndShowBehaviorChanged: ((event: JetElementCustomEvent["hideAndShowBehavior"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onHoverBehaviorDelayChanged: ((event: JetElementCustomEvent["hoverBehaviorDelay"]>) => any) | null; + onOrientationChanged: ((event: JetElementCustomEvent["orientation"]>) => any) | null; + onScrollingChanged: ((event: JetElementCustomEvent["scrolling"]>) => any) | null; + onSymbolHeightChanged: ((event: JetElementCustomEvent["symbolHeight"]>) => any) | null; + onSymbolWidthChanged: ((event: JetElementCustomEvent["symbolWidth"]>) => any) | null; + onTextStyleChanged: ((event: JetElementCustomEvent["textStyle"]>) => any) | null; + onValignChanged: ((event: JetElementCustomEvent["valign"]>) => any) | null; + onOjDrill: ((event: ojLegend.ojDrill) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojLegendEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojLegend[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojLegendSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojLegendSettablePropertiesLenient): void; + getContextByNode(node: Element): ojLegend.NodeContext | null; + getItem(subIdPath: any[]): ojLegend.ItemContext | null; + getPreferredSize(): ojLegend.PreferredSize | null; + getSection(subIdPath: any[]): ojLegend.SectionContext | null; +} +export namespace ojLegend { + interface ojDrill extends CustomEvent<{ + id: any; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + text: string; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + itemIndex: number; + sectionIndexPath: number[]; + subId: string; + }; + // tslint:disable-next-line interface-over-type-literal + type PreferredSize = { + width: number; + height: number; + }; + // tslint:disable-next-line interface-over-type-literal + type SectionContext = { + title: string; + sections: object[]; + items: object[]; + getSection: { + title: string; + sections: string; + items: boolean; + }; + getItems: { + text: string; + }; + }; +} +export interface ojLegendEventMap extends dvtBaseComponentEventMap> { + 'ojDrill': ojLegend.ojDrill; + 'asChanged': JetElementCustomEvent["as"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'drillingChanged': JetElementCustomEvent["drilling"]>; + 'expandedChanged': JetElementCustomEvent["expanded"]>; + 'halignChanged': JetElementCustomEvent["halign"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'hideAndShowBehaviorChanged': JetElementCustomEvent["hideAndShowBehavior"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'hoverBehaviorDelayChanged': JetElementCustomEvent["hoverBehaviorDelay"]>; + 'orientationChanged': JetElementCustomEvent["orientation"]>; + 'scrollingChanged': JetElementCustomEvent["scrolling"]>; + 'symbolHeightChanged': JetElementCustomEvent["symbolHeight"]>; + 'symbolWidthChanged': JetElementCustomEvent["symbolWidth"]>; + 'textStyleChanged': JetElementCustomEvent["textStyle"]>; + 'valignChanged': JetElementCustomEvent["valign"]>; +} +export interface ojLegendSettableProperties extends dvtBaseComponentSettableProperties { + as: string; + data: DataProvider | null; + drilling: 'on' | 'off'; + expanded: KeySet | null; + halign: 'center' | 'end' | 'start'; + hiddenCategories: string[]; + hideAndShowBehavior: 'on' | 'off'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + orientation: 'horizontal' | 'vertical'; + scrolling: 'off' | 'asNeeded'; + symbolHeight: number; + symbolWidth: number; + textStyle?: object; + valign: 'middle' | 'bottom' | 'top'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojLegendSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojLegendItem extends JetElement { + borderColor?: string; + categories?: string[]; + categoryVisibility?: 'hidden' | 'visible'; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + lineStyle?: 'dotted' | 'dashed' | 'solid'; + lineWidth?: number; + markerColor?: string; + markerShape: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSvgClassName?: string; + markerSvgStyle?: object; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shortDesc?: string; + source?: string; + svgClassName?: string; + svgStyle?: object; + symbolType?: 'line' | 'lineWithMarker' | 'image' | 'marker'; + text: string; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoryVisibilityChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent) => any) | null; + onLineStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onLineWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerColorChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerShapeChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onMarkerSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onPatternChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onSymbolTypeChanged: ((event: JetElementCustomEvent) => any) | null; + onTextChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojLegendItem[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojLegendItemSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojLegendItemSettablePropertiesLenient): void; +} +export interface ojLegendItemEventMap extends HTMLElementEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'categoriesChanged': JetElementCustomEvent; + 'categoryVisibilityChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'drillingChanged': JetElementCustomEvent; + 'lineStyleChanged': JetElementCustomEvent; + 'lineWidthChanged': JetElementCustomEvent; + 'markerColorChanged': JetElementCustomEvent; + 'markerShapeChanged': JetElementCustomEvent; + 'markerSvgClassNameChanged': JetElementCustomEvent; + 'markerSvgStyleChanged': JetElementCustomEvent; + 'patternChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'sourceChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'symbolTypeChanged': JetElementCustomEvent; + 'textChanged': JetElementCustomEvent; +} +export interface ojLegendItemSettableProperties extends JetSettableProperties { + borderColor?: string; + categories?: string[]; + categoryVisibility?: 'hidden' | 'visible'; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + lineStyle?: 'dotted' | 'dashed' | 'solid'; + lineWidth?: number; + markerColor?: string; + markerShape: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + markerSvgClassName?: string; + markerSvgStyle?: object; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shortDesc?: string; + source?: string; + svgClassName?: string; + svgStyle?: object; + symbolType?: 'line' | 'lineWithMarker' | 'image' | 'marker'; + text: string; +} +export interface ojLegendItemSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojLegendSection extends JetElement { + collapsible?: 'on' | 'off'; + text?: string; + textHalign?: 'center' | 'end' | 'start'; + textStyle?: object; + onCollapsibleChanged: ((event: JetElementCustomEvent) => any) | null; + onTextChanged: ((event: JetElementCustomEvent) => any) | null; + onTextHalignChanged: ((event: JetElementCustomEvent) => any) | null; + onTextStyleChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojLegendSectionEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojLegendSection[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojLegendSectionSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojLegendSectionSettablePropertiesLenient): void; +} +export interface ojLegendSectionEventMap extends HTMLElementEventMap { + 'collapsibleChanged': JetElementCustomEvent; + 'textChanged': JetElementCustomEvent; + 'textHalignChanged': JetElementCustomEvent; + 'textStyleChanged': JetElementCustomEvent; +} +export interface ojLegendSectionSettableProperties extends JetSettableProperties { + collapsible?: 'on' | 'off'; + text?: string; + textHalign?: 'center' | 'end' | 'start'; + textStyle?: object; +} +export interface ojLegendSectionSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojlistdataproviderview/index.d.ts b/types/oraclejet/ojlistdataproviderview/index.d.ts new file mode 100644 index 0000000000..031611e08e --- /dev/null +++ b/types/oraclejet/ojlistdataproviderview/index.d.ts @@ -0,0 +1,25 @@ +import { DataProvider, SortCriterion, FetchByKeysParameters, ContainsKeysResults, FetchByKeysResults, FetchByOffsetParameters, FetchByOffsetResults, DataMapping, FetchListResult, + FetchListParameters } from '../ojdataprovider'; +declare class ListDataProviderView implements DataProvider { + dataMapping: DataMapping; + from: any; + offset: number; + sortCriteria: Array>; + constructor(dataProvider: DataProvider, options?: { + from?: object; + offset?: number; + sortCriteria?: Array>; + dataMapping?: DataMapping; + }); + addEventListener(eventType: string, listener: EventListener): void; + containsKeys(params: FetchByKeysParameters): Promise>; + dispatchEvent(evt: Event): boolean; + fetchByKeys(params: FetchByKeysParameters): Promise>; + fetchByOffset(params: FetchByOffsetParameters): Promise>; + fetchFirst(params?: FetchListParameters): AsyncIterable>; + getCapability(capabilityName: string): any; + getTotalSize(): Promise; + isEmpty(): 'yes' | 'no' | 'unknown'; + removeEventListener(eventType: string, listener: EventListener): void; +} +export = ListDataProviderView; diff --git a/types/oraclejet/ojlistview/index.d.ts b/types/oraclejet/ojlistview/index.d.ts new file mode 100644 index 0000000000..97a77c52ea --- /dev/null +++ b/types/oraclejet/ojlistview/index.d.ts @@ -0,0 +1,335 @@ +import { KeySet } from '../ojkeyset'; +import { DataProvider } from '../ojdataprovider'; +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojListView extends baseComponent> { + as: string; + currentItem: K; + data: DataProvider; + dnd: { + drag?: { + items: { + dataTypes?: string | string[]; + drag?: ((param0: Event) => void); + dragEnd?: ((param0: Event) => void); + dragStart?: ((param0: Event, param1: { + items: Element[]; + }) => void); + }; + }; + drop?: { + items: { + dataTypes?: string | string[]; + dragEnter?: ((param0: Event, param1: { + item: Element; + }) => void); + dragLeave?: ((param0: Event, param1: { + item: Element; + }) => void); + dragOver?: ((param0: Event, param1: { + item: Element; + }) => void); + drop?: ((param0: Event, param1: ojListView.ItemsDropContext) => void); + }; + }; + reorder: { + items: 'enabled' | 'disabled'; + }; + }; + drillMode: 'collapsible' | 'none'; + expanded: KeySet; + readonly firstSelectedItem: { + key: K; + data: D; + }; + groupHeaderPosition: 'static' | 'sticky'; + item: { + focusable?: ((param0: ojListView.ItemContext) => boolean) | boolean; + renderer?: ((param0: ojListView.ItemContext) => { + insert: Element | string; + } | undefined) | null; + selectable?: ((param0: ojListView.ItemContext) => boolean) | boolean; + }; + scrollPolicy: 'auto' | 'loadMoreOnScroll'; + scrollPolicyOptions: { + fetchSize?: number; + maxCount?: number; + scroller?: Element; + }; + scrollPosition: { + x?: number; + y?: number; + index?: number; + parent?: K; + key?: K; + offsetX?: number; + offsetY?: number; + }; + selection: K[]; + selectionMode: 'none' | 'single' | 'multiple'; + selectionRequired: boolean; + translations: { + accessibleNavigateSkipItems?: string; + accessibleReorderAfterItem?: string; + accessibleReorderBeforeItem?: string; + accessibleReorderInsideItem?: string; + accessibleReorderTouchInstructionText?: string; + indexerCharacters?: string; + labelCopy?: string; + labelCut?: string; + labelPaste?: string; + labelPasteAfter?: string; + labelPasteBefore?: string; + msgFetchingData?: string; + msgNoData?: string; + }; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onCurrentItemChanged: ((event: JetElementCustomEvent["currentItem"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDndChanged: ((event: JetElementCustomEvent["dnd"]>) => any) | null; + onDrillModeChanged: ((event: JetElementCustomEvent["drillMode"]>) => any) | null; + onExpandedChanged: ((event: JetElementCustomEvent["expanded"]>) => any) | null; + onFirstSelectedItemChanged: ((event: JetElementCustomEvent["firstSelectedItem"]>) => any) | null; + onGroupHeaderPositionChanged: ((event: JetElementCustomEvent["groupHeaderPosition"]>) => any) | null; + onItemChanged: ((event: JetElementCustomEvent["item"]>) => any) | null; + onScrollPolicyChanged: ((event: JetElementCustomEvent["scrollPolicy"]>) => any) | null; + onScrollPolicyOptionsChanged: ((event: JetElementCustomEvent["scrollPolicyOptions"]>) => any) | null; + onScrollPositionChanged: ((event: JetElementCustomEvent["scrollPosition"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onSelectionRequiredChanged: ((event: JetElementCustomEvent["selectionRequired"]>) => any) | null; + onOjAnimateEnd: ((event: ojListView.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojListView.ojAnimateStart) => any) | null; + onOjBeforeCollapse: ((event: ojListView.ojBeforeCollapse) => any) | null; + onOjBeforeCurrentItem: ((event: ojListView.ojBeforeCurrentItem) => any) | null; + onOjBeforeExpand: ((event: ojListView.ojBeforeExpand) => any) | null; + onOjCollapse: ((event: ojListView.ojCollapse) => any) | null; + onOjCopy: ((event: ojListView.ojCopy) => any) | null; + onOjCut: ((event: ojListView.ojCut) => any) | null; + onOjExpand: ((event: ojListView.ojExpand) => any) | null; + onOjPaste: ((event: ojListView.ojPaste) => any) | null; + onOjReorder: ((event: ojListView.ojReorder) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojListViewEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojListView[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojListViewSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojListViewSettablePropertiesLenient): void; + getContextByNode(node: Element): ojListView.ContextByNode | null; + getDataForVisibleItem(context: { + key?: K; + index?: number; + parent?: Element; + }): D; + refresh(): void; + scrollToItem(item: { + key: K; + }): void; +} +export namespace ojListView { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeCollapse extends CustomEvent<{ + key: K; + item: Element; + [propName: string]: any; + }> { + } + interface ojBeforeCurrentItem extends CustomEvent<{ + previousKey: K; + previousItem: Element; + key: K; + item: Element; + [propName: string]: any; + }> { + } + interface ojBeforeExpand extends CustomEvent<{ + key: K; + item: Element; + [propName: string]: any; + }> { + } + interface ojCollapse extends CustomEvent<{ + key: K; + item: Element; + [propName: string]: any; + }> { + } + interface ojCopy extends CustomEvent<{ + items: Element[]; + [propName: string]: any; + }> { + } + interface ojCut extends CustomEvent<{ + items: Element[]; + [propName: string]: any; + }> { + } + interface ojExpand extends CustomEvent<{ + key: K; + item: Element; + [propName: string]: any; + }> { + } + interface ojPaste extends CustomEvent<{ + item: Element; + [propName: string]: any; + }> { + } + interface ojReorder extends CustomEvent<{ + items: Element[]; + position: string; + reference: Element; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type ContextByNode = { + subId: string; + key: K; + index: number; + parent?: Element; + group?: boolean; + }; + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + datasource: DataProvider; + index: number; + key: K; + data: D; + parentElement: Element; + depth?: number; + parentKey?: K; + leaf?: boolean; + }; + // tslint:disable-next-line interface-over-type-literal + type ItemsDropContext = { + item: Element; + position: 'before' | 'after' | 'inside'; + reorder: boolean; + }; +} +export interface ojListViewEventMap extends baseComponentEventMap> { + 'ojAnimateEnd': ojListView.ojAnimateEnd; + 'ojAnimateStart': ojListView.ojAnimateStart; + 'ojBeforeCollapse': ojListView.ojBeforeCollapse; + 'ojBeforeCurrentItem': ojListView.ojBeforeCurrentItem; + 'ojBeforeExpand': ojListView.ojBeforeExpand; + 'ojCollapse': ojListView.ojCollapse; + 'ojCopy': ojListView.ojCopy; + 'ojCut': ojListView.ojCut; + 'ojExpand': ojListView.ojExpand; + 'ojPaste': ojListView.ojPaste; + 'ojReorder': ojListView.ojReorder; + 'asChanged': JetElementCustomEvent["as"]>; + 'currentItemChanged': JetElementCustomEvent["currentItem"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'dndChanged': JetElementCustomEvent["dnd"]>; + 'drillModeChanged': JetElementCustomEvent["drillMode"]>; + 'expandedChanged': JetElementCustomEvent["expanded"]>; + 'firstSelectedItemChanged': JetElementCustomEvent["firstSelectedItem"]>; + 'groupHeaderPositionChanged': JetElementCustomEvent["groupHeaderPosition"]>; + 'itemChanged': JetElementCustomEvent["item"]>; + 'scrollPolicyChanged': JetElementCustomEvent["scrollPolicy"]>; + 'scrollPolicyOptionsChanged': JetElementCustomEvent["scrollPolicyOptions"]>; + 'scrollPositionChanged': JetElementCustomEvent["scrollPosition"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'selectionRequiredChanged': JetElementCustomEvent["selectionRequired"]>; +} +export interface ojListViewSettableProperties extends baseComponentSettableProperties { + as: string; + currentItem: K; + data: DataProvider; + dnd: { + drag?: { + items: { + dataTypes?: string | string[]; + drag?: ((param0: Event) => void); + dragEnd?: ((param0: Event) => void); + dragStart?: ((param0: Event, param1: { + items: Element[]; + }) => void); + }; + }; + drop?: { + items: { + dataTypes?: string | string[]; + dragEnter?: ((param0: Event, param1: { + item: Element; + }) => void); + dragLeave?: ((param0: Event, param1: { + item: Element; + }) => void); + dragOver?: ((param0: Event, param1: { + item: Element; + }) => void); + drop?: ((param0: Event, param1: ojListView.ItemsDropContext) => void); + }; + }; + reorder: { + items: 'enabled' | 'disabled'; + }; + }; + drillMode: 'collapsible' | 'none'; + expanded: KeySet; + readonly firstSelectedItem: { + key: K; + data: D; + }; + groupHeaderPosition: 'static' | 'sticky'; + item: { + focusable?: ((param0: ojListView.ItemContext) => boolean) | boolean; + renderer?: ((param0: ojListView.ItemContext) => { + insert: Element | string; + } | undefined) | null; + selectable?: ((param0: ojListView.ItemContext) => boolean) | boolean; + }; + scrollPolicy: 'auto' | 'loadMoreOnScroll'; + scrollPolicyOptions: { + fetchSize?: number; + maxCount?: number; + scroller?: Element; + }; + scrollPosition: { + x?: number; + y?: number; + index?: number; + parent?: K; + key?: K; + offsetX?: number; + offsetY?: number; + }; + selection: K[]; + selectionMode: 'none' | 'single' | 'multiple'; + selectionRequired: boolean; + translations: { + accessibleNavigateSkipItems?: string; + accessibleReorderAfterItem?: string; + accessibleReorderBeforeItem?: string; + accessibleReorderInsideItem?: string; + accessibleReorderTouchInstructionText?: string; + indexerCharacters?: string; + labelCopy?: string; + labelCut?: string; + labelPaste?: string; + labelPasteAfter?: string; + labelPasteBefore?: string; + msgFetchingData?: string; + msgNoData?: string; + }; +} +export interface ojListViewSettablePropertiesLenient extends Partial> { + [key: string]: any; +} diff --git a/types/oraclejet/ojlocaledata/index.d.ts b/types/oraclejet/ojlocaledata/index.d.ts new file mode 100644 index 0000000000..980d4fa2de --- /dev/null +++ b/types/oraclejet/ojlocaledata/index.d.ts @@ -0,0 +1,7 @@ +export function getDayNames(type?: 'abbreviated' | 'narrow' | 'wide'): string[]; +export function getFirstDayOfWeek(): number; +export function getMonthNames(type?: 'abbreviated' | 'narrow' | 'wide'): string[]; +export function getWeekendEnd(): number; +export function getWeekendStart(): number; +export function isMonthPriorToYear(): boolean; +export function setBundle(bundle: object): void; diff --git a/types/oraclejet/ojlogger/index.d.ts b/types/oraclejet/ojlogger/index.d.ts new file mode 100644 index 0000000000..493f251f55 --- /dev/null +++ b/types/oraclejet/ojlogger/index.d.ts @@ -0,0 +1,10 @@ +export let LEVEL_ERROR: number; +export let LEVEL_INFO: number; +export let LEVEL_LOG: number; +export let LEVEL_NONE: number; +export let LEVEL_WARN: number; +export function error(...args: Array): void; +export function info(...args: Array): void; +export function log(...args: Array): void; +export function option(key?: object | string, value?: any): any; +export function warn(...args: Array): void; diff --git a/types/oraclejet/ojmasonrylayout/index.d.ts b/types/oraclejet/ojmasonrylayout/index.d.ts new file mode 100644 index 0000000000..0de1b7ccb7 --- /dev/null +++ b/types/oraclejet/ojmasonrylayout/index.d.ts @@ -0,0 +1,119 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojMasonryLayout extends baseComponent { + reorderHandle: string | null; + translations: { + labelCut?: string; + labelPasteAfter?: string; + labelPasteBefore?: string; + }; + onReorderHandleChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojMasonryLayout.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojMasonryLayout.ojAnimateStart) => any) | null; + onOjBeforeInsert: ((event: ojMasonryLayout.ojBeforeInsert) => any) | null; + onOjBeforeRemove: ((event: ojMasonryLayout.ojBeforeRemove) => any) | null; + onOjBeforeReorder: ((event: ojMasonryLayout.ojBeforeReorder) => any) | null; + onOjBeforeResize: ((event: ojMasonryLayout.ojBeforeResize) => any) | null; + onOjInsert: ((event: ojMasonryLayout.ojInsert) => any) | null; + onOjRemove: ((event: ojMasonryLayout.ojRemove) => any) | null; + onOjReorder: ((event: ojMasonryLayout.ojReorder) => any) | null; + onOjResize: ((event: ojMasonryLayout.ojResize) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMasonryLayoutEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojMasonryLayout[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojMasonryLayoutSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojMasonryLayoutSettablePropertiesLenient): void; + insertTile(selector: string, index: number): void; + refresh(): void; + removeTile(selector: string): void; + resizeTile(selector: string, sizeStyleClass: string): void; +} +export namespace ojMasonryLayout { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeInsert extends CustomEvent<{ + tile: Element; + index: number; + [propName: string]: any; + }> { + } + interface ojBeforeRemove extends CustomEvent<{ + tile: Element; + [propName: string]: any; + }> { + } + interface ojBeforeReorder extends CustomEvent<{ + tile: Element; + fromIndex: number; + [propName: string]: any; + }> { + } + interface ojBeforeResize extends CustomEvent<{ + tile: Element; + previousSizeStyleClass: string; + sizeStyleClass: string; + [propName: string]: any; + }> { + } + interface ojInsert extends CustomEvent<{ + tile: Element; + index: number; + [propName: string]: any; + }> { + } + interface ojRemove extends CustomEvent<{ + tile: Element; + [propName: string]: any; + }> { + } + interface ojReorder extends CustomEvent<{ + tile: Element; + fromIndex: number; + toIndex: number; + [propName: string]: any; + }> { + } + interface ojResize extends CustomEvent<{ + tile: Element; + previousSizeStyleClass: string; + sizeStyleClass: string; + [propName: string]: any; + }> { + } +} +export interface ojMasonryLayoutEventMap extends baseComponentEventMap { + 'ojAnimateEnd': ojMasonryLayout.ojAnimateEnd; + 'ojAnimateStart': ojMasonryLayout.ojAnimateStart; + 'ojBeforeInsert': ojMasonryLayout.ojBeforeInsert; + 'ojBeforeRemove': ojMasonryLayout.ojBeforeRemove; + 'ojBeforeReorder': ojMasonryLayout.ojBeforeReorder; + 'ojBeforeResize': ojMasonryLayout.ojBeforeResize; + 'ojInsert': ojMasonryLayout.ojInsert; + 'ojRemove': ojMasonryLayout.ojRemove; + 'ojReorder': ojMasonryLayout.ojReorder; + 'ojResize': ojMasonryLayout.ojResize; + 'reorderHandleChanged': JetElementCustomEvent; +} +export interface ojMasonryLayoutSettableProperties extends baseComponentSettableProperties { + reorderHandle: string | null; + translations: { + labelCut?: string; + labelPasteAfter?: string; + labelPasteBefore?: string; + }; +} +export interface ojMasonryLayoutSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojmenu/index.d.ts b/types/oraclejet/ojmenu/index.d.ts new file mode 100644 index 0000000000..b6b1c8a9cb --- /dev/null +++ b/types/oraclejet/ojmenu/index.d.ts @@ -0,0 +1,105 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojMenu extends baseComponent { + disabled: boolean; + openOptions: ojMenu.OpenOptions; + translations: { + ariaFocusSkipLink?: string; + labelCancel?: string; + }; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onOpenOptionsChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAction: ((event: ojMenu.ojAction) => any) | null; + onOjAnimateEnd: ((event: ojMenu.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojMenu.ojAnimateStart) => any) | null; + onOjBeforeOpen: ((event: ojMenu.ojBeforeOpen) => any) | null; + onOjClose: ((event: ojMenu.ojClose) => any) | null; + onOjOpen: ((event: ojMenu.ojOpen) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojMenu[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojMenuSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojMenuSettablePropertiesLenient): void; + open(event?: object, openOptions?: ojMenu.OpenOptions): void; + refresh(): void; +} +export namespace ojMenu { + interface ojAction extends CustomEvent<{ + [propName: string]: any; + }> { + } + interface ojAnimateEnd extends CustomEvent<{ + element: Element; + action: 'open' | 'close'; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: 'open' | 'close'; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeOpen extends CustomEvent<{ + [propName: string]: any; + }> { + } + interface ojClose extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + interface ojOpen extends CustomEvent<{ + event: Event; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type OpenOptions = { + display?: string; + initialFocus?: string; + launcher?: string | Element; + position?: Position; + }; + // tslint:disable-next-line interface-over-type-literal + type Position = { + my?: PositionAlign; + at?: PositionAlign; + offset?: PositionPoint; + of?: string | PositionPoint; + collision?: 'flip' | 'fit' | 'flipfit' | 'flipcenter' | 'none'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionAlign = { + vertical?: 'top' | 'bottom' | 'center'; + horizontal?: 'start' | 'end' | 'left' | 'center' | 'bottom'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionPoint = { + x?: number; + y?: number; + }; +} +export interface ojMenuEventMap extends baseComponentEventMap { + 'ojAction': ojMenu.ojAction; + 'ojAnimateEnd': ojMenu.ojAnimateEnd; + 'ojAnimateStart': ojMenu.ojAnimateStart; + 'ojBeforeOpen': ojMenu.ojBeforeOpen; + 'ojClose': ojMenu.ojClose; + 'ojOpen': ojMenu.ojOpen; + 'disabledChanged': JetElementCustomEvent; + 'openOptionsChanged': JetElementCustomEvent; +} +export interface ojMenuSettableProperties extends baseComponentSettableProperties { + disabled: boolean; + openOptions: ojMenu.OpenOptions; + translations: { + ariaFocusSkipLink?: string; + labelCancel?: string; + }; +} +export interface ojMenuSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojmenuselectmany/index.d.ts b/types/oraclejet/ojmenuselectmany/index.d.ts new file mode 100644 index 0000000000..f79a0b985d --- /dev/null +++ b/types/oraclejet/ojmenuselectmany/index.d.ts @@ -0,0 +1,39 @@ +import { DataProvider } from '../ojdataprovider'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojMenuSelectMany extends JetElement { + disabled: boolean; + options: ojMenuSelectMany.Option[] | DataProvider | null; + value: any[]; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onOptionsChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMenuSelectManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojMenuSelectMany[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojMenuSelectManySettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojMenuSelectManySettablePropertiesLenient): void; +} +export interface ojMenuSelectManyEventMap extends HTMLElementEventMap { + 'disabledChanged': JetElementCustomEvent; + 'optionsChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojMenuSelectManySettableProperties extends JetSettableProperties { + disabled: boolean; + options: ojMenuSelectMany.Option[] | DataProvider | null; + value: any[]; +} +export interface ojMenuSelectManySettablePropertiesLenient extends Partial { + [key: string]: any; +} +export namespace ojMenuSelectMany { + // tslint:disable-next-line interface-over-type-literal + type Option = { + id?: string; + disabled?: boolean; + label: string; + value: any; + }; +} diff --git a/types/oraclejet/ojmessage/index.d.ts b/types/oraclejet/ojmessage/index.d.ts new file mode 100644 index 0000000000..55e905ba8d --- /dev/null +++ b/types/oraclejet/ojmessage/index.d.ts @@ -0,0 +1,80 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojMessage extends JetElement { + message: ojMessage.Message; + translations: { + categories?: { + confirmation?: string; + error?: string; + info?: string; + warning?: string; + }; + labelCloseIcon?: string; + }; + onMessageChanged: ((event: JetElementCustomEvent) => any) | null; + onTranslationsChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojMessage.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojMessage.ojAnimateStart) => any) | null; + onOjClose: ((event: ojMessage.ojClose) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMessageEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojMessage[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojMessageSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojMessageSettablePropertiesLenient): void; + close(): void; +} +export namespace ojMessage { + interface ojAnimateEnd extends CustomEvent<{ + element: Element; + action: 'open' | 'close'; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + element: Element; + action: 'open' | 'close'; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojClose extends CustomEvent<{ + message: object; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type Message = { + icon?: string; + category?: string; + severity?: 'error' | 'warning' | 'confirmation' | 'info' | 'none'; + timestamp?: string; + summary?: string; + detail?: string; + autoTimeout?: number; + closeAffordance?: 'none' | 'defaults'; + sound?: string; + }; +} +export interface ojMessageEventMap extends HTMLElementEventMap { + 'ojAnimateEnd': ojMessage.ojAnimateEnd; + 'ojAnimateStart': ojMessage.ojAnimateStart; + 'ojClose': ojMessage.ojClose; + 'messageChanged': JetElementCustomEvent; + 'translationsChanged': JetElementCustomEvent; +} +export interface ojMessageSettableProperties extends JetSettableProperties { + message: ojMessage.Message; + translations: { + categories?: { + confirmation?: string; + error?: string; + info?: string; + warning?: string; + }; + labelCloseIcon?: string; + }; +} +export interface ojMessageSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojmessages/index.d.ts b/types/oraclejet/ojmessages/index.d.ts new file mode 100644 index 0000000000..0b410266a3 --- /dev/null +++ b/types/oraclejet/ojmessages/index.d.ts @@ -0,0 +1,73 @@ +import { DataProvider } from '../ojdataprovider'; +import { ojMessage } from '../ojmessage'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojMessages extends JetElement { + display: 'general' | 'notification'; + messages: ojMessage.Message[] | null | DataProvider; + position: ojMessages.Position | null; + translations: { + ariaLiveRegion?: { + navigationFromKeyboard?: string; + navigationToKeyboard?: string; + navigationToTouch?: string; + newMessage?: string; + }; + labelLandmark?: string; + }; + onDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onMessagesChanged: ((event: JetElementCustomEvent) => any) | null; + onPositionChanged: ((event: JetElementCustomEvent) => any) | null; + onTranslationsChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojMessagesEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojMessages[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojMessagesSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojMessagesSettablePropertiesLenient): void; + close(associated: object): void; + closeAll(closeFilter?: (message: ojMessage.Message) => boolean): void; +} +export interface ojMessagesEventMap extends HTMLElementEventMap { + 'displayChanged': JetElementCustomEvent; + 'messagesChanged': JetElementCustomEvent; + 'positionChanged': JetElementCustomEvent; + 'translationsChanged': JetElementCustomEvent; +} +export interface ojMessagesSettableProperties extends JetSettableProperties { + display: 'general' | 'notification'; + messages: ojMessage.Message[] | null | DataProvider; + position: ojMessages.Position | null; + translations: { + ariaLiveRegion?: { + navigationFromKeyboard?: string; + navigationToKeyboard?: string; + navigationToTouch?: string; + newMessage?: string; + }; + labelLandmark?: string; + }; +} +export interface ojMessagesSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export namespace ojMessages { + // tslint:disable-next-line interface-over-type-literal + type Position = { + my?: PositionAlign; + at?: PositionAlign; + offset?: PositionPoint; + of?: string | PositionPoint; + collision?: 'flip' | 'fit' | 'flipfit' | 'none'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionAlign = { + vertical?: 'top' | 'bottom' | 'center'; + horizontal?: 'start' | 'end' | 'left' | 'center' | 'bottom'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionPoint = { + x?: number; + y?: number; + }; +} diff --git a/types/oraclejet/ojmessaging/index.d.ts b/types/oraclejet/ojmessaging/index.d.ts new file mode 100644 index 0000000000..0af2305ef7 --- /dev/null +++ b/types/oraclejet/ojmessaging/index.d.ts @@ -0,0 +1,15 @@ +declare class Message { + detail: string; + severity: Message.SEVERITY_TYPE | Message.SEVERITY_LEVEL; + summary: string; + constructor(summary: string, detail: string, severity?: Message.SEVERITY_TYPE | Message.SEVERITY_LEVEL); + static getMaxSeverity(messages?: Message[]): Message.SEVERITY_LEVEL | -1; + static getSeverityLevel(severity?: Message.SEVERITY_TYPE | Message.SEVERITY_LEVEL): Message.SEVERITY_LEVEL; + static getSeverityType(level?: Message.SEVERITY_TYPE | Message.SEVERITY_LEVEL): Message.SEVERITY_TYPE; + static isValid(messages: Message[]): boolean; +} +declare namespace Message { + type SEVERITY_LEVEL = 5 | 4 | 3 | 2 | 1; + type SEVERITY_TYPE = "confirmation" | "info" | "warning" | "error" | "fatal"; +} +export = Message; diff --git a/types/oraclejet/ojmodel/index.d.ts b/types/oraclejet/ojmodel/index.d.ts new file mode 100644 index 0000000000..d2ffaf54f6 --- /dev/null +++ b/types/oraclejet/ojmodel/index.d.ts @@ -0,0 +1,280 @@ +export class Collection { + changes: number[]; + comparator: null | string | ((param0: Model, param1?: Model) => number); + customPagingOptions: ((response: object) => Collection.CustomPagingOptionsReturn | null) | null; + customURL: ((param0: string, param1: Collection, param2: object) => string | object | null) | null; + fetchSize: number; + hasMore: boolean; + lastFetchCount: number; + lastFetchSize: number; + length: number; + model: object; + modelLimit: number; + models: Model[]; + offset: number; + omitLanguageHeader: boolean; + parse: ((param0: object) => object); + sortDirection: number; + totalResults: number; + url: null | string | (() => string); + constructor(models?: Model[], options?: object); + static extend(properties?: { + parse?: (data: any) => any; + model?: Model; + url?: string; + initialize?: (models: Model[], options: object) => void; + comparator?: null | string | ((model1: Model, model2?: Model) => number); + fetchSize?: number; + modelLimit?: number; + [propName: string]: any; + }, classProperties?: object): any; + abort(): Promise; + add(m: Model | object | object[] | Model[], options?: { + silent?: boolean; + at?: number; + merge?: boolean; + sort?: boolean; + force?: boolean; + deferred?: boolean; + [propName: string]: any; + }): Promise | Model[]; + any(iterator: ((param0: object) => void), context?: object): boolean; + at(index: number, options?: { + fetchSize?: number; + deferred?: boolean; + [propName: string]: any; + }): Model | Promise | null; + clone(): Collection; + contains(model: object, options?: object): boolean | Promise; + create(attributes?: object, options?: { + silent?: boolean; + at?: number; + merge?: boolean; + sort?: boolean; + force?: boolean; + deferred?: boolean; + [propName: string]: any; + }): Model | boolean | Promise; + difference(...var_args: Model[][]): Model[]; + each(iterator: ((param0: Model) => void), context?: object): undefined; + fetch(options?: { + success?: (collection: Collection, response: any, options: object) => void; + error?: (collection: Collection, xhr: any, options: object) => void; + add?: boolean; + set?: boolean; + startIndex?: number; + startID?: any; + since?: any; + until?: any; + fetchSize?: number; + [propName: string]: any; + }): object; + filter(iterator: ((param0: Model) => void), context?: object): Model[]; + findWhere(attrs: object | object[], options?: { + deferred?: boolean; + [propName: string]: any; + }): Model | Promise; + first(n?: number, options?: object): Model[] | null | Promise; + get(id: object | string, options?: object): Model | null | Promise; + getByCid(clientId: string): Model | null; + groupBy(iterator: string | ((param0: Model) => object), context?: object): object; + include(model: object, options?: object): boolean | Promise; + indexBy(iterator: string | ((param0: Model) => void), context?: object): object; + indexOf(model: object, options?: object): number | Promise; + initial(n?: number): Model[]; + isEmpty(): boolean; + isRangeLocal(start: number, count: number): boolean; + last(n?: number, options?: object): Promise | Model[] | null; + lastIndexOf(model: Model, fromIndex?: number): number; + listenTo(otherObj: object, eventType: string, callback: (eventType: string, data: object) => void): undefined; + listenToOnce(otherObj: object, eventType: string, callback: (eventType: string, data: object) => void): undefined; + map(iterator: ((param0: Model) => object), context?: object): object[]; + max(iterator: ((param0: Model) => object), context?: object): object; + min(iterator: ((param0: object) => void), context?: object): object; + modelId(attrs: object): null | string; + next(n: number, options?: { + success?: (collection: Collection, response: any, options: object) => void; + error?: (collection: Collection, xhr: any, options: object) => void; + [propName: string]: any; + }): object | null; + off(eventType?: string | object, callback?: (eventType: string, data: object) => void, context?: object): undefined; + on(eventType: string | object, callback: (eventType: string, data: object) => void, context?: object): undefined; + once(eventType: string, callback: (eventType: string, data: object) => void, context?: object): undefined; + pluck(attr: string): object[]; + pop(options?: { + silent?: boolean; + deferred?: boolean; + [propName: string]: any; + }): Model | Promise; + previous(n: number, options?: { + success?: (collection: Collection, response: any, options: object) => void; + error?: (collection: Collection, xhr: any, options: object) => void; + [propName: string]: any; + }): object; + push(m: Model | object, options?: { + silent?: boolean; + at?: number; + merge?: boolean; + sort?: boolean; + force?: boolean; + deferred?: boolean; + [propName: string]: any; + }): Promise | undefined; + refresh(options?: { + silent?: boolean; + startIndex?: number; + [propName: string]: any; + }): Promise; + remove(m: Model | Model[], options?: object): Model[] | object; + reset(data?: object, options?: { + silent?: boolean; + [propName: string]: any; + }): Model | Model[]; + rest(n?: number, options?: object): object[] | Promise; + set(models: object, options?: { + add?: boolean; + remove?: boolean; + merge?: boolean; + silent?: boolean; + deferred?: boolean; + [propName: string]: any; + }): Promise | null; + setFetchSize(n: number): undefined; + setModelLimit(n: number): undefined; + setRangeLocal(start: number, count: number): Promise; + shift(options?: object): Model | Promise | null; + size(): number; + slice(start: number, end?: number, options?: object): Promise | Model[]; + sort(options?: { + silent?: boolean; + startIndex?: number; + [propName: string]: any; + }): Promise | null; + sortBy(iterator: string | ((param0: Model) => object), context?: object): Model[]; + sortedIndex(comparator: string | ((param0: Model, param1?: Model) => object)): number; + stopListening(otherObj?: object, eventType?: string, callback?: (eventType: string, data: object) => void): undefined; + sync(method: string, collection: Collection, options?: { + success?: (json?: any[]) => void; + error?: (xhr: any, status: any, error: any) => void; + [propName: string]: any; + }): object; + toJSON(): object[]; + trigger(eventType: string): undefined; + unshift(m: object, options?: { + silent?: boolean; + at?: number; + merge?: boolean; + sort?: boolean; + force?: boolean; + deferred?: boolean; + [propName: string]: any; + }): Promise | Model[]; + whenReady(): Promise; + where(attrs: object | object[], options?: object): Promise | Model[]; + whereToCollection(attrs: object | object[], options?: object): Collection | Promise; + without(...var_args: Model[]): Model[]; +} +export namespace Collection { + // tslint:disable-next-line interface-over-type-literal + type CustomPagingOptionsReturn = { + totalResults?: number; + limit?: number; + count?: number; + offset?: number; + hasMore?: boolean; + }; + // tslint:disable-next-line interface-over-type-literal + type SetRangeLocalPromise = { + start: number; + count: number; + models: Model[]; + }; +} +export class Model { + attributes: object; + customURL: ((param0: string, param1: Model, param2: object) => string | object | null) | null; + defaults: object; + id: string | null; + idAttribute: string | null; + omitLanguageHeader: boolean; + parse: ((param0: object) => object); + parseSave: ((param0: object) => object); + urlRoot: string | null; + validate: ((param0: object, param1: object) => string | object | null) | null; + validationError: string | object | null; + constructor(attributes?: object, options?: object); + static extend(properties?: { + parse?: (data: any) => any; + parseSave?: (data: any) => any; + urlRoot?: string; + initialize?: (models: Model[], options: object) => void; + validate?: null | object | string | ((attributes: object, options?: Model) => number); + [propName: string]: any; + }, classProperties?: object): any; + changedAttributes(attributes?: object): object | boolean; + clear(options?: object): Model | boolean; + clone(): Model; + destroy(options?: { + success?: (model: Model, response: any, options: object) => void; + error?: (model: Model, xhr: any, options: object) => void; + wait?: boolean; + [propName: string]: any; + }): boolean; + fetch(options?: { + success?: (model: Model, response: any, options: object) => void; + error?: (model: Model, xhr: any, options: object) => void; + [propName: string]: any; + }): object; + get(property: string): object; + has(property: string): boolean; + hasChanged(attribute?: string): boolean; + invert(): object; + isNew(): boolean; + isValid(): boolean; + keys(): object[]; + listenTo(otherObj: object, eventType: string, callback: (eventType: string, data: object) => void): undefined; + listenToOnce(otherObj: object, eventType: string, callback: (eventType: string, data: object) => void): undefined; + matches(attrs: object): ((param0: Model) => boolean); + off(eventType?: string | object, callback?: (eventType: string, data: object) => void, context?: object): undefined; + omit(keys: object[] | object): object; + on(eventType: string | object, callback: (eventType: string, data: object) => void, context?: object): undefined; + once(eventType: string, callback: (eventType: string, data: object) => void, context?: object): undefined; + pairs(): object; + pick(keys: object[] | object): object; + previous(attr: string): object; + previousAttributes(): object; + save(attributes?: object, options?: { + success?: (model: Model, response: any, options: object) => void; + error?: (model: Model, xhr: any, options: object) => void; + contentType?: string; + valdiate?: boolean; + wait?: boolean; + patch?: boolean; + attrs?: object; + [propName: string]: any; + }): object | boolean; + set(property: string | object, value?: object, options?: object): Model | boolean; + stopListening(otherObj?: object, eventType?: string, callback?: (eventType: string, data: object) => void): undefined; + sync(method: string, model: Model, options?: object): object; + toJSON(): object; + trigger(eventType: string): undefined; + unset(property: string, options?: object): boolean; + url(): string | null; + values(): object[]; +} +export class OAuth { + constructor(attributes: object, header: string); + cleanAccessTokenRequest(): undefined; + cleanAccessTokenResponse(): undefined; + clientCredentialGrant(): undefined; + getAccessTokenRequest(): object; + getAccessTokenResponse(): object; + getHeader(): object; + isInitialized(): boolean; + setAccessTokenRequest(data: object): undefined; + setAccessTokenResponse(data: object): undefined; +} +// tslint:disable-next-line no-unnecessary-class +export class URLError { + constructor(); +} diff --git a/types/oraclejet/ojmodule-element-utils/index.d.ts b/types/oraclejet/ojmodule-element-utils/index.d.ts new file mode 100644 index 0000000000..4489ac1f28 --- /dev/null +++ b/types/oraclejet/ojmodule-element-utils/index.d.ts @@ -0,0 +1,8 @@ +export function createView(options: { + viewPath: string; + require?: ((module: string) => any) | ((modules: string[], ready?: any, errback?: any) => void); +}): Promise; +export function createViewModel(options: { + viewModelPath: string; + require?: ((module: string) => any) | ((modules: string[], ready?: any, errback?: any) => void); +}): Promise; diff --git a/types/oraclejet/ojmodule-element/index.d.ts b/types/oraclejet/ojmodule-element/index.d.ts new file mode 100644 index 0000000000..693cb518f6 --- /dev/null +++ b/types/oraclejet/ojmodule-element/index.d.ts @@ -0,0 +1,89 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ModuleElementAnimation { + animate(context: { + node: Node; + isInitial: boolean; + oldViewModel: object; + newViewModel: object; + newViewParent: Node; + oldViewParent: Node; + removeOldView: () => undefined; + insertNewView: () => undefined; + oldDomNodes: any[]; + }): Promise; + canAnimate(context: { + node: Node; + isInitial: boolean; + oldViewModel: object; + newViewModel: object; + }): boolean; + prepareAnimation(context: { + node: Node; + isInitial: boolean; + oldViewModel: object; + newViewModel: object; + }): object; +} +export interface ojModule extends JetElement { + animation: object; + config: { + cleanupMode: 'onDisconnect' | 'none'; + view: Node[]; + viewModel: object; + }; + onAnimationChanged: ((event: JetElementCustomEvent) => any) | null; + onConfigChanged: ((event: JetElementCustomEvent) => any) | null; + onOjTransitionEnd: ((event: ojModule.ojTransitionEnd) => any) | null; + onOjTransitionStart: ((event: ojModule.ojTransitionStart) => any) | null; + onOjViewConnected: ((event: ojModule.ojViewConnected) => any) | null; + onOjViewDisconnected: ((event: ojModule.ojViewDisconnected) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojModuleEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojModule[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojModuleSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojModuleSettablePropertiesLenient): void; +} +export namespace ojModule { + interface ojTransitionEnd extends CustomEvent<{ + viewModel: object; + [propName: string]: any; + }> { + } + interface ojTransitionStart extends CustomEvent<{ + viewModel: object; + [propName: string]: any; + }> { + } + interface ojViewConnected extends CustomEvent<{ + viewModel: object; + [propName: string]: any; + }> { + } + interface ojViewDisconnected extends CustomEvent<{ + viewModel: object; + view: Node[]; + [propName: string]: any; + }> { + } +} +export interface ojModuleEventMap extends HTMLElementEventMap { + 'ojTransitionEnd': ojModule.ojTransitionEnd; + 'ojTransitionStart': ojModule.ojTransitionStart; + 'ojViewConnected': ojModule.ojViewConnected; + 'ojViewDisconnected': ojModule.ojViewDisconnected; + 'animationChanged': JetElementCustomEvent; + 'configChanged': JetElementCustomEvent; +} +export interface ojModuleSettableProperties extends JetSettableProperties { + animation: object; + config: { + cleanupMode: 'onDisconnect' | 'none'; + view: Node[]; + viewModel: object; + }; +} +export interface ojModuleSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojmoduleanimations/index.d.ts b/types/oraclejet/ojmoduleanimations/index.d.ts new file mode 100644 index 0000000000..65e98ba0a7 --- /dev/null +++ b/types/oraclejet/ojmoduleanimations/index.d.ts @@ -0,0 +1,34 @@ +import { ModuleElementAnimation } from '../ojmodule-element'; +import AnimationUtils = require('../ojanimation'); +export let coverStart: ModuleElementAnimation; +export let coverUp: ModuleElementAnimation; +export let fade: ModuleElementAnimation; +export let navChild: ModuleElementAnimation; +export let navParent: ModuleElementAnimation; +export let navSiblingEarlier: ModuleElementAnimation; +export let navSiblingLater: ModuleElementAnimation; +export let pushEnd: ModuleElementAnimation; +export let pushStart: ModuleElementAnimation; +export let revealDown: ModuleElementAnimation; +export let revealEnd: ModuleElementAnimation; +export let zoomIn: ModuleElementAnimation; +export let zoomOut: ModuleElementAnimation; +export function createAnimation(oldViewEffect: { + effect: AnimationUtils.AnimationMethods; + [key: string]: any; +} | AnimationUtils.AnimationMethods | null, newViewEffect: { + effect: AnimationUtils.AnimationMethods; + [key: string]: any; +} | AnimationUtils.AnimationMethods | null, newViewOnTop: boolean): ModuleElementAnimation; +export function switcher(callback: (param0: SwitcherCallBackParam) => Animations): ModuleElementAnimation; +// tslint:disable-next-line interface-over-type-literal +export type Animations = 'coverStart' | 'coverUp' | 'fade' | 'navChild' | 'navParent' | 'navSiblingEarlier' | 'navSiblingLater' | 'pushEnd' | 'pushStart' | 'revealDown' | 'revealEnd' | 'zoomIn' | + 'zoomOut'; +// tslint:disable-next-line interface-over-type-literal +export type SwitcherCallBackParam = { + node: Element; + valueAccessor: (() => any); + isInitial: boolean; + oldViewModel: any; + newViewModel: any; +}; diff --git a/types/oraclejet/ojnavigationlist/index.d.ts b/types/oraclejet/ojnavigationlist/index.d.ts new file mode 100644 index 0000000000..d18459c5ba --- /dev/null +++ b/types/oraclejet/ojnavigationlist/index.d.ts @@ -0,0 +1,360 @@ +import { KeySet } from '../ojkeyset'; +import { DataProvider } from '../ojdataprovider'; +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojNavigationList extends baseComponent> { + as: string; + currentItem: K; + data: DataProvider | null; + display: 'all' | 'icons'; + drillMode: 'none' | 'collapsible' | 'sliding'; + edge: 'top' | 'start'; + expanded: KeySet; + hierarchyMenuThreshold: number; + item: { + renderer?: (((context: ojNavigationList.ItemContext) => void) | null); + selectable?: (((context: ojNavigationList.ItemContext) => boolean) | boolean); + }; + overflow: 'popup' | 'hidden'; + rootLabel: string | null; + selection: K; + translations: { + defaultRootLabel?: string; + hierMenuBtnLabel?: string; + previousIcon?: string; + }; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onCurrentItemChanged: ((event: JetElementCustomEvent["currentItem"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDisplayChanged: ((event: JetElementCustomEvent["display"]>) => any) | null; + onDrillModeChanged: ((event: JetElementCustomEvent["drillMode"]>) => any) | null; + onEdgeChanged: ((event: JetElementCustomEvent["edge"]>) => any) | null; + onExpandedChanged: ((event: JetElementCustomEvent["expanded"]>) => any) | null; + onHierarchyMenuThresholdChanged: ((event: JetElementCustomEvent["hierarchyMenuThreshold"]>) => any) | null; + onItemChanged: ((event: JetElementCustomEvent["item"]>) => any) | null; + onOverflowChanged: ((event: JetElementCustomEvent["overflow"]>) => any) | null; + onRootLabelChanged: ((event: JetElementCustomEvent["rootLabel"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onOjAnimateEnd: ((event: ojNavigationList.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojNavigationList.ojAnimateStart) => any) | null; + onOjBeforeCollapse: ((event: ojNavigationList.ojBeforeCollapse) => any) | null; + onOjBeforeCurrentItem: ((event: ojNavigationList.ojBeforeCurrentItem) => any) | null; + onOjBeforeExpand: ((event: ojNavigationList.ojBeforeExpand) => any) | null; + onOjBeforeSelect: ((event: ojNavigationList.ojBeforeSelect) => any) | null; + onOjCollapse: ((event: ojNavigationList.ojCollapse) => any) | null; + onOjExpand: ((event: ojNavigationList.ojExpand) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojNavigationListEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojNavigationList[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojNavigationListSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojNavigationListSettablePropertiesLenient): void; + getContextByNode(node: Element): ojNavigationList.NodeContext | null; + refresh(): void; +} +export namespace ojNavigationList { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeCollapse extends CustomEvent<{ + key: any; + item: Element; + [propName: string]: any; + }> { + } + interface ojBeforeCurrentItem extends CustomEvent<{ + previousKey: any; + previousItem: Element; + key: any; + item: Element; + [propName: string]: any; + }> { + } + interface ojBeforeExpand extends CustomEvent<{ + key: any; + item: Element; + [propName: string]: any; + }> { + } + interface ojBeforeSelect extends CustomEvent<{ + key: any; + item: Element; + [propName: string]: any; + }> { + } + interface ojCollapse extends CustomEvent<{ + key: any; + item: Element; + [propName: string]: any; + }> { + } + interface ojExpand extends CustomEvent<{ + key: any; + item: Element; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + componentElement: Element; + datasource?: DataProvider; + index: number; + key: any; + data: any; + parentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + subId: string; + index: number; + key: K; + group: boolean; + parent?: Element; + }; +} +export interface ojNavigationListEventMap extends baseComponentEventMap> { + 'ojAnimateEnd': ojNavigationList.ojAnimateEnd; + 'ojAnimateStart': ojNavigationList.ojAnimateStart; + 'ojBeforeCollapse': ojNavigationList.ojBeforeCollapse; + 'ojBeforeCurrentItem': ojNavigationList.ojBeforeCurrentItem; + 'ojBeforeExpand': ojNavigationList.ojBeforeExpand; + 'ojBeforeSelect': ojNavigationList.ojBeforeSelect; + 'ojCollapse': ojNavigationList.ojCollapse; + 'ojExpand': ojNavigationList.ojExpand; + 'asChanged': JetElementCustomEvent["as"]>; + 'currentItemChanged': JetElementCustomEvent["currentItem"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'displayChanged': JetElementCustomEvent["display"]>; + 'drillModeChanged': JetElementCustomEvent["drillMode"]>; + 'edgeChanged': JetElementCustomEvent["edge"]>; + 'expandedChanged': JetElementCustomEvent["expanded"]>; + 'hierarchyMenuThresholdChanged': JetElementCustomEvent["hierarchyMenuThreshold"]>; + 'itemChanged': JetElementCustomEvent["item"]>; + 'overflowChanged': JetElementCustomEvent["overflow"]>; + 'rootLabelChanged': JetElementCustomEvent["rootLabel"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; +} +export interface ojNavigationListSettableProperties extends baseComponentSettableProperties { + as: string; + currentItem: K; + data: DataProvider | null; + display: 'all' | 'icons'; + drillMode: 'none' | 'collapsible' | 'sliding'; + edge: 'top' | 'start'; + expanded: KeySet; + hierarchyMenuThreshold: number; + item: { + renderer?: (((context: ojNavigationList.ItemContext) => void) | null); + selectable?: (((context: ojNavigationList.ItemContext) => boolean) | boolean); + }; + overflow: 'popup' | 'hidden'; + rootLabel: string | null; + selection: K; + translations: { + defaultRootLabel?: string; + hierMenuBtnLabel?: string; + previousIcon?: string; + }; +} +export interface ojNavigationListSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojTabBar extends baseComponent> { + as: string; + currentItem: any; + data: DataProvider | null; + display: 'all' | 'icons'; + edge: 'top' | 'bottom' | 'start' | 'end'; + item: { + renderer?: (((context: ojTabBar.ItemContext) => void) | null); + selectable?: (((context: ojTabBar.ItemContext) => boolean) | boolean); + }; + overflow: 'popup' | 'hidden'; + reorderable: 'enabled' | 'disabled'; + selection: any; + truncation: 'none' | 'progressive'; + translations: { + accessibleReorderAfterItem?: string; + accessibleReorderBeforeItem?: string; + accessibleReorderTouchInstructionText?: string; + labelCut?: string; + labelPasteAfter?: string; + labelPasteBefore?: string; + labelRemove?: string; + msgFetchingData?: string; + msgNoData?: string; + overflowItemLabel?: string; + removeCueText?: string; + selectedLabel?: string; + }; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onCurrentItemChanged: ((event: JetElementCustomEvent["currentItem"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDisplayChanged: ((event: JetElementCustomEvent["display"]>) => any) | null; + onEdgeChanged: ((event: JetElementCustomEvent["edge"]>) => any) | null; + onItemChanged: ((event: JetElementCustomEvent["item"]>) => any) | null; + onOverflowChanged: ((event: JetElementCustomEvent["overflow"]>) => any) | null; + onReorderableChanged: ((event: JetElementCustomEvent["reorderable"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onTruncationChanged: ((event: JetElementCustomEvent["truncation"]>) => any) | null; + onOjAnimateEnd: ((event: ojTabBar.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojTabBar.ojAnimateStart) => any) | null; + onOjBeforeCurrentItem: ((event: ojTabBar.ojBeforeCurrentItem) => any) | null; + onOjBeforeDeselect: ((event: ojTabBar.ojBeforeDeselect) => any) | null; + onOjBeforeRemove: ((event: ojTabBar.ojBeforeRemove) => any) | null; + onOjBeforeSelect: ((event: ojTabBar.ojBeforeSelect) => any) | null; + onOjDeselect: ((event: ojTabBar.ojDeselect) => any) | null; + onOjRemove: ((event: ojTabBar.ojRemove) => any) | null; + onOjReorder: ((event: ojTabBar.ojReorder) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojTabBarEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojTabBar[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojTabBarSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojTabBarSettablePropertiesLenient): void; + getContextByNode(node: Element): ojTabBar.NodeContext | null; + refresh(): void; +} +export namespace ojTabBar { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeCurrentItem extends CustomEvent<{ + previousKey: any; + previousItem: Element; + key: any; + item: Element; + [propName: string]: any; + }> { + } + interface ojBeforeDeselect extends CustomEvent<{ + fromKey: any; + fromItem: Element; + toKey: any; + toItem: Element; + [propName: string]: any; + }> { + } + interface ojBeforeRemove extends CustomEvent<{ + item: Element; + key: any; + [propName: string]: any; + }> { + } + interface ojBeforeSelect extends CustomEvent<{ + key: any; + item: Element; + [propName: string]: any; + }> { + } + interface ojDeselect extends CustomEvent<{ + fromKey: any; + fromItem: Element; + toKey: any; + toItem: Element; + [propName: string]: any; + }> { + } + interface ojRemove extends CustomEvent<{ + item: Element; + key: any; + [propName: string]: any; + }> { + } + interface ojReorder extends CustomEvent<{ + item: Element; + position: 'before' | 'after'; + reference: Element; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + componentElement: Element; + datasource?: DataProvider; + index: number; + key: K; + data: D; + parentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + subId: string; + index: number; + key: K; + }; +} +export interface ojTabBarEventMap extends baseComponentEventMap> { + 'ojAnimateEnd': ojTabBar.ojAnimateEnd; + 'ojAnimateStart': ojTabBar.ojAnimateStart; + 'ojBeforeCurrentItem': ojTabBar.ojBeforeCurrentItem; + 'ojBeforeDeselect': ojTabBar.ojBeforeDeselect; + 'ojBeforeRemove': ojTabBar.ojBeforeRemove; + 'ojBeforeSelect': ojTabBar.ojBeforeSelect; + 'ojDeselect': ojTabBar.ojDeselect; + 'ojRemove': ojTabBar.ojRemove; + 'ojReorder': ojTabBar.ojReorder; + 'asChanged': JetElementCustomEvent["as"]>; + 'currentItemChanged': JetElementCustomEvent["currentItem"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'displayChanged': JetElementCustomEvent["display"]>; + 'edgeChanged': JetElementCustomEvent["edge"]>; + 'itemChanged': JetElementCustomEvent["item"]>; + 'overflowChanged': JetElementCustomEvent["overflow"]>; + 'reorderableChanged': JetElementCustomEvent["reorderable"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'truncationChanged': JetElementCustomEvent["truncation"]>; +} +export interface ojTabBarSettableProperties extends baseComponentSettableProperties { + as: string; + currentItem: any; + data: DataProvider | null; + display: 'all' | 'icons'; + edge: 'top' | 'bottom' | 'start' | 'end'; + item: { + renderer?: (((context: ojTabBar.ItemContext) => void) | null); + selectable?: (((context: ojTabBar.ItemContext) => boolean) | boolean); + }; + overflow: 'popup' | 'hidden'; + reorderable: 'enabled' | 'disabled'; + selection: any; + truncation: 'none' | 'progressive'; + translations: { + accessibleReorderAfterItem?: string; + accessibleReorderBeforeItem?: string; + accessibleReorderTouchInstructionText?: string; + labelCut?: string; + labelPasteAfter?: string; + labelPasteBefore?: string; + labelRemove?: string; + msgFetchingData?: string; + msgNoData?: string; + overflowItemLabel?: string; + removeCueText?: string; + selectedLabel?: string; + }; +} +export interface ojTabBarSettablePropertiesLenient extends Partial> { + [key: string]: any; +} diff --git a/types/oraclejet/ojnbox/index.d.ts b/types/oraclejet/ojnbox/index.d.ts new file mode 100644 index 0000000000..9b7f31cdad --- /dev/null +++ b/types/oraclejet/ojnbox/index.d.ts @@ -0,0 +1,490 @@ +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojNBox extends dvtBaseComponent> { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + cellContent: 'counts' | 'auto'; + cellMaximize: 'off' | 'on'; + cells: Promise | null; + columns: Promise | null; + columnsTitle: string; + countLabel: ((context: ojNBox.CountLabelContext) => (string | null)); + data: DataProvider | null; + groupAttributes: 'color' | 'indicatorColor' | 'indicatorIconColor' | 'indicatorIconPattern' | 'indicatorIconShape'; + groupBehavior: 'acrossCells' | 'none' | 'withinCell'; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + labelTruncation: 'ifRequired' | 'on'; + maximizedColumn: string; + maximizedRow: string; + otherColor: string; + otherThreshold: number; + rows: Promise | null; + rowsTitle: string; + selection: K[]; + selectionMode: 'none' | 'single' | 'multiple'; + styleDefaults: { + animationDuration: number; + cellDefaults: { + labelHalign: 'center' | 'end' | 'start'; + labelStyle: object; + maximizedSvgStyle: object; + minimizedSvgStyle: object; + showCount: 'on' | 'off' | 'auto'; + svgStyle: object; + }; + columnLabelStyle: object; + columnsTitleStyle: object; + hoverBehaviorDelay: number; + nodeDefaults: { + borderColor: string; + borderWidth: number; + color: string; + iconDefaults: { + borderColor: string; + borderRadius: string; + borderWidth: number; + color: string; + height: number; + opacity: number; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shape: 'circle' | 'ellipse' | 'square' | 'plus' | 'diamond' | 'triangleUp' | 'triangleDown' | 'human' | 'rectangle' | 'star'; + source: string; + width: number; + }; + indicatorColor: string; + indicatorIconDefaults: { + borderColor: string; + borderRadius: string; + borderWidth: number; + color: string; + height: number; + opacity: number; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shape: 'circle' | 'ellipse' | 'square' | 'plus' | 'diamond' | 'triangleUp' | 'triangleDown' | 'human' | 'rectangle' | 'star'; + source: string; + width: number; + }; + labelStyle: object; + secondaryLabelStyle: object; + }; + rowLabelStyle: object; + rowsTitleStyle: object; + }; + tooltip: { + renderer: ((context: ojNBox.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })) | null; + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + highlightedCount?: string; + labelAdditionalData?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelGroup?: string; + labelInvalidData?: string; + labelNoData?: string; + labelOther?: string; + labelSize?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onCellContentChanged: ((event: JetElementCustomEvent["cellContent"]>) => any) | null; + onCellMaximizeChanged: ((event: JetElementCustomEvent["cellMaximize"]>) => any) | null; + onCellsChanged: ((event: JetElementCustomEvent["cells"]>) => any) | null; + onColumnsChanged: ((event: JetElementCustomEvent["columns"]>) => any) | null; + onColumnsTitleChanged: ((event: JetElementCustomEvent["columnsTitle"]>) => any) | null; + onCountLabelChanged: ((event: JetElementCustomEvent["countLabel"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onGroupAttributesChanged: ((event: JetElementCustomEvent["groupAttributes"]>) => any) | null; + onGroupBehaviorChanged: ((event: JetElementCustomEvent["groupBehavior"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onLabelTruncationChanged: ((event: JetElementCustomEvent["labelTruncation"]>) => any) | null; + onMaximizedColumnChanged: ((event: JetElementCustomEvent["maximizedColumn"]>) => any) | null; + onMaximizedRowChanged: ((event: JetElementCustomEvent["maximizedRow"]>) => any) | null; + onOtherColorChanged: ((event: JetElementCustomEvent["otherColor"]>) => any) | null; + onOtherThresholdChanged: ((event: JetElementCustomEvent["otherThreshold"]>) => any) | null; + onRowsChanged: ((event: JetElementCustomEvent["rows"]>) => any) | null; + onRowsTitleChanged: ((event: JetElementCustomEvent["rowsTitle"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onStyleDefaultsChanged: ((event: JetElementCustomEvent["styleDefaults"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTouchResponseChanged: ((event: JetElementCustomEvent["touchResponse"]>) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojNBoxEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojNBox[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojNBoxSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojNBoxSettablePropertiesLenient): void; + getCell(rowValue: string, columnValue: string): object | null; + getColumn(columnValue: string): object | null; + getColumnCount(): number; + getColumnsTitle(): string; + getContextByNode(node: Element): object | null; + getDialog(): object | null; + getGroupBehavior(): string; + getGroupNode(groupCategory: string): object | null; + getRow(rowValue: string): object | null; + getRowCount(): number; + getRowsTitle(): string; +} +export interface ojNBoxEventMap extends dvtBaseComponentEventMap> { + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'cellContentChanged': JetElementCustomEvent["cellContent"]>; + 'cellMaximizeChanged': JetElementCustomEvent["cellMaximize"]>; + 'cellsChanged': JetElementCustomEvent["cells"]>; + 'columnsChanged': JetElementCustomEvent["columns"]>; + 'columnsTitleChanged': JetElementCustomEvent["columnsTitle"]>; + 'countLabelChanged': JetElementCustomEvent["countLabel"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'groupAttributesChanged': JetElementCustomEvent["groupAttributes"]>; + 'groupBehaviorChanged': JetElementCustomEvent["groupBehavior"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'labelTruncationChanged': JetElementCustomEvent["labelTruncation"]>; + 'maximizedColumnChanged': JetElementCustomEvent["maximizedColumn"]>; + 'maximizedRowChanged': JetElementCustomEvent["maximizedRow"]>; + 'otherColorChanged': JetElementCustomEvent["otherColor"]>; + 'otherThresholdChanged': JetElementCustomEvent["otherThreshold"]>; + 'rowsChanged': JetElementCustomEvent["rows"]>; + 'rowsTitleChanged': JetElementCustomEvent["rowsTitle"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'styleDefaultsChanged': JetElementCustomEvent["styleDefaults"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'touchResponseChanged': JetElementCustomEvent["touchResponse"]>; +} +export interface ojNBoxSettableProperties extends dvtBaseComponentSettableProperties { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + cellContent: 'counts' | 'auto'; + cellMaximize: 'off' | 'on'; + cells: ojNBox.Cell[] | Promise | null; + columns: ojNBox.Column[] | Promise | null; + columnsTitle: string; + countLabel: ((context: ojNBox.CountLabelContext) => (string | null)); + data: DataProvider | null; + groupAttributes: 'color' | 'indicatorColor' | 'indicatorIconColor' | 'indicatorIconPattern' | 'indicatorIconShape'; + groupBehavior: 'acrossCells' | 'none' | 'withinCell'; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + labelTruncation: 'ifRequired' | 'on'; + maximizedColumn: string; + maximizedRow: string; + otherColor: string; + otherThreshold: number; + rows: ojNBox.Row[] | Promise | null; + rowsTitle: string; + selection: K[]; + selectionMode: 'none' | 'single' | 'multiple'; + styleDefaults: { + animationDuration: number; + cellDefaults: { + labelHalign: 'center' | 'end' | 'start'; + labelStyle: object; + maximizedSvgStyle: object; + minimizedSvgStyle: object; + showCount: 'on' | 'off' | 'auto'; + svgStyle: object; + }; + columnLabelStyle: object; + columnsTitleStyle: object; + hoverBehaviorDelay: number; + nodeDefaults: { + borderColor: string; + borderWidth: number; + color: string; + iconDefaults: { + borderColor: string; + borderRadius: string; + borderWidth: number; + color: string; + height: number; + opacity: number; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shape: 'circle' | 'ellipse' | 'square' | 'plus' | 'diamond' | 'triangleUp' | 'triangleDown' | 'human' | 'rectangle' | 'star'; + source: string; + width: number; + }; + indicatorColor: string; + indicatorIconDefaults: { + borderColor: string; + borderRadius: string; + borderWidth: number; + color: string; + height: number; + opacity: number; + pattern: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + shape: 'circle' | 'ellipse' | 'square' | 'plus' | 'diamond' | 'triangleUp' | 'triangleDown' | 'human' | 'rectangle' | 'star'; + source: string; + width: number; + }; + labelStyle: object; + secondaryLabelStyle: object; + }; + rowLabelStyle: object; + rowsTitleStyle: object; + }; + tooltip: { + renderer: ((context: ojNBox.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })) | null; + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + highlightedCount?: string; + labelAdditionalData?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelGroup?: string; + labelInvalidData?: string; + labelNoData?: string; + labelOther?: string; + labelSize?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojNBoxSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export namespace ojNBox { + // tslint:disable-next-line interface-over-type-literal + type Cell = { + label?: string; + column: string; + labelHalign?: string; + labelStyle?: object; + svgClassName?: string; + svgStyle?: object; + maximizedSvgStyle?: object; + maximizedSvgClassName?: string; + minimizedSvgStyle?: object; + minimizedSvgClassName?: string; + row: string; + showCount?: 'on' | 'off' | 'auto' | string; + shortDesc?: string; + }; + // tslint:disable-next-line interface-over-type-literal + type Column = { + id: string; + label?: string; + labelStyle?: object; + }; + // tslint:disable-next-line interface-over-type-literal + type CountLabelContext = { + row: string; + column: string; + nodeCount: number; + totalNodeCount: number; + highlightedNodeCount: number; + }; + // tslint:disable-next-line interface-over-type-literal + type Row = { + id: string; + label?: string; + labelStyle?: object; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + parentElement: Element; + id: K; + label: string; + secondaryLabel: string; + row: string; + column: string; + color: string; + indicatorColor: string; + componentElement: Element; + }; +} +export interface ojNBoxNode extends JetElement { + borderColor: string; + borderWidth: number; + categories: string[]; + color?: string; + column: string; + groupCategory?: string; + icon?: { + borderColor?: string; + borderRadius?: string; + borderWidth: number; + color?: string; + height?: number | null; + opacity: number; + pattern?: 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none' | 'mallChecker' | 'smallCrosshatch' | + 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source?: string; + svgClassName: string; + svgStyle?: object; + width?: number | null; + }; + indicatorColor?: string; + indicatorIcon?: { + borderColor?: string; + borderRadius?: string; + borderWidth: number; + color?: string; + height?: number | null; + opacity: number; + pattern?: 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none' | 'smallChecker' | 'smallCrosshatch' | + 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source?: string | null; + svgClassName: string; + svgStyle?: object | null; + width?: number | null; + }; + label: string; + row: string; + secondaryLabel: string; + shortDesc: string; + svgClassName: string; + svgStyle: object | null; + xPercentage?: number | null; + yPercentage?: number | null; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onColumnChanged: ((event: JetElementCustomEvent) => any) | null; + onGroupCategoryChanged: ((event: JetElementCustomEvent) => any) | null; + onIconChanged: ((event: JetElementCustomEvent) => any) | null; + onIndicatorColorChanged: ((event: JetElementCustomEvent) => any) | null; + onIndicatorIconChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onRowChanged: ((event: JetElementCustomEvent) => any) | null; + onSecondaryLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onXPercentageChanged: ((event: JetElementCustomEvent) => any) | null; + onYPercentageChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojNBoxNodeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojNBoxNode[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojNBoxNodeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojNBoxNodeSettablePropertiesLenient): void; +} +export interface ojNBoxNodeEventMap extends HTMLElementEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'borderWidthChanged': JetElementCustomEvent; + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'columnChanged': JetElementCustomEvent; + 'groupCategoryChanged': JetElementCustomEvent; + 'iconChanged': JetElementCustomEvent; + 'indicatorColorChanged': JetElementCustomEvent; + 'indicatorIconChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'rowChanged': JetElementCustomEvent; + 'secondaryLabelChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'xPercentageChanged': JetElementCustomEvent; + 'yPercentageChanged': JetElementCustomEvent; +} +export interface ojNBoxNodeSettableProperties extends JetSettableProperties { + borderColor: string; + borderWidth: number; + categories: string[]; + color?: string; + column: string; + groupCategory?: string; + icon?: { + borderColor?: string; + borderRadius?: string; + borderWidth: number; + color?: string; + height?: number | null; + opacity: number; + pattern?: 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none' | 'mallChecker' | 'smallCrosshatch' | + 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source?: string; + svgClassName: string; + svgStyle?: object; + width?: number | null; + }; + indicatorColor?: string; + indicatorIcon?: { + borderColor?: string; + borderRadius?: string; + borderWidth: number; + color?: string; + height?: number | null; + opacity: number; + pattern?: 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none' | 'smallChecker' | 'smallCrosshatch' | + 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + source?: string | null; + svgClassName: string; + svgStyle?: object | null; + width?: number | null; + }; + label: string; + row: string; + secondaryLabel: string; + shortDesc: string; + svgClassName: string; + svgStyle: object | null; + xPercentage?: number | null; + yPercentage?: number | null; +} +export interface ojNBoxNodeSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojoptgroup/index.d.ts b/types/oraclejet/ojoptgroup/index.d.ts new file mode 100644 index 0000000000..af7d72e004 --- /dev/null +++ b/types/oraclejet/ojoptgroup/index.d.ts @@ -0,0 +1,26 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojOptgroup extends JetElement { + disabled: boolean; + label: string; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojOptgroupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojOptgroup[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojOptgroupSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojOptgroupSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojOptgroupEventMap extends HTMLElementEventMap { + 'disabledChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; +} +export interface ojOptgroupSettableProperties extends JetSettableProperties { + disabled: boolean; + label: string; +} +export interface ojOptgroupSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojoption/index.d.ts b/types/oraclejet/ojoption/index.d.ts new file mode 100644 index 0000000000..f969e1e320 --- /dev/null +++ b/types/oraclejet/ojoption/index.d.ts @@ -0,0 +1,26 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojOption extends JetElement { + disabled: boolean; + value: any; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojOptionEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojOption[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojOptionSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojOptionSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojOptionEventMap extends HTMLElementEventMap { + 'disabledChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojOptionSettableProperties extends JetSettableProperties { + disabled: boolean; + value: any; +} +export interface ojOptionSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojpictochart/index.d.ts b/types/oraclejet/ojpictochart/index.d.ts new file mode 100644 index 0000000000..caf85f6dee --- /dev/null +++ b/types/oraclejet/ojpictochart/index.d.ts @@ -0,0 +1,268 @@ +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojPictoChart extends dvtBaseComponent> { + animationDuration?: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'popIn' | 'alphaFade' | 'zoom' | 'none'; + as: string; + columnCount: number | null; + columnWidth: number | null; + data: DataProvider | null; + drilling: 'on' | 'off'; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + layout: 'vertical' | 'horizontal'; + layoutOrigin: 'topEnd' | 'bottomStart' | 'bottomEnd' | 'topStart'; + rowCount: number | null; + rowHeight: number | null; + selection: K[]; + selectionMode: 'single' | 'multiple' | 'none'; + tooltip: { + renderer: ((context: ojPictoChart.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })) | null; + }; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onAnimationDurationChanged: ((event: JetElementCustomEvent["animationDuration"]>) => any) | null; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onColumnCountChanged: ((event: JetElementCustomEvent["columnCount"]>) => any) | null; + onColumnWidthChanged: ((event: JetElementCustomEvent["columnWidth"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent["drilling"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onHoverBehaviorDelayChanged: ((event: JetElementCustomEvent["hoverBehaviorDelay"]>) => any) | null; + onLayoutChanged: ((event: JetElementCustomEvent["layout"]>) => any) | null; + onLayoutOriginChanged: ((event: JetElementCustomEvent["layoutOrigin"]>) => any) | null; + onRowCountChanged: ((event: JetElementCustomEvent["rowCount"]>) => any) | null; + onRowHeightChanged: ((event: JetElementCustomEvent["rowHeight"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onOjDrill: ((event: ojPictoChart.ojDrill) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojPictoChartEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojPictoChart[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojPictoChartSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojPictoChartSettablePropertiesLenient): void; + getContextByNode(node: Element): ojPictoChart.NodeContext | null; + getItem(index: number): ojPictoChart.ItemContext | null; + getItemCount(): number; +} +export namespace ojPictoChart { + interface ojDrill extends CustomEvent<{ + id: any; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + color: string; + count: number; + id: K; + name: string; + selected: boolean; + tooltip: string; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + subId: string; + index: number; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + parentElement: Element; + id: K; + name: string; + count: number; + color: string; + componentElement: Element; + }; +} +export interface ojPictoChartEventMap extends dvtBaseComponentEventMap> { + 'ojDrill': ojPictoChart.ojDrill; + 'animationDurationChanged': JetElementCustomEvent["animationDuration"]>; + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'columnCountChanged': JetElementCustomEvent["columnCount"]>; + 'columnWidthChanged': JetElementCustomEvent["columnWidth"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'drillingChanged': JetElementCustomEvent["drilling"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'hoverBehaviorDelayChanged': JetElementCustomEvent["hoverBehaviorDelay"]>; + 'layoutChanged': JetElementCustomEvent["layout"]>; + 'layoutOriginChanged': JetElementCustomEvent["layoutOrigin"]>; + 'rowCountChanged': JetElementCustomEvent["rowCount"]>; + 'rowHeightChanged': JetElementCustomEvent["rowHeight"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; +} +export interface ojPictoChartSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration?: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'popIn' | 'alphaFade' | 'zoom' | 'none'; + as: string; + columnCount: number | null; + columnWidth: number | null; + data: DataProvider | null; + drilling: 'on' | 'off'; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + layout: 'vertical' | 'horizontal'; + layoutOrigin: 'topEnd' | 'bottomStart' | 'bottomEnd' | 'topStart'; + rowCount: number | null; + rowHeight: number | null; + selection: K[]; + selectionMode: 'single' | 'multiple' | 'none'; + tooltip: { + renderer: ((context: ojPictoChart.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })) | null; + }; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojPictoChartSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojPictoChartItem extends JetElement { + borderColor: string; + borderWidth: number; + categories: string[]; + color: string; + columnSpan: number; + count: number; + drilling: 'inherit' | 'off' | 'on'; + name: string; + rowSpan: number; + shape?: 'circle' | 'diamond' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | 'none' | string; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onColumnSpanChanged: ((event: JetElementCustomEvent) => any) | null; + onCountChanged: ((event: JetElementCustomEvent) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent) => any) | null; + onNameChanged: ((event: JetElementCustomEvent) => any) | null; + onRowSpanChanged: ((event: JetElementCustomEvent) => any) | null; + onShapeChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojPictoChartItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojPictoChartItem[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojPictoChartItemSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojPictoChartItemSettablePropertiesLenient): void; +} +export interface ojPictoChartItemEventMap extends HTMLElementEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'borderWidthChanged': JetElementCustomEvent; + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'columnSpanChanged': JetElementCustomEvent; + 'countChanged': JetElementCustomEvent; + 'drillingChanged': JetElementCustomEvent; + 'nameChanged': JetElementCustomEvent; + 'rowSpanChanged': JetElementCustomEvent; + 'shapeChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'sourceChanged': JetElementCustomEvent; + 'sourceHoverChanged': JetElementCustomEvent; + 'sourceHoverSelectedChanged': JetElementCustomEvent; + 'sourceSelectedChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; +} +export interface ojPictoChartItemSettableProperties extends JetSettableProperties { + borderColor: string; + borderWidth: number; + categories: string[]; + color: string; + columnSpan: number; + count: number; + drilling: 'inherit' | 'off' | 'on'; + name: string; + rowSpan: number; + shape?: 'circle' | 'diamond' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | 'none' | string; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; +} +export interface ojPictoChartItemSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojpopup/index.d.ts b/types/oraclejet/ojpopup/index.d.ts new file mode 100644 index 0000000000..9ade7e2c21 --- /dev/null +++ b/types/oraclejet/ojpopup/index.d.ts @@ -0,0 +1,128 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojPopup extends baseComponent { + autoDismiss: 'none' | 'focusLoss'; + chrome: 'default' | 'none'; + initialFocus: 'auto' | 'none' | 'firstFocusable' | 'popup'; + modality: 'modeless' | 'modal'; + position: ojPopup.Position; + tail: 'none' | 'simple'; + translations: { + ariaCloseSkipLink?: string; + ariaFocusSkipLink?: string; + ariaLiveRegionInitialFocusFirstFocusable?: string; + ariaLiveRegionInitialFocusFirstFocusableTouch?: string; + ariaLiveRegionInitialFocusNone?: string; + ariaLiveRegionInitialFocusNoneTouch?: string; + }; + onAutoDismissChanged: ((event: JetElementCustomEvent) => any) | null; + onChromeChanged: ((event: JetElementCustomEvent) => any) | null; + onInitialFocusChanged: ((event: JetElementCustomEvent) => any) | null; + onModalityChanged: ((event: JetElementCustomEvent) => any) | null; + onPositionChanged: ((event: JetElementCustomEvent) => any) | null; + onTailChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojPopup.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojPopup.ojAnimateStart) => any) | null; + onOjBeforeClose: ((event: ojPopup.ojBeforeClose) => any) | null; + onOjBeforeOpen: ((event: ojPopup.ojBeforeOpen) => any) | null; + onOjClose: ((event: ojPopup.ojClose) => any) | null; + onOjFocus: ((event: ojPopup.ojFocus) => any) | null; + onOjOpen: ((event: ojPopup.ojOpen) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojPopupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojPopup[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojPopupSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojPopupSettablePropertiesLenient): void; + close(): void; + isOpen(): boolean; + open(launcher: string | Element, position?: ojPopup.Position): void; + refresh(): void; +} +export namespace ojPopup { + interface ojAnimateEnd extends CustomEvent<{ + element: Element; + action: 'open' | 'close'; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: 'open' | 'close'; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeClose extends CustomEvent<{ + [propName: string]: any; + }> { + } + interface ojBeforeOpen extends CustomEvent<{ + [propName: string]: any; + }> { + } + interface ojClose extends CustomEvent<{ + [propName: string]: any; + }> { + } + interface ojFocus extends CustomEvent<{ + [propName: string]: any; + }> { + } + interface ojOpen extends CustomEvent<{ + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type Position = { + my?: PositionAlign; + at?: PositionAlign; + offset?: PositionPoint; + of?: string | PositionPoint; + collision?: 'flip' | 'fit' | 'flipfit' | 'flipcenter' | 'none'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionAlign = { + vertical?: 'top' | 'bottom' | 'center'; + horizontal?: 'start' | 'end' | 'left' | 'center' | 'bottom'; + }; + // tslint:disable-next-line interface-over-type-literal + type PositionPoint = { + x?: number; + y?: number; + }; +} +export interface ojPopupEventMap extends baseComponentEventMap { + 'ojAnimateEnd': ojPopup.ojAnimateEnd; + 'ojAnimateStart': ojPopup.ojAnimateStart; + 'ojBeforeClose': ojPopup.ojBeforeClose; + 'ojBeforeOpen': ojPopup.ojBeforeOpen; + 'ojClose': ojPopup.ojClose; + 'ojFocus': ojPopup.ojFocus; + 'ojOpen': ojPopup.ojOpen; + 'autoDismissChanged': JetElementCustomEvent; + 'chromeChanged': JetElementCustomEvent; + 'initialFocusChanged': JetElementCustomEvent; + 'modalityChanged': JetElementCustomEvent; + 'positionChanged': JetElementCustomEvent; + 'tailChanged': JetElementCustomEvent; +} +export interface ojPopupSettableProperties extends baseComponentSettableProperties { + autoDismiss: 'none' | 'focusLoss'; + chrome: 'default' | 'none'; + initialFocus: 'auto' | 'none' | 'firstFocusable' | 'popup'; + modality: 'modeless' | 'modal'; + position: ojPopup.Position; + tail: 'none' | 'simple'; + translations: { + ariaCloseSkipLink?: string; + ariaFocusSkipLink?: string; + ariaLiveRegionInitialFocusFirstFocusable?: string; + ariaLiveRegionInitialFocusFirstFocusableTouch?: string; + ariaLiveRegionInitialFocusNone?: string; + ariaLiveRegionInitialFocusNoneTouch?: string; + }; +} +export interface ojPopupSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojprogress/index.d.ts b/types/oraclejet/ojprogress/index.d.ts new file mode 100644 index 0000000000..779031816c --- /dev/null +++ b/types/oraclejet/ojprogress/index.d.ts @@ -0,0 +1,35 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojProgress extends baseComponent { + max: number; + type: 'bar' | 'circle'; + value: number; + translations: { + ariaIndeterminateProgressText?: string; + }; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojProgressEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojProgress[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojProgressSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojProgressSettablePropertiesLenient): void; +} +export interface ojProgressEventMap extends baseComponentEventMap { + 'maxChanged': JetElementCustomEvent; + 'typeChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojProgressSettableProperties extends baseComponentSettableProperties { + max: number; + type: 'bar' | 'circle'; + value: number; + translations: { + ariaIndeterminateProgressText?: string; + }; +} +export interface ojProgressSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojprogresslist/index.d.ts b/types/oraclejet/ojprogresslist/index.d.ts new file mode 100644 index 0000000000..22e91c465d --- /dev/null +++ b/types/oraclejet/ojprogresslist/index.d.ts @@ -0,0 +1,30 @@ +import { DataProvider } from '../ojdataprovider'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojProgressList extends JetElement { + data: DataProvider | null; + onDataChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojProgressListEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojProgressList[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojProgressListSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojProgressListSettablePropertiesLenient): void; +} +export interface ojProgressListEventMap extends HTMLElementEventMap { + 'dataChanged': JetElementCustomEvent; +} +export interface ojProgressListSettableProperties extends JetSettableProperties { + data: DataProvider | null; +} +export interface ojProgressListSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ProgressItem { + addEventListener(eventType: ProgressItem.EventType, listener: EventListener): void; + removeEventListener(eventType: ProgressItem.EventType, listener: EventListener): void; +} +export namespace ProgressItem { + type EventType = "loadstart" | "progress" | "abort" | "error" | "load" | "timeout" | "loadend"; + type Status = "queued" | "loadstarted" | "aborted" | "errored" | "timedout" | "loaded"; +} diff --git a/types/oraclejet/ojpulltorefresh/index.d.ts b/types/oraclejet/ojpulltorefresh/index.d.ts new file mode 100644 index 0000000000..86db5b3db1 --- /dev/null +++ b/types/oraclejet/ojpulltorefresh/index.d.ts @@ -0,0 +1,6 @@ +export function setupPullToRefresh(element: Element, refreshFunc: (() => Promise), options?: { + threshold?: number; + primaryText?: string; + secondaryText?: string; +}): void; +export function tearDownPullToRefresh(element: Element): void; diff --git a/types/oraclejet/ojradioset/index.d.ts b/types/oraclejet/ojradioset/index.d.ts new file mode 100644 index 0000000000..4b910c22fd --- /dev/null +++ b/types/oraclejet/ojradioset/index.d.ts @@ -0,0 +1,69 @@ +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojRadioset extends editableValue { + disabled: boolean; + labelledBy: string | null; + required: boolean; + value: any; + translations: { + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelledByChanged: ((event: JetElementCustomEvent) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojRadioset.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojRadioset.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojRadiosetEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojRadioset[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojRadiosetSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojRadiosetSettablePropertiesLenient): void; + refresh(): void; + validate(): Promise; +} +export namespace ojRadioset { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojRadiosetEventMap extends editableValueEventMap { + 'ojAnimateEnd': ojRadioset.ojAnimateEnd; + 'ojAnimateStart': ojRadioset.ojAnimateStart; + 'disabledChanged': JetElementCustomEvent; + 'labelledByChanged': JetElementCustomEvent; + 'requiredChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojRadiosetSettableProperties extends editableValueSettableProperties { + disabled: boolean; + labelledBy: string | null; + required: boolean; + value: any; + translations: { + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; +} +export interface ojRadiosetSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojrefresher/index.d.ts b/types/oraclejet/ojrefresher/index.d.ts new file mode 100644 index 0000000000..a80f9cc805 --- /dev/null +++ b/types/oraclejet/ojrefresher/index.d.ts @@ -0,0 +1,33 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojRefresher extends baseComponent { + refreshContent: (() => Promise); + target: Element; + text: string; + threshold: number; + onRefreshContentChanged: ((event: JetElementCustomEvent) => any) | null; + onTargetChanged: ((event: JetElementCustomEvent) => any) | null; + onTextChanged: ((event: JetElementCustomEvent) => any) | null; + onThresholdChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojRefresherEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojRefresher[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojRefresherSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojRefresherSettablePropertiesLenient): void; +} +export interface ojRefresherEventMap extends baseComponentEventMap { + 'refreshContentChanged': JetElementCustomEvent; + 'targetChanged': JetElementCustomEvent; + 'textChanged': JetElementCustomEvent; + 'thresholdChanged': JetElementCustomEvent; +} +export interface ojRefresherSettableProperties extends baseComponentSettableProperties { + refreshContent: (() => Promise); + target: Element; + text: string; + threshold: number; +} +export interface ojRefresherSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojresponsiveknockoututils/index.d.ts b/types/oraclejet/ojresponsiveknockoututils/index.d.ts new file mode 100644 index 0000000000..6969cc607c --- /dev/null +++ b/types/oraclejet/ojresponsiveknockoututils/index.d.ts @@ -0,0 +1,4 @@ +/// +/// +export function createMediaQueryObservable(queryString: string): KnockoutObservable; +export function createScreenRangeObservable(): KnockoutObservable; diff --git a/types/oraclejet/ojresponsiveutils/index.d.ts b/types/oraclejet/ojresponsiveutils/index.d.ts new file mode 100644 index 0000000000..3fa2d5dab5 --- /dev/null +++ b/types/oraclejet/ojresponsiveutils/index.d.ts @@ -0,0 +1,4 @@ +export function compare(size1: SCREEN_RANGE, size2: SCREEN_RANGE): number; +export function getFrameworkQuery(frameworkQueryKey: FRAMEWORK_QUERY_KEY): string | null; +export type FRAMEWORK_QUERY_KEY = "sm-up" | "md-up" | "lg-up" | "xl-up" | "xxl-up" | "sm-only" | "md-only" | "lg-only" | "xl-only" | "md-down" | "lg-down" | "xl-down" | "high-resolution"; +export type SCREEN_RANGE = "sm" | "md" | "lg" | "xl" | "xxl"; diff --git a/types/oraclejet/ojrouter/index.d.ts b/types/oraclejet/ojrouter/index.d.ts new file mode 100644 index 0000000000..afe93fb476 --- /dev/null +++ b/types/oraclejet/ojrouter/index.d.ts @@ -0,0 +1,131 @@ +/// +/// +declare class Router { + readonly currentState: (() => RouterState | undefined); + readonly currentValue: (() => string | undefined); + defaultStateId: string | undefined; + static defaults: { + urlAdapter?: Router.urlPathAdapter | Router.urlParamAdapter; + baseUrl?: string; + rootInstanceName?: string; + }; + readonly direction: string | undefined; + readonly moduleConfig: { + name: KnockoutObservable; + params: { + ojRouter: { + parentRouter: Router; + direction: string; + }; + }; + lifecycleListener: { + attached: ((param0: string) => void); + }; + }; + readonly name: string; + readonly observableModuleConfig: KnockoutObservable; + readonly parent: Router | undefined; + static readonly rootInstance: Router; + readonly stateId: ((param0?: string) => string); + readonly states: RouterState[] | null; + static readonly transitionedToState: object; + static sync(): Promise<{ + hasChanged: boolean; + }>; + configure(option: { + [key: string]: RouterState.ConfigOptions; + } | ((id: string) => RouterState | undefined | null)): any; + createChildRouter(name: string, parentStateId?: string): Router; + dispose(): undefined; + getChildRouter(name: string): Router | undefined; + getCurrentChildRouter(): Router | undefined; + getState(stateId: string): RouterState | undefined; + go(stateIdPath?: string | string[], options?: { + historyUpdate: string; + }): Promise<{ + hasChanged: boolean; + }>; + retrieve(): any; + store(data: object): undefined; +} +declare namespace Router { + // tslint:disable-next-line interface-over-type-literal + type ModuleConfigType = { + name: KnockoutObservable; + params: { + ojRouter: { + parentRouter: Router; + direction: string; + parameters: object; + }; + }; + lifecycleListener: { + attached: ((param0: object) => void); + }; + }; + // tslint:disable-next-line no-unnecessary-class + class urlParamAdapter { + constructor(); + } + // tslint:disable-next-line no-unnecessary-class + class urlPathAdapter { + constructor(); + } + interface RouterState { + canEnter: (() => boolean) | (() => Promise); + canExit: (() => boolean) | (() => Promise); + enter: (() => void) | (() => Promise); + exit: (() => void) | (() => Promise); + readonly id: string; + label: string | undefined; + parameters: object; + title: string | (() => string | undefined); + value: any; + // constructor(id: string, options?: RouterState.ConfigOptions, router?: Router); + go(): Promise<{ + hasChanged: boolean; + }>; + isCurrent(): boolean; + } + namespace RouterState { + // tslint:disable-next-line interface-over-type-literal + type ConfigOptions = { + label?: string; + value?: any; + isDefault?: boolean; + canEnter?: (() => boolean) | (() => Promise); + enter?: (() => void) | (() => Promise); + canExit?: (() => boolean) | (() => Promise); + exit?: (() => void) | (() => Promise); + }; + } +} +export = Router; +declare class RouterState { + canEnter: (() => boolean) | (() => Promise); + canExit: (() => boolean) | (() => Promise); + enter: (() => void) | (() => Promise); + exit: (() => void) | (() => Promise); + readonly id: string; + label: string | undefined; + parameters: object; + title: string | (() => string | undefined); + value: any; + constructor(id: string, options?: RouterState.ConfigOptions, router?: Router); + go(): Promise<{ + hasChanged: boolean; + }>; + isCurrent(): boolean; +} +declare namespace RouterState { + // tslint:disable-next-line interface-over-type-literal + type ConfigOptions = { + label?: string; + value?: any; + isDefault?: boolean; + canEnter?: (() => boolean) | (() => Promise); + enter?: (() => void) | (() => Promise); + canExit?: (() => boolean) | (() => Promise); + exit?: (() => void) | (() => Promise); + }; +} diff --git a/types/oraclejet/ojselectcombobox/index.d.ts b/types/oraclejet/ojselectcombobox/index.d.ts new file mode 100644 index 0000000000..2444c99c4c --- /dev/null +++ b/types/oraclejet/ojselectcombobox/index.d.ts @@ -0,0 +1,714 @@ +import { Converter, Validator, Validation, AsyncValidator } from '../ojvalidation-base'; +import { DataProvider } from '../ojdataprovider'; +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojCombobox, SV = V, RV = V> extends editableValue { + onOjAnimateEnd: ((event: ojCombobox.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojCombobox.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojComboboxEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojCombobox[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojComboboxSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojComboboxSettablePropertiesLenient): void; + refresh(): void; + validate(): Promise; +} +export namespace ojCombobox { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type Optgroup = { + disabled?: boolean; + label: string; + children: Array<(Option | Optgroup)>; + }; + // tslint:disable-next-line interface-over-type-literal + type Option = { + disabled?: boolean; + label?: string; + value: any; + }; + // tslint:disable-next-line interface-over-type-literal + type OptionContext = { + component: Element; + parent: Element; + index: number; + depth: number; + leaf: boolean; + data: object; + parentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type OptionsKeys = { + label?: string; + value?: string; + children?: string; + childKeys?: OptionsKeys; + }; +} +export interface ojComboboxEventMap, SV = V, RV = V> extends editableValueEventMap { + 'ojAnimateEnd': ojCombobox.ojAnimateEnd; + 'ojAnimateStart': ojCombobox.ojAnimateStart; +} +// These interfaces are empty but required to keep the component chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface ojComboboxSettableProperties extends editableValueSettableProperties { +} +export interface ojComboboxSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojComboboxMany extends ojCombobox, any[] | null, string> { + asyncValidators: Array>; + converter: Converter | Validation.RegisteredConverter | null; + minLength: number; + optionRenderer?: ((param0: ojCombobox.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys: { + label?: string; + value?: string; + children?: string; + childKeys?: ojCombobox.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + readonly rawValue: string | null; + required: boolean; + validators: Array | Validation.RegisteredValidator> | null; + value: any[] | null; + valueOptions: Array<{ + value: any; + label?: string; + }> | null; + translations: { + filterFurther?: string; + noMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; + onAsyncValidatorsChanged: ((event: JetElementCustomEvent["asyncValidators"]>) => any) | null; + onConverterChanged: ((event: JetElementCustomEvent["converter"]>) => any) | null; + onMinLengthChanged: ((event: JetElementCustomEvent["minLength"]>) => any) | null; + onOptionRendererChanged: ((event: JetElementCustomEvent["optionRenderer"]>) => any) | null; + onOptionsChanged: ((event: JetElementCustomEvent["options"]>) => any) | null; + onOptionsKeysChanged: ((event: JetElementCustomEvent["optionsKeys"]>) => any) | null; + onPickerAttributesChanged: ((event: JetElementCustomEvent["pickerAttributes"]>) => any) | null; + onPlaceholderChanged: ((event: JetElementCustomEvent["placeholder"]>) => any) | null; + onRawValueChanged: ((event: JetElementCustomEvent["rawValue"]>) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent["required"]>) => any) | null; + onValidatorsChanged: ((event: JetElementCustomEvent["validators"]>) => any) | null; + onValueChanged: ((event: JetElementCustomEvent["value"]>) => any) | null; + onValueOptionsChanged: ((event: JetElementCustomEvent["valueOptions"]>) => any) | null; + onOjAnimateEnd: ((event: ojComboboxMany.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojComboboxMany.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojComboboxManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojComboboxMany[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojComboboxManySettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojComboboxManySettablePropertiesLenient): void; +} +export namespace ojComboboxMany { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojComboboxManyEventMap extends ojComboboxEventMap, any[] | null, string> { + 'ojAnimateEnd': ojComboboxMany.ojAnimateEnd; + 'ojAnimateStart': ojComboboxMany.ojAnimateStart; + 'asyncValidatorsChanged': JetElementCustomEvent["asyncValidators"]>; + 'converterChanged': JetElementCustomEvent["converter"]>; + 'minLengthChanged': JetElementCustomEvent["minLength"]>; + 'optionRendererChanged': JetElementCustomEvent["optionRenderer"]>; + 'optionsChanged': JetElementCustomEvent["options"]>; + 'optionsKeysChanged': JetElementCustomEvent["optionsKeys"]>; + 'pickerAttributesChanged': JetElementCustomEvent["pickerAttributes"]>; + 'placeholderChanged': JetElementCustomEvent["placeholder"]>; + 'rawValueChanged': JetElementCustomEvent["rawValue"]>; + 'requiredChanged': JetElementCustomEvent["required"]>; + 'validatorsChanged': JetElementCustomEvent["validators"]>; + 'valueChanged': JetElementCustomEvent["value"]>; + 'valueOptionsChanged': JetElementCustomEvent["valueOptions"]>; +} +export interface ojComboboxManySettableProperties extends ojComboboxSettableProperties { + asyncValidators: Array>; + converter: Converter | Validation.RegisteredConverter | null; + minLength: number; + optionRenderer?: ((param0: ojCombobox.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys: { + label?: string; + value?: string; + children?: string; + childKeys?: ojCombobox.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + readonly rawValue: string | null; + required: boolean; + validators: Array | Validation.RegisteredValidator> | null; + value: any[] | null; + valueOptions: Array<{ + value: any; + label?: string; + }> | null; + translations: { + filterFurther?: string; + noMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; +} +export interface ojComboboxManySettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojComboboxOne extends ojCombobox, any, string> { + asyncValidators: Array>; + converter: Converter | Validation.RegisteredConverter | null; + filterOnOpen: 'none' | 'rawValue'; + minLength: number; + optionRenderer?: ((param0: ojCombobox.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys: { + label?: string; + value?: string; + children?: string; + childKeys?: ojCombobox.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + readonly rawValue: string | null; + required: boolean; + validators: Array | Validation.RegisteredValidator> | null; + value: any; + valueOption: { + value: any; + label?: string; + }; + translations: { + filterFurther?: string; + noMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; + onAsyncValidatorsChanged: ((event: JetElementCustomEvent["asyncValidators"]>) => any) | null; + onConverterChanged: ((event: JetElementCustomEvent["converter"]>) => any) | null; + onFilterOnOpenChanged: ((event: JetElementCustomEvent["filterOnOpen"]>) => any) | null; + onMinLengthChanged: ((event: JetElementCustomEvent["minLength"]>) => any) | null; + onOptionRendererChanged: ((event: JetElementCustomEvent["optionRenderer"]>) => any) | null; + onOptionsChanged: ((event: JetElementCustomEvent["options"]>) => any) | null; + onOptionsKeysChanged: ((event: JetElementCustomEvent["optionsKeys"]>) => any) | null; + onPickerAttributesChanged: ((event: JetElementCustomEvent["pickerAttributes"]>) => any) | null; + onPlaceholderChanged: ((event: JetElementCustomEvent["placeholder"]>) => any) | null; + onRawValueChanged: ((event: JetElementCustomEvent["rawValue"]>) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent["required"]>) => any) | null; + onValidatorsChanged: ((event: JetElementCustomEvent["validators"]>) => any) | null; + onValueChanged: ((event: JetElementCustomEvent["value"]>) => any) | null; + onValueOptionChanged: ((event: JetElementCustomEvent["valueOption"]>) => any) | null; + onOjAnimateEnd: ((event: ojComboboxOne.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojComboboxOne.ojAnimateStart) => any) | null; + onOjValueUpdated: ((event: ojComboboxOne.ojValueUpdated) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojComboboxOneEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojComboboxOne[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojComboboxOneSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojComboboxOneSettablePropertiesLenient): void; +} +export namespace ojComboboxOne { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojValueUpdated extends CustomEvent<{ + value: any; + previousValue: any; + [propName: string]: any; + }> { + } +} +export interface ojComboboxOneEventMap extends ojComboboxEventMap, any, string> { + 'ojAnimateEnd': ojComboboxOne.ojAnimateEnd; + 'ojAnimateStart': ojComboboxOne.ojAnimateStart; + 'ojValueUpdated': ojComboboxOne.ojValueUpdated; + 'asyncValidatorsChanged': JetElementCustomEvent["asyncValidators"]>; + 'converterChanged': JetElementCustomEvent["converter"]>; + 'filterOnOpenChanged': JetElementCustomEvent["filterOnOpen"]>; + 'minLengthChanged': JetElementCustomEvent["minLength"]>; + 'optionRendererChanged': JetElementCustomEvent["optionRenderer"]>; + 'optionsChanged': JetElementCustomEvent["options"]>; + 'optionsKeysChanged': JetElementCustomEvent["optionsKeys"]>; + 'pickerAttributesChanged': JetElementCustomEvent["pickerAttributes"]>; + 'placeholderChanged': JetElementCustomEvent["placeholder"]>; + 'rawValueChanged': JetElementCustomEvent["rawValue"]>; + 'requiredChanged': JetElementCustomEvent["required"]>; + 'validatorsChanged': JetElementCustomEvent["validators"]>; + 'valueChanged': JetElementCustomEvent["value"]>; + 'valueOptionChanged': JetElementCustomEvent["valueOption"]>; +} +export interface ojComboboxOneSettableProperties extends ojComboboxSettableProperties { + asyncValidators: Array>; + converter: Converter | Validation.RegisteredConverter | null; + filterOnOpen: 'none' | 'rawValue'; + minLength: number; + optionRenderer?: ((param0: ojCombobox.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys: { + label?: string; + value?: string; + children?: string; + childKeys?: ojCombobox.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + readonly rawValue: string | null; + required: boolean; + validators: Array | Validation.RegisteredValidator> | null; + value: any; + valueOption: { + value: any; + label?: string; + }; + translations: { + filterFurther?: string; + noMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + }; +} +export interface ojComboboxOneSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojSelect, SV = V> extends editableValue { + onOjAnimateEnd: ((event: ojSelect.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojSelect.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojSelectEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojSelect[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojSelectSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojSelectSettablePropertiesLenient): void; + refresh(): void; + validate(): Promise; +} +export namespace ojSelect { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type Optgroup = { + disabled?: boolean; + label: string; + children: Array<(Option | Optgroup)>; + }; + // tslint:disable-next-line interface-over-type-literal + type Option = { + disabled?: boolean; + label?: string; + value: any; + }; + // tslint:disable-next-line interface-over-type-literal + type OptionContext = { + component: Element; + parent: Element; + index: number; + depth: number; + leaf: boolean; + data: object; + parentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type OptionsKeys = { + label?: string; + value?: string; + children?: string; + childKeys?: OptionsKeys; + }; +} +export interface ojSelectEventMap, SV = V> extends editableValueEventMap { + 'ojAnimateEnd': ojSelect.ojAnimateEnd; + 'ojAnimateStart': ojSelect.ojAnimateStart; +} +// These interfaces are empty but required to keep the component chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface ojSelectSettableProperties extends editableValueSettableProperties { +} +export interface ojSelectSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojSelectMany extends ojSelect> { + minimumResultsForSearch: number; + optionRenderer?: ((param0: ojSelect.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys?: { + label?: string; + value?: string; + children?: string; + childKeys?: ojSelect.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + renderMode: 'jet' | 'native'; + required: boolean; + value: any[] | null; + valueOptions: Array<{ + value: any; + label?: string; + }> | null; + translations: { + filterFurther?: string; + moreMatchesFound?: string; + noMatchesFound?: string; + oneMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + searchField?: string; + }; + onMinimumResultsForSearchChanged: ((event: JetElementCustomEvent["minimumResultsForSearch"]>) => any) | null; + onOptionRendererChanged: ((event: JetElementCustomEvent["optionRenderer"]>) => any) | null; + onOptionsChanged: ((event: JetElementCustomEvent["options"]>) => any) | null; + onOptionsKeysChanged: ((event: JetElementCustomEvent["optionsKeys"]>) => any) | null; + onPickerAttributesChanged: ((event: JetElementCustomEvent["pickerAttributes"]>) => any) | null; + onPlaceholderChanged: ((event: JetElementCustomEvent["placeholder"]>) => any) | null; + onRenderModeChanged: ((event: JetElementCustomEvent["renderMode"]>) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent["required"]>) => any) | null; + onValueChanged: ((event: JetElementCustomEvent["value"]>) => any) | null; + onValueOptionsChanged: ((event: JetElementCustomEvent["valueOptions"]>) => any) | null; + onOjAnimateEnd: ((event: ojSelectMany.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojSelectMany.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojSelectManyEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojSelectMany[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojSelectManySettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojSelectManySettablePropertiesLenient): void; +} +export namespace ojSelectMany { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojSelectManyEventMap extends ojSelectEventMap> { + 'ojAnimateEnd': ojSelectMany.ojAnimateEnd; + 'ojAnimateStart': ojSelectMany.ojAnimateStart; + 'minimumResultsForSearchChanged': JetElementCustomEvent["minimumResultsForSearch"]>; + 'optionRendererChanged': JetElementCustomEvent["optionRenderer"]>; + 'optionsChanged': JetElementCustomEvent["options"]>; + 'optionsKeysChanged': JetElementCustomEvent["optionsKeys"]>; + 'pickerAttributesChanged': JetElementCustomEvent["pickerAttributes"]>; + 'placeholderChanged': JetElementCustomEvent["placeholder"]>; + 'renderModeChanged': JetElementCustomEvent["renderMode"]>; + 'requiredChanged': JetElementCustomEvent["required"]>; + 'valueChanged': JetElementCustomEvent["value"]>; + 'valueOptionsChanged': JetElementCustomEvent["valueOptions"]>; +} +export interface ojSelectManySettableProperties extends ojSelectSettableProperties { + minimumResultsForSearch: number; + optionRenderer?: ((param0: ojSelect.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys?: { + label?: string; + value?: string; + children?: string; + childKeys?: ojSelect.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + renderMode: 'jet' | 'native'; + required: boolean; + value: any[] | null; + valueOptions: Array<{ + value: any; + label?: string; + }> | null; + translations: { + filterFurther?: string; + moreMatchesFound?: string; + noMatchesFound?: string; + oneMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + searchField?: string; + }; +} +export interface ojSelectManySettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojSelectOne extends ojSelect> { + minimumResultsForSearch: number; + optionRenderer?: ((param0: ojSelect.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys?: { + label?: string; + value?: string; + children?: string; + childKeys?: ojSelect.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + renderMode: 'jet' | 'native'; + required: boolean; + value: any; + valueOption: { + value: any; + label?: string; + }; + translations: { + filterFurther?: string; + moreMatchesFound?: string; + noMatchesFound?: string; + oneMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + searchField?: string; + }; + onMinimumResultsForSearchChanged: ((event: JetElementCustomEvent["minimumResultsForSearch"]>) => any) | null; + onOptionRendererChanged: ((event: JetElementCustomEvent["optionRenderer"]>) => any) | null; + onOptionsChanged: ((event: JetElementCustomEvent["options"]>) => any) | null; + onOptionsKeysChanged: ((event: JetElementCustomEvent["optionsKeys"]>) => any) | null; + onPickerAttributesChanged: ((event: JetElementCustomEvent["pickerAttributes"]>) => any) | null; + onPlaceholderChanged: ((event: JetElementCustomEvent["placeholder"]>) => any) | null; + onRenderModeChanged: ((event: JetElementCustomEvent["renderMode"]>) => any) | null; + onRequiredChanged: ((event: JetElementCustomEvent["required"]>) => any) | null; + onValueChanged: ((event: JetElementCustomEvent["value"]>) => any) | null; + onValueOptionChanged: ((event: JetElementCustomEvent["valueOption"]>) => any) | null; + onOjAnimateEnd: ((event: ojSelectOne.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojSelectOne.ojAnimateStart) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojSelectOneEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojSelectOne[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojSelectOneSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojSelectOneSettablePropertiesLenient): void; +} +export namespace ojSelectOne { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojSelectOneEventMap extends ojSelectEventMap> { + 'ojAnimateEnd': ojSelectOne.ojAnimateEnd; + 'ojAnimateStart': ojSelectOne.ojAnimateStart; + 'minimumResultsForSearchChanged': JetElementCustomEvent["minimumResultsForSearch"]>; + 'optionRendererChanged': JetElementCustomEvent["optionRenderer"]>; + 'optionsChanged': JetElementCustomEvent["options"]>; + 'optionsKeysChanged': JetElementCustomEvent["optionsKeys"]>; + 'pickerAttributesChanged': JetElementCustomEvent["pickerAttributes"]>; + 'placeholderChanged': JetElementCustomEvent["placeholder"]>; + 'renderModeChanged': JetElementCustomEvent["renderMode"]>; + 'requiredChanged': JetElementCustomEvent["required"]>; + 'valueChanged': JetElementCustomEvent["value"]>; + 'valueOptionChanged': JetElementCustomEvent["valueOption"]>; +} +export interface ojSelectOneSettableProperties extends ojSelectSettableProperties { + minimumResultsForSearch: number; + optionRenderer?: ((param0: ojSelect.OptionContext) => { + insert: Element; + } | undefined) | null; + options: Array | DataProvider | null; + optionsKeys: { + childKeys?: { + label?: string; + value?: string; + children?: string; + childKeys?: ojSelect.OptionsKeys; + }; + children?: string; + label?: string; + value?: string; + }; + pickerAttributes: { + style?: string; + class?: string; + }; + placeholder: string | null; + renderMode: 'jet' | 'native'; + required: boolean; + value: any; + valueOption: { + value: any; + label?: string; + }; + translations: { + filterFurther?: string; + moreMatchesFound?: string; + noMatchesFound?: string; + oneMatchesFound?: string; + required?: { + hint?: string; + messageDetail?: string; + messageSummary?: string; + }; + searchField?: string; + }; +} +export interface ojSelectOneSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface Optgroup { + children: Array<(Option | Optgroup)>; + disabled?: boolean; + label: string; +} +export interface Option { + disabled?: boolean; + label?: string; + value: object; +} diff --git a/types/oraclejet/ojslider/index.d.ts b/types/oraclejet/ojslider/index.d.ts new file mode 100644 index 0000000000..37d98b11f4 --- /dev/null +++ b/types/oraclejet/ojslider/index.d.ts @@ -0,0 +1,83 @@ +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojSlider extends editableValue { + disabled: boolean; + max: number | null; + min: number | null; + orientation: 'horizontal' | 'vertical'; + step: number | null; + readonly transientValue: number; + type: 'fromMin' | 'fromMax' | 'single'; + value: number | null; + translations: { + invalidStep?: string; + maxMin?: string; + noValue?: string; + optionNum?: string; + valueRange?: string; + }; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onMaxChanged: ((event: JetElementCustomEvent) => any) | null; + onMinChanged: ((event: JetElementCustomEvent) => any) | null; + onOrientationChanged: ((event: JetElementCustomEvent) => any) | null; + onStepChanged: ((event: JetElementCustomEvent) => any) | null; + onTransientValueChanged: ((event: JetElementCustomEvent) => any) | null; + onTypeChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojSlider.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojSlider.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSliderEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojSlider[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojSliderSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojSliderSettablePropertiesLenient): void; +} +export namespace ojSlider { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojSliderEventMap extends editableValueEventMap { + 'ojAnimateEnd': ojSlider.ojAnimateEnd; + 'ojAnimateStart': ojSlider.ojAnimateStart; + 'disabledChanged': JetElementCustomEvent; + 'maxChanged': JetElementCustomEvent; + 'minChanged': JetElementCustomEvent; + 'orientationChanged': JetElementCustomEvent; + 'stepChanged': JetElementCustomEvent; + 'transientValueChanged': JetElementCustomEvent; + 'typeChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojSliderSettableProperties extends editableValueSettableProperties { + disabled: boolean; + max: number | null; + min: number | null; + orientation: 'horizontal' | 'vertical'; + step: number | null; + readonly transientValue: number; + type: 'fromMin' | 'fromMax' | 'single'; + value: number | null; + translations: { + invalidStep?: string; + maxMin?: string; + noValue?: string; + optionNum?: string; + valueRange?: string; + }; +} +export interface ojSliderSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojsunburst/index.d.ts b/types/oraclejet/ojsunburst/index.d.ts new file mode 100644 index 0000000000..ebe8b4968e --- /dev/null +++ b/types/oraclejet/ojsunburst/index.d.ts @@ -0,0 +1,407 @@ +import { KeySet } from '../ojkeyset'; +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojSunburst extends dvtBaseComponent> { + animationDuration: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: DataProvider | null; + displayLevels: number; + drilling: 'on' | 'off'; + expanded: KeySet; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + nodeDefaults: { + borderColor: string; + borderWidth: number; + hoverColor: string; + labelDisplay: 'horizontal' | 'rotated' | 'off' | 'auto'; + labelHalign: 'inner' | 'outer' | 'center'; + labelMinLength: number; + labelStyle: object; + selectedInnerColor: string; + selectedOuterColor: string; + showDisclosure: 'on' | 'off'; + }; + rootNode: any; + rootNodeContent: { + renderer: ((context: ojSunburst.RootNodeContext) => ({ + insert: Element | string; + })); + }; + rotation: 'off' | 'on'; + selection: any[]; + selectionMode: 'none' | 'single' | 'multiple'; + sizeLabel: string; + sorting: 'on' | 'off'; + startAngle: number; + tooltip: { + renderer: ((context: ojSunburst.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelColor?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + labelSize?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + tooltipCollapse?: string; + tooltipExpand?: string; + }; + onAnimationDurationChanged: ((event: JetElementCustomEvent["animationDuration"]>) => any) | null; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAnimationUpdateColorChanged: ((event: JetElementCustomEvent["animationUpdateColor"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onColorLabelChanged: ((event: JetElementCustomEvent["colorLabel"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDisplayLevelsChanged: ((event: JetElementCustomEvent["displayLevels"]>) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent["drilling"]>) => any) | null; + onExpandedChanged: ((event: JetElementCustomEvent["expanded"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onHoverBehaviorDelayChanged: ((event: JetElementCustomEvent["hoverBehaviorDelay"]>) => any) | null; + onNodeDefaultsChanged: ((event: JetElementCustomEvent["nodeDefaults"]>) => any) | null; + onRootNodeChanged: ((event: JetElementCustomEvent["rootNode"]>) => any) | null; + onRootNodeContentChanged: ((event: JetElementCustomEvent["rootNodeContent"]>) => any) | null; + onRotationChanged: ((event: JetElementCustomEvent["rotation"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onSizeLabelChanged: ((event: JetElementCustomEvent["sizeLabel"]>) => any) | null; + onSortingChanged: ((event: JetElementCustomEvent["sorting"]>) => any) | null; + onStartAngleChanged: ((event: JetElementCustomEvent["startAngle"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTouchResponseChanged: ((event: JetElementCustomEvent["touchResponse"]>) => any) | null; + onOjBeforeCollapse: ((event: ojSunburst.ojBeforeCollapse) => any) | null; + onOjBeforeDrill: ((event: ojSunburst.ojBeforeDrill) => any) | null; + onOjBeforeExpand: ((event: ojSunburst.ojBeforeExpand) => any) | null; + onOjCollapse: ((event: ojSunburst.ojCollapse) => any) | null; + onOjDrill: ((event: ojSunburst.ojDrill) => any) | null; + onOjExpand: ((event: ojSunburst.ojExpand) => any) | null; + onOjRotateInput: ((event: ojSunburst.ojRotateInput) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojSunburstEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojSunburst[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojSunburstSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojSunburstSettablePropertiesLenient): void; + getContextByNode(node: Element): ojSunburst.NodeContext | null; + getNode(subIdPath: any[]): ojSunburst.DataContext | null; +} +export namespace ojSunburst { + interface ojBeforeCollapse extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + interface ojBeforeDrill extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + interface ojBeforeExpand extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + interface ojCollapse extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + interface ojDrill extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + interface ojExpand extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + interface ojRotateInput extends CustomEvent<{ + value: number; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type DataContext = { + color: string; + label: string; + selected: boolean; + size: number; + tooltip: string; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + subId: string; + indexPath: number[]; + }; + // tslint:disable-next-line interface-over-type-literal + type RootNodeContext = { + outerBounds: { + x: number; + y: number; + width: number; + height: number; + }; + innerBounds: { + x: number; + y: number; + width: number; + height: number; + }; + id: K; + data: object; + itemData: D; + componentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + parentElement: Element; + id: K; + label: string; + value: number; + radius: number; + color: string; + data: object; + itemData: D; + componentElement: Element; + }; +} +export interface ojSunburstEventMap extends dvtBaseComponentEventMap> { + 'ojBeforeCollapse': ojSunburst.ojBeforeCollapse; + 'ojBeforeDrill': ojSunburst.ojBeforeDrill; + 'ojBeforeExpand': ojSunburst.ojBeforeExpand; + 'ojCollapse': ojSunburst.ojCollapse; + 'ojDrill': ojSunburst.ojDrill; + 'ojExpand': ojSunburst.ojExpand; + 'ojRotateInput': ojSunburst.ojRotateInput; + 'animationDurationChanged': JetElementCustomEvent["animationDuration"]>; + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'animationUpdateColorChanged': JetElementCustomEvent["animationUpdateColor"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'colorLabelChanged': JetElementCustomEvent["colorLabel"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'displayLevelsChanged': JetElementCustomEvent["displayLevels"]>; + 'drillingChanged': JetElementCustomEvent["drilling"]>; + 'expandedChanged': JetElementCustomEvent["expanded"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'hoverBehaviorDelayChanged': JetElementCustomEvent["hoverBehaviorDelay"]>; + 'nodeDefaultsChanged': JetElementCustomEvent["nodeDefaults"]>; + 'rootNodeChanged': JetElementCustomEvent["rootNode"]>; + 'rootNodeContentChanged': JetElementCustomEvent["rootNodeContent"]>; + 'rotationChanged': JetElementCustomEvent["rotation"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'sizeLabelChanged': JetElementCustomEvent["sizeLabel"]>; + 'sortingChanged': JetElementCustomEvent["sorting"]>; + 'startAngleChanged': JetElementCustomEvent["startAngle"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'touchResponseChanged': JetElementCustomEvent["touchResponse"]>; +} +export interface ojSunburstSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: DataProvider | null; + displayLevels: number; + drilling: 'on' | 'off'; + expanded: KeySet; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + nodeDefaults: { + borderColor: string; + borderWidth: number; + hoverColor: string; + labelDisplay: 'horizontal' | 'rotated' | 'off' | 'auto'; + labelHalign: 'inner' | 'outer' | 'center'; + labelMinLength: number; + labelStyle: object; + selectedInnerColor: string; + selectedOuterColor: string; + showDisclosure: 'on' | 'off'; + }; + rootNode: any; + rootNodeContent: { + renderer: ((context: ojSunburst.RootNodeContext) => ({ + insert: Element | string; + })); + }; + rotation: 'off' | 'on'; + selection: any[]; + selectionMode: 'none' | 'single' | 'multiple'; + sizeLabel: string; + sorting: 'on' | 'off'; + startAngle: number; + tooltip: { + renderer: ((context: ojSunburst.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelColor?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + labelSize?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + tooltipCollapse?: string; + tooltipExpand?: string; + }; +} +export interface ojSunburstSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojSunburstNode extends JetElement { + borderColor?: string; + borderWidth?: number; + categories?: string[]; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + label?: string; + labelDisplay?: 'horizontal' | 'rotated' | 'off' | 'auto'; + labelHalign?: 'inner' | 'outer' | 'center'; + labelStyle?: object; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + radius?: number; + selectable?: 'off' | 'auto'; + shortDesc?: string; + showDisclosure?: 'on' | 'off' | 'inherit'; + svgClassName?: string; + svgStyle?: object; + value: number; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelHalignChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onPatternChanged: ((event: JetElementCustomEvent) => any) | null; + onRadiusChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectableChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onShowDisclosureChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSunburstNodeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojSunburstNode[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojSunburstNodeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojSunburstNodeSettablePropertiesLenient): void; +} +export interface ojSunburstNodeEventMap extends HTMLElementEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'borderWidthChanged': JetElementCustomEvent; + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'drillingChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelDisplayChanged': JetElementCustomEvent; + 'labelHalignChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'patternChanged': JetElementCustomEvent; + 'radiusChanged': JetElementCustomEvent; + 'selectableChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'showDisclosureChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojSunburstNodeSettableProperties extends JetSettableProperties { + borderColor?: string; + borderWidth?: number; + categories?: string[]; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + label?: string; + labelDisplay?: 'horizontal' | 'rotated' | 'off' | 'auto'; + labelHalign?: 'inner' | 'outer' | 'center'; + labelStyle?: object; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + radius?: number; + selectable?: 'off' | 'auto'; + shortDesc?: string; + showDisclosure?: 'on' | 'off' | 'inherit'; + svgClassName?: string; + svgStyle?: object; + value: number; +} +export interface ojSunburstNodeSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojswipeactions/index.d.ts b/types/oraclejet/ojswipeactions/index.d.ts new file mode 100644 index 0000000000..cb309b2668 --- /dev/null +++ b/types/oraclejet/ojswipeactions/index.d.ts @@ -0,0 +1,36 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojSwipeActions extends baseComponent { + translations: { + ariaHideActionsDescription?: string; + ariaShowEndActionsDescription?: string; + ariaShowStartActionsDescription?: string; + }; + onOjAction: ((event: ojSwipeActions.ojAction) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwipeActionsEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojSwipeActions[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojSwipeActionsSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojSwipeActionsSettablePropertiesLenient): void; + refresh(): void; +} +export namespace ojSwipeActions { + interface ojAction extends CustomEvent<{ + [propName: string]: any; + }> { + } +} +export interface ojSwipeActionsEventMap extends baseComponentEventMap { + 'ojAction': ojSwipeActions.ojAction; +} +export interface ojSwipeActionsSettableProperties extends baseComponentSettableProperties { + translations: { + ariaHideActionsDescription?: string; + ariaShowEndActionsDescription?: string; + ariaShowStartActionsDescription?: string; + }; +} +export interface ojSwipeActionsSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojswipetoreveal/index.d.ts b/types/oraclejet/ojswipetoreveal/index.d.ts new file mode 100644 index 0000000000..ec2587ee47 --- /dev/null +++ b/types/oraclejet/ojswipetoreveal/index.d.ts @@ -0,0 +1,4 @@ +export function setupSwipeActions(elem: Element, options?: { + threshold?: number; +}): void; +export function tearDownSwipeActions(elem: Element): void; diff --git a/types/oraclejet/ojswitch/index.d.ts b/types/oraclejet/ojswitch/index.d.ts new file mode 100644 index 0000000000..775bb8a1f9 --- /dev/null +++ b/types/oraclejet/ojswitch/index.d.ts @@ -0,0 +1,49 @@ +import { editableValue, editableValueEventMap, editableValueSettableProperties } from '../ojeditablevalue'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojSwitch extends editableValue { + disabled: boolean; + readonly: boolean; + value: boolean; + onDisabledChanged: ((event: JetElementCustomEvent) => any) | null; + onReadonlyChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onOjAnimateEnd: ((event: ojSwitch.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojSwitch.ojAnimateStart) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwitchEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojSwitch[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojSwitchSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojSwitchSettablePropertiesLenient): void; +} +export namespace ojSwitch { + interface ojAnimateEnd extends CustomEvent<{ + action: string; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: string; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } +} +export interface ojSwitchEventMap extends editableValueEventMap { + 'ojAnimateEnd': ojSwitch.ojAnimateEnd; + 'ojAnimateStart': ojSwitch.ojAnimateStart; + 'disabledChanged': JetElementCustomEvent; + 'readonlyChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojSwitchSettableProperties extends editableValueSettableProperties { + disabled: boolean; + readonly: boolean; + value: boolean; +} +export interface ojSwitchSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojswitcher/index.d.ts b/types/oraclejet/ojswitcher/index.d.ts new file mode 100644 index 0000000000..7d4ffc5bcd --- /dev/null +++ b/types/oraclejet/ojswitcher/index.d.ts @@ -0,0 +1,22 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojSwitcher extends JetElement { + value: string; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojSwitcherEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojSwitcher[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojSwitcherSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojSwitcherSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojSwitcherEventMap extends HTMLElementEventMap { + 'valueChanged': JetElementCustomEvent; +} +export interface ojSwitcherSettableProperties extends JetSettableProperties { + value: string; +} +export interface ojSwitcherSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojtable/index.d.ts b/types/oraclejet/ojtable/index.d.ts new file mode 100644 index 0000000000..4282815f2e --- /dev/null +++ b/types/oraclejet/ojtable/index.d.ts @@ -0,0 +1,595 @@ +import { DataProvider } from '../ojdataprovider'; +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojTable extends baseComponent> { + accessibility: { + rowHeader: string; + }; + as: string; + columns: Array<{ + className?: string | null; + field?: string | null; + footerClassName?: string | null; + footerRenderer?: ((context: ojTable.FooterRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + footerStyle?: string | null; + footerTemplate?: { + componentElement: Element; + }; + headerClassName?: string | null; + headerRenderer?: ((context: ojTable.HeaderRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + headerStyle?: string | null; + headerTemplate?: { + componentElement: Element; + data: object; + }; + headerText?: string | null; + id?: string | null; + renderer?: ((context: ojTable.ColumnsRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + resizable?: 'enabled' | 'disabled'; + sortProperty?: string | null; + sortable?: 'auto' | 'enabled' | 'disabled'; + style?: string | null; + template?: { + componentElement: Element; + data: object; + row: object; + index: number; + columnIndex: number; + key: any; + mode: string; + }; + width?: number | null; + }> | null; + columnsDefault: { + className?: string | null; + field?: string | null; + footerClassName?: string | null; + footerRenderer?: ((context: ojTable.FooterRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + footerStyle?: string | null; + footerTemplate?: { + componentElement: Element; + }; + headerClassName?: string | null; + headerRenderer?: ((context: ojTable.HeaderRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + headerStyle?: string | null; + headerTemplate?: { + componentElement: Element; + data: object; + }; + headerText?: string | null; + renderer?: ((context: ojTable.ColumnsRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + resizable?: 'enabled' | 'disabled'; + sortProperty?: string | null; + sortable?: 'auto' | 'enabled' | 'disabled'; + style?: string | null; + template?: { + componentElement: Element; + data: object; + row: object; + index: number; + columnIndex: number; + key: any; + mode: string; + }; + width?: number | null; + }; + currentRow: ojTable.CurrentRow | null; + data: DataProvider | null; + display: 'list' | 'grid'; + dnd: { + drag: { + rows: { + dataTypes?: string | string[]; + dragStart?: ((param0: DragEvent, param1: ojTable.DragRowContext) => void); + drag?: ((param0: DragEvent) => void); + dragEnd?: ((param0: DragEvent) => void); + }; + }; + drop: { + columns: { + dataTypes: string | string[]; + dragEnter?: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + dragOver?: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + dragLeave?: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + drop: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + }; + rows: { + dataTypes: string | string[]; + dragEnter?: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + dragOver?: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + dragLeave?: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + drop: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + }; + }; + reorder: { + columns: 'enabled' | 'disabled'; + }; + }; + editMode: 'none' | 'rowEdit'; + readonly firstSelectedRow: object; + horizontalGridVisible: 'auto' | 'enabled' | 'disabled'; + rowRenderer: ((context: ojTable.RowRendererContext) => string | HTMLElement | void) | null; + scrollPolicy: 'auto' | 'loadMoreOnScroll'; + scrollPolicyOptions: { + fetchSize: number; + maxCount: number; + }; + scrollPosition: { + x?: number; + y?: number; + columnIndex?: number; + rowIndex?: number; + columnKey?: any; + rowKey?: any; + offsetX?: number; + offsetY?: number; + }; + selection: Array & ojTable.RowSelectionEnd> | Array & ojTable.ColumnSelectionEnd>; + selectionMode: { + column: 'single' | 'multiple'; + row: 'single' | 'multiple'; + }; + selectionRequired: boolean; + verticalGridVisible: 'auto' | 'enabled' | 'disabled'; + translations: { + labelAccSelectionAffordanceBottom?: string; + labelAccSelectionAffordanceTop?: string; + labelDisableNonContiguousSelection?: string; + labelEditRow?: string; + labelEnableNonContiguousSelection?: string; + labelResize?: string; + labelResizePopupSpinner?: string; + labelResizePopupSubmit?: string; + labelSelectAndEditRow?: string; + labelSelectColum?: string; + labelSelectRow?: string; + labelSort?: string; + labelSortAsc?: string; + labelSortDsc?: string; + msgColumnResizeWidthValidation?: string; + msgFetchingData?: string; + msgInitializing?: string; + msgNoData?: string; + msgScrollPolicyMaxCountDetail?: string; + msgScrollPolicyMaxCountSummary?: string; + msgStatusSortAscending?: string; + msgStatusSortDescending?: string; + }; + onAccessibilityChanged: ((event: JetElementCustomEvent["accessibility"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onColumnsChanged: ((event: JetElementCustomEvent["columns"]>) => any) | null; + onColumnsDefaultChanged: ((event: JetElementCustomEvent["columnsDefault"]>) => any) | null; + onCurrentRowChanged: ((event: JetElementCustomEvent["currentRow"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDisplayChanged: ((event: JetElementCustomEvent["display"]>) => any) | null; + onDndChanged: ((event: JetElementCustomEvent["dnd"]>) => any) | null; + onEditModeChanged: ((event: JetElementCustomEvent["editMode"]>) => any) | null; + onFirstSelectedRowChanged: ((event: JetElementCustomEvent["firstSelectedRow"]>) => any) | null; + onHorizontalGridVisibleChanged: ((event: JetElementCustomEvent["horizontalGridVisible"]>) => any) | null; + onRowRendererChanged: ((event: JetElementCustomEvent["rowRenderer"]>) => any) | null; + onScrollPolicyChanged: ((event: JetElementCustomEvent["scrollPolicy"]>) => any) | null; + onScrollPolicyOptionsChanged: ((event: JetElementCustomEvent["scrollPolicyOptions"]>) => any) | null; + onScrollPositionChanged: ((event: JetElementCustomEvent["scrollPosition"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onSelectionRequiredChanged: ((event: JetElementCustomEvent["selectionRequired"]>) => any) | null; + onVerticalGridVisibleChanged: ((event: JetElementCustomEvent["verticalGridVisible"]>) => any) | null; + onOjAnimateEnd: ((event: ojTable.ojAnimateEnd) => any) | null; + onOjAnimateStart: ((event: ojTable.ojAnimateStart) => any) | null; + onOjBeforeCurrentRow: ((event: ojTable.ojBeforeCurrentRow) => any) | null; + onOjBeforeRowEdit: ((event: ojTable.ojBeforeRowEdit) => any) | null; + onOjBeforeRowEditEnd: ((event: ojTable.ojBeforeRowEditEnd) => any) | null; + onOjSort: ((event: ojTable.ojSort) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojTableEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojTable[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojTableSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojTableSettablePropertiesLenient): void; + getContextByNode(node: Element): { + subId: 'oj-table-cell'; + rowIndex: number; + columnIndex: number; + key: string; + } | { + subId: 'oj-table-footer' | 'oj-table-header'; + index: number; + }; + getDataForVisibleRow(rowIndex: number): { + data: D; + index: number; + key: K; + } | null; + refresh(): void; + refreshRow(rowIdx: number): Promise; +} +export namespace ojTable { + interface ojAnimateEnd extends CustomEvent<{ + action: 'add' | 'remove' | 'update'; + element: Element; + [propName: string]: any; + }> { + } + interface ojAnimateStart extends CustomEvent<{ + action: 'add' | 'remove' | 'update'; + element: Element; + endCallback: (() => void); + [propName: string]: any; + }> { + } + interface ojBeforeCurrentRow extends CustomEvent<{ + currentRow: CurrentRow; + previousCurrentRow: CurrentRow; + [propName: string]: any; + }> { + } + interface ojBeforeRowEdit extends CustomEvent<{ + rowContext: object; + [propName: string]: any; + }> { + } + interface ojBeforeRowEditEnd extends CustomEvent<{ + rowContext: object; + cancelEdit: object; + [propName: string]: any; + }> { + } + interface ojSort extends CustomEvent<{ + header: Element; + direction: 'ascending' | 'descending'; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type ColumnSelectionEnd = { + endIndex: { + column: number; + }; + endKey?: { + column: K; + }; + } | { + endIndex?: { + column: number; + }; + endKey: { + column: K; + }; + }; + // tslint:disable-next-line interface-over-type-literal + type ColumnSelectionStart = { + startIndex: { + column: number; + }; + startKey?: { + column: K; + }; + } | { + startIndex?: { + column: number; + }; + startKey: { + column: K; + }; + }; + // tslint:disable-next-line interface-over-type-literal + type ColumnsRendererContext = { + cellContext: { + datasource: DataProvider | null; + mode: 'edit' | 'navigation'; + status: ContextStatus; + }; + columnIndex: number; + componentElement: Element; + data: D; + parentElement: Element; + row: { + [name: string]: any; + }; + }; + // tslint:disable-next-line interface-over-type-literal + type ContextStatus = { + rowIndex: number; + rowKey: K; + currentRow: CurrentRow; + }; + // tslint:disable-next-line interface-over-type-literal + type CurrentRow = { + rowIndex: number; + rowKey?: K; + } | { + rowIndex?: number; + rowKey: K; + }; + // tslint:disable-next-line interface-over-type-literal + type DragRowContext = { + rows: Array<{ + data: D; + index: number; + key: K; + }>; + }; + // tslint:disable-next-line interface-over-type-literal + type DropColumnContext = { + columnIndex: number; + }; + // tslint:disable-next-line interface-over-type-literal + type DropRowContext = { + rowIndex: number; + }; + // tslint:disable-next-line interface-over-type-literal + type FooterRendererContext = { + columnIndex: number; + componentElement: Element; + footerContext: { + datasource: DataProvider | null; + }; + parentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type HeaderRendererContext = { + columnIndex: number; + columnHeaderDefaultRenderer?: ((param0: object, param1: ((param0: object) => void)) => void); + columnHeaderSortableIconRenderer?: ((param0: object, param1: ((param0: object) => void)) => void); + componentElement: Element; + data: string; + headerContext: { + datasource: DataProvider | null; + }; + parentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type RowRendererContext = { + componentElement: Element; + data: { + [name: string]: any; + }; + parentElement: Element; + rowContext: { + datasource: DataProvider | null; + mode: 'edit' | 'navigation'; + status: ContextStatus; + }; + }; + // tslint:disable-next-line interface-over-type-literal + type RowSelectionEnd = { + endIndex: { + row: number; + }; + endKey?: { + row: K; + }; + } | { + endIndex?: { + row: number; + }; + endKey: { + row: K; + }; + }; + // tslint:disable-next-line interface-over-type-literal + type RowSelectionStart = { + startIndex: { + row: number; + }; + startKey?: { + row: K; + }; + } | { + startIndex?: { + row: number; + }; + startKey: { + row: K; + }; + }; +} +export interface ojTableEventMap extends baseComponentEventMap> { + 'ojAnimateEnd': ojTable.ojAnimateEnd; + 'ojAnimateStart': ojTable.ojAnimateStart; + 'ojBeforeCurrentRow': ojTable.ojBeforeCurrentRow; + 'ojBeforeRowEdit': ojTable.ojBeforeRowEdit; + 'ojBeforeRowEditEnd': ojTable.ojBeforeRowEditEnd; + 'ojSort': ojTable.ojSort; + 'accessibilityChanged': JetElementCustomEvent["accessibility"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'columnsChanged': JetElementCustomEvent["columns"]>; + 'columnsDefaultChanged': JetElementCustomEvent["columnsDefault"]>; + 'currentRowChanged': JetElementCustomEvent["currentRow"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'displayChanged': JetElementCustomEvent["display"]>; + 'dndChanged': JetElementCustomEvent["dnd"]>; + 'editModeChanged': JetElementCustomEvent["editMode"]>; + 'firstSelectedRowChanged': JetElementCustomEvent["firstSelectedRow"]>; + 'horizontalGridVisibleChanged': JetElementCustomEvent["horizontalGridVisible"]>; + 'rowRendererChanged': JetElementCustomEvent["rowRenderer"]>; + 'scrollPolicyChanged': JetElementCustomEvent["scrollPolicy"]>; + 'scrollPolicyOptionsChanged': JetElementCustomEvent["scrollPolicyOptions"]>; + 'scrollPositionChanged': JetElementCustomEvent["scrollPosition"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'selectionRequiredChanged': JetElementCustomEvent["selectionRequired"]>; + 'verticalGridVisibleChanged': JetElementCustomEvent["verticalGridVisible"]>; +} +export interface ojTableSettableProperties extends baseComponentSettableProperties { + accessibility: { + rowHeader: string; + }; + as: string; + columns: Array<{ + className?: string | null; + field?: string | null; + footerClassName?: string | null; + footerRenderer?: ((context: ojTable.FooterRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + footerStyle?: string | null; + footerTemplate?: { + componentElement: Element; + }; + headerClassName?: string | null; + headerRenderer?: ((context: ojTable.HeaderRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + headerStyle?: string | null; + headerTemplate?: { + componentElement: Element; + data: object; + }; + headerText?: string | null; + id?: string | null; + renderer?: ((context: ojTable.ColumnsRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + resizable?: 'enabled' | 'disabled'; + sortProperty?: string | null; + sortable?: 'auto' | 'enabled' | 'disabled'; + style?: string | null; + template?: { + componentElement: Element; + data: object; + row: object; + index: number; + columnIndex: number; + key: any; + mode: string; + }; + width?: number | null; + }> | null; + columnsDefault: { + className?: string | null; + field?: string | null; + footerClassName?: string | null; + footerRenderer?: ((context: ojTable.FooterRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + footerStyle?: string | null; + footerTemplate?: { + componentElement: Element; + }; + headerClassName?: string | null; + headerRenderer?: ((context: ojTable.HeaderRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + headerStyle?: string | null; + headerTemplate?: { + componentElement: Element; + data: object; + }; + headerText?: string | null; + renderer?: ((context: ojTable.ColumnsRendererContext) => { + insert: HTMLElement | string; + } | void) | null; + resizable?: 'enabled' | 'disabled'; + sortProperty?: string | null; + sortable?: 'auto' | 'enabled' | 'disabled'; + style?: string | null; + template?: { + componentElement: Element; + data: object; + row: object; + index: number; + columnIndex: number; + key: any; + mode: string; + }; + width?: number | null; + }; + currentRow: ojTable.CurrentRow | null; + data: DataProvider | null; + display: 'list' | 'grid'; + dnd: { + drag: { + rows: { + dataTypes?: string | string[]; + dragStart?: ((param0: DragEvent, param1: ojTable.DragRowContext) => void); + drag?: ((param0: DragEvent) => void); + dragEnd?: ((param0: DragEvent) => void); + }; + }; + drop: { + columns: { + dataTypes: string | string[]; + dragEnter?: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + dragOver?: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + dragLeave?: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + drop: ((param0: DragEvent, param1: ojTable.DropColumnContext) => void); + }; + rows: { + dataTypes: string | string[]; + dragEnter?: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + dragOver?: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + dragLeave?: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + drop: ((param0: DragEvent, param1: ojTable.DropRowContext) => void); + }; + }; + reorder: { + columns: 'enabled' | 'disabled'; + }; + }; + editMode: 'none' | 'rowEdit'; + readonly firstSelectedRow: object; + horizontalGridVisible: 'auto' | 'enabled' | 'disabled'; + rowRenderer: ((context: ojTable.RowRendererContext) => string | HTMLElement | void) | null; + scrollPolicy: 'auto' | 'loadMoreOnScroll'; + scrollPolicyOptions: { + fetchSize: number; + maxCount: number; + }; + scrollPosition: { + x?: number; + y?: number; + columnIndex?: number; + rowIndex?: number; + columnKey?: any; + rowKey?: any; + offsetX?: number; + offsetY?: number; + }; + selection: Array & ojTable.RowSelectionEnd> | Array & ojTable.ColumnSelectionEnd>; + selectionMode: { + column: 'single' | 'multiple'; + row: 'single' | 'multiple'; + }; + selectionRequired: boolean; + verticalGridVisible: 'auto' | 'enabled' | 'disabled'; + translations: { + labelAccSelectionAffordanceBottom?: string; + labelAccSelectionAffordanceTop?: string; + labelDisableNonContiguousSelection?: string; + labelEditRow?: string; + labelEnableNonContiguousSelection?: string; + labelResize?: string; + labelResizePopupSpinner?: string; + labelResizePopupSubmit?: string; + labelSelectAndEditRow?: string; + labelSelectColum?: string; + labelSelectRow?: string; + labelSort?: string; + labelSortAsc?: string; + labelSortDsc?: string; + msgColumnResizeWidthValidation?: string; + msgFetchingData?: string; + msgInitializing?: string; + msgNoData?: string; + msgScrollPolicyMaxCountDetail?: string; + msgScrollPolicyMaxCountSummary?: string; + msgStatusSortAscending?: string; + msgStatusSortDescending?: string; + }; +} +export interface ojTableSettablePropertiesLenient extends Partial> { + [key: string]: any; +} diff --git a/types/oraclejet/ojtagcloud/index.d.ts b/types/oraclejet/ojtagcloud/index.d.ts new file mode 100644 index 0000000000..17bc2397a5 --- /dev/null +++ b/types/oraclejet/ojtagcloud/index.d.ts @@ -0,0 +1,208 @@ +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojTagCloud extends dvtBaseComponent> { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + data: DataProvider | null; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + layout: 'cloud' | 'rectangular'; + selection: K[]; + selectionMode: 'single' | 'multiple' | 'none'; + styleDefaults: { + animationDuration?: number; + hoverBehaviorDelay?: number; + svgStyle?: object; + }; + tooltip: { + renderer: ((context: ojTagCloud.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onLayoutChanged: ((event: JetElementCustomEvent["layout"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onStyleDefaultsChanged: ((event: JetElementCustomEvent["styleDefaults"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTouchResponseChanged: ((event: JetElementCustomEvent["touchResponse"]>) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojTagCloudEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojTagCloud[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojTagCloudSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojTagCloudSettablePropertiesLenient): void; + getContextByNode(node: Element): ojTagCloud.NodeContext | null; + getItem(index: number): ojTagCloud.ItemContext | null; + getItemCount(): number; +} +export interface ojTagCloudEventMap extends dvtBaseComponentEventMap> { + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'layoutChanged': JetElementCustomEvent["layout"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'styleDefaultsChanged': JetElementCustomEvent["styleDefaults"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'touchResponseChanged': JetElementCustomEvent["touchResponse"]>; +} +export interface ojTagCloudSettableProperties extends dvtBaseComponentSettableProperties { + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + as: string; + data: DataProvider | null; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + layout: 'cloud' | 'rectangular'; + selection: K[]; + selectionMode: 'single' | 'multiple' | 'none'; + styleDefaults: { + animationDuration?: number; + hoverBehaviorDelay?: number; + svgStyle?: object; + }; + tooltip: { + renderer: ((context: ojTagCloud.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojTagCloudSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export namespace ojTagCloud { + // tslint:disable-next-line interface-over-type-literal + type ItemContext = { + color: string; + label: string; + selected: boolean; + tooltip: string; + value: number; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + subId: string; + index: number; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + color: string; + componentElement: Element; + id: K; + label: string; + parentElement: Element; + value: number; + }; +} +export interface ojTagCloudItem extends JetElement { + categories: string[]; + color?: string; + label: string; + shortDesc: string; + svgClassName: string; + svgStyle: object; + url: string; + value: number | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onUrlChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTagCloudItemEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojTagCloudItem[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojTagCloudItemSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojTagCloudItemSettablePropertiesLenient): void; +} +export interface ojTagCloudItemEventMap extends HTMLElementEventMap { + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'urlChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojTagCloudItemSettableProperties extends JetSettableProperties { + categories: string[]; + color?: string; + label: string; + shortDesc: string; + svgClassName: string; + svgStyle: object; + url: string; + value: number | null; +} +export interface ojTagCloudItemSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojthematicmap/index.d.ts b/types/oraclejet/ojthematicmap/index.d.ts new file mode 100644 index 0000000000..45bbd3b907 --- /dev/null +++ b/types/oraclejet/ojthematicmap/index.d.ts @@ -0,0 +1,576 @@ +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojThematicMap extends dvtBaseComponent> { + animationDuration: number; + animationOnDisplay: 'auto' | 'none'; + areaData: DataProvider | null; + as: string; + focusRenderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverRenderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + initialZooming: 'auto' | 'none'; + isolatedItem: K1; + labelDisplay: 'on' | 'off' | 'auto'; + labelType: 'long' | 'short'; + linkData: DataProvider | null; + mapProvider: { + geo: object; + propertiesKeys: { + id: string; + longLabel?: string; + shortLabel?: string; + }; + }; + markerData: DataProvider | null; + markerZoomBehavior: 'zoom' | 'fixed'; + maxZoom: number; + panning: 'auto' | 'none'; + renderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + selection: Array; + selectionMode: 'single' | 'multiple' | 'none'; + selectionRenderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + styleDefaults: { + areaSvgStyle?: object; + dataAreaDefaults?: { + borderColor?: string; + hoverColor?: string; + selectedInnerColor?: string; + selectedOuterColor?: string; + }; + dataMarkerDefaults?: { + borderColor?: string; + borderStyle?: 'none' | 'solid'; + borderWidth?: number; + color?: string; + height?: number; + labelStyle?: object; + opacity?: number; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + width?: number; + }; + hoverBehaviorDelay?: number; + labelStyle?: object; + linkDefaults?: { + color?: string; + width?: number; + }; + }; + tooltip: { + renderer: ((context: ojThematicMap.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + tooltipDisplay: 'auto' | 'labelAndShortDesc' | 'none' | 'shortDesc'; + touchResponse: 'touchStart' | 'auto'; + zooming: 'auto' | 'none'; + translations: { + areasRegion?: string; + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + linksRegion?: string; + markersRegion?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onAnimationDurationChanged: ((event: JetElementCustomEvent["animationDuration"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAreaDataChanged: ((event: JetElementCustomEvent["areaData"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onFocusRendererChanged: ((event: JetElementCustomEvent["focusRenderer"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onHoverRendererChanged: ((event: JetElementCustomEvent["hoverRenderer"]>) => any) | null; + onInitialZoomingChanged: ((event: JetElementCustomEvent["initialZooming"]>) => any) | null; + onIsolatedItemChanged: ((event: JetElementCustomEvent["isolatedItem"]>) => any) | null; + onLabelDisplayChanged: ((event: JetElementCustomEvent["labelDisplay"]>) => any) | null; + onLabelTypeChanged: ((event: JetElementCustomEvent["labelType"]>) => any) | null; + onLinkDataChanged: ((event: JetElementCustomEvent["linkData"]>) => any) | null; + onMapProviderChanged: ((event: JetElementCustomEvent["mapProvider"]>) => any) | null; + onMarkerDataChanged: ((event: JetElementCustomEvent["markerData"]>) => any) | null; + onMarkerZoomBehaviorChanged: ((event: JetElementCustomEvent["markerZoomBehavior"]>) => any) | null; + onMaxZoomChanged: ((event: JetElementCustomEvent["maxZoom"]>) => any) | null; + onPanningChanged: ((event: JetElementCustomEvent["panning"]>) => any) | null; + onRendererChanged: ((event: JetElementCustomEvent["renderer"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onSelectionRendererChanged: ((event: JetElementCustomEvent["selectionRenderer"]>) => any) | null; + onStyleDefaultsChanged: ((event: JetElementCustomEvent["styleDefaults"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTooltipDisplayChanged: ((event: JetElementCustomEvent["tooltipDisplay"]>) => any) | null; + onTouchResponseChanged: ((event: JetElementCustomEvent["touchResponse"]>) => any) | null; + onZoomingChanged: ((event: JetElementCustomEvent["zooming"]>) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojThematicMapEventMap[T]) => any, + useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojThematicMap[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojThematicMapSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojThematicMapSettablePropertiesLenient): void; + getArea(index: number): ojThematicMap.DataContext | null; + getContextByNode(node: Element): ojThematicMap.NodeContext | null; + getLink(index: number): ojThematicMap.DataContext | null; + getMarker(index: number): ojThematicMap.DataContext | null; +} +export interface ojThematicMapEventMap extends dvtBaseComponentEventMap> { + 'animationDurationChanged': JetElementCustomEvent["animationDuration"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'areaDataChanged': JetElementCustomEvent["areaData"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'focusRendererChanged': JetElementCustomEvent["focusRenderer"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'hoverRendererChanged': JetElementCustomEvent["hoverRenderer"]>; + 'initialZoomingChanged': JetElementCustomEvent["initialZooming"]>; + 'isolatedItemChanged': JetElementCustomEvent["isolatedItem"]>; + 'labelDisplayChanged': JetElementCustomEvent["labelDisplay"]>; + 'labelTypeChanged': JetElementCustomEvent["labelType"]>; + 'linkDataChanged': JetElementCustomEvent["linkData"]>; + 'mapProviderChanged': JetElementCustomEvent["mapProvider"]>; + 'markerDataChanged': JetElementCustomEvent["markerData"]>; + 'markerZoomBehaviorChanged': JetElementCustomEvent["markerZoomBehavior"]>; + 'maxZoomChanged': JetElementCustomEvent["maxZoom"]>; + 'panningChanged': JetElementCustomEvent["panning"]>; + 'rendererChanged': JetElementCustomEvent["renderer"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'selectionRendererChanged': JetElementCustomEvent["selectionRenderer"]>; + 'styleDefaultsChanged': JetElementCustomEvent["styleDefaults"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'tooltipDisplayChanged': JetElementCustomEvent["tooltipDisplay"]>; + 'touchResponseChanged': JetElementCustomEvent["touchResponse"]>; + 'zoomingChanged': JetElementCustomEvent["zooming"]>; +} +export interface ojThematicMapSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number; + animationOnDisplay: 'auto' | 'none'; + areaData: DataProvider | null; + as: string; + focusRenderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverRenderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + initialZooming: 'auto' | 'none'; + isolatedItem: K1; + labelDisplay: 'on' | 'off' | 'auto'; + labelType: 'long' | 'short'; + linkData: DataProvider | null; + mapProvider: { + geo: object; + propertiesKeys: { + id: string; + longLabel?: string; + shortLabel?: string; + }; + }; + markerData: DataProvider | null; + markerZoomBehavior: 'zoom' | 'fixed'; + maxZoom: number; + panning: 'auto' | 'none'; + renderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + selection: Array; + selectionMode: 'single' | 'multiple' | 'none'; + selectionRenderer: ((context: ojThematicMap.RendererContext) => { + insert: SVGElement; + } | void) | null; + styleDefaults: { + areaSvgStyle?: object; + dataAreaDefaults?: { + borderColor?: string; + hoverColor?: string; + selectedInnerColor?: string; + selectedOuterColor?: string; + }; + dataMarkerDefaults?: { + borderColor?: string; + borderStyle?: 'none' | 'solid'; + borderWidth?: number; + color?: string; + height?: number; + labelStyle?: object; + opacity?: number; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + width?: number; + }; + hoverBehaviorDelay?: number; + labelStyle?: object; + linkDefaults?: { + color?: string; + width?: number; + }; + }; + tooltip: { + renderer: ((context: ojThematicMap.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + tooltipDisplay: 'auto' | 'labelAndShortDesc' | 'none' | 'shortDesc'; + touchResponse: 'touchStart' | 'auto'; + zooming: 'auto' | 'none'; + translations: { + areasRegion?: string; + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + linksRegion?: string; + markersRegion?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojThematicMapSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export namespace ojThematicMap { + // tslint:disable-next-line interface-over-type-literal + type DataContext = { + color: string; + label: string; + selected: boolean; + tooltip: string; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + subId: string; + index: number; + }; + // tslint:disable-next-line interface-over-type-literal + type RendererContext = { + color: string; + componentElement: Element; + data: object; + id: K1 | K2 | K3; + itemData: D1 | D2 | D3; + label: string; + location: string | null; + parentElement: Element; + previousState: { + hovered: boolean; + selected: boolean; + focused: boolean; + }; + renderDefaultFocus: (() => void); + renderDefaultHover: (() => void); + renderDefaultSelection: (() => void); + root: Element | null; + state: { + hovered: boolean; + selected: boolean; + focused: boolean; + }; + x: number | null; + y: number | null; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + color: string | null; + componentElement: Element; + data: object | null; + id: K1 | K2 | K3; + itemData: D1 | D2 | D3; + label: string | null; + location: string | null; + locationName: string | null; + parentElement: Element; + tooltip: string; + x: number; + y: number; + }; +} +export interface ojThematicMapArea extends JetElement { + categories: string[]; + color: string; + label: string; + labelStyle: object; + location: string; + opacity: number; + selectable: 'auto' | 'off'; + shortDesc: string; + svgClassName: string; + svgStyle: object; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onLocationChanged: ((event: JetElementCustomEvent) => any) | null; + onOpacityChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectableChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapAreaEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojThematicMapArea[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojThematicMapAreaSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojThematicMapAreaSettablePropertiesLenient): void; +} +export interface ojThematicMapAreaEventMap extends HTMLElementEventMap { + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'locationChanged': JetElementCustomEvent; + 'opacityChanged': JetElementCustomEvent; + 'selectableChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; +} +export interface ojThematicMapAreaSettableProperties extends JetSettableProperties { + categories: string[]; + color: string; + label: string; + labelStyle: object; + location: string; + opacity: number; + selectable: 'auto' | 'off'; + shortDesc: string; + svgClassName: string; + svgStyle: object; +} +export interface ojThematicMapAreaSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojThematicMapLink extends JetElement { + categories: string[]; + color: string; + endLocation: { + id?: any; + location?: string; + x?: number; + y?: number; + }; + selectable: 'auto' | 'off'; + shortDesc: string; + startLocation: { + id?: any; + location?: string; + x?: number; + y?: number; + }; + svgClassName: string; + svgStyle: object; + width: number; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onEndLocationChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectableChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onStartLocationChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onWidthChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapLinkEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojThematicMapLink[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojThematicMapLinkSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojThematicMapLinkSettablePropertiesLenient): void; +} +export interface ojThematicMapLinkEventMap extends HTMLElementEventMap { + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'endLocationChanged': JetElementCustomEvent; + 'selectableChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'startLocationChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'widthChanged': JetElementCustomEvent; +} +export interface ojThematicMapLinkSettableProperties extends JetSettableProperties { + categories: string[]; + color: string; + endLocation: { + id?: any; + location?: string; + x?: number; + y?: number; + }; + selectable: 'auto' | 'off'; + shortDesc: string; + startLocation: { + id?: any; + location?: string; + x?: number; + y?: number; + }; + svgClassName: string; + svgStyle: object; + width: number; +} +export interface ojThematicMapLinkSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export interface ojThematicMapMarker extends JetElement { + borderColor: string; + borderStyle: 'solid' | 'none'; + borderWidth: number; + categories: string[]; + color: string; + height: number; + label: string; + labelPosition: 'bottom' | 'center' | 'top'; + labelStyle: object; + location: string; + opacity: number; + rotation: number; + selectable: 'auto' | 'off'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + value: number; + width: number; + x: number | null; + y: number | null; + onBorderColorChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onBorderWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onHeightChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelPositionChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onLocationChanged: ((event: JetElementCustomEvent) => any) | null; + onOpacityChanged: ((event: JetElementCustomEvent) => any) | null; + onRotationChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectableChanged: ((event: JetElementCustomEvent) => any) | null; + onShapeChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceHoverSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onSourceSelectedChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + onWidthChanged: ((event: JetElementCustomEvent) => any) | null; + onXChanged: ((event: JetElementCustomEvent) => any) | null; + onYChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojThematicMapMarkerEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojThematicMapMarker[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojThematicMapMarkerSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojThematicMapMarkerSettablePropertiesLenient): void; +} +export interface ojThematicMapMarkerEventMap extends HTMLElementEventMap { + 'borderColorChanged': JetElementCustomEvent; + 'borderStyleChanged': JetElementCustomEvent; + 'borderWidthChanged': JetElementCustomEvent; + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'heightChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelPositionChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'locationChanged': JetElementCustomEvent; + 'opacityChanged': JetElementCustomEvent; + 'rotationChanged': JetElementCustomEvent; + 'selectableChanged': JetElementCustomEvent; + 'shapeChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'sourceChanged': JetElementCustomEvent; + 'sourceHoverChanged': JetElementCustomEvent; + 'sourceHoverSelectedChanged': JetElementCustomEvent; + 'sourceSelectedChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; + 'widthChanged': JetElementCustomEvent; + 'xChanged': JetElementCustomEvent; + 'yChanged': JetElementCustomEvent; +} +export interface ojThematicMapMarkerSettableProperties extends JetSettableProperties { + borderColor: string; + borderStyle: 'solid' | 'none'; + borderWidth: number; + categories: string[]; + color: string; + height: number; + label: string; + labelPosition: 'bottom' | 'center' | 'top'; + labelStyle: object; + location: string; + opacity: number; + rotation: number; + selectable: 'auto' | 'off'; + shape?: 'circle' | 'diamond' | 'ellipse' | 'human' | 'plus' | 'rectangle' | 'square' | 'star' | 'triangleDown' | 'triangleUp' | string; + shortDesc: string; + source: string; + sourceHover: string; + sourceHoverSelected: string; + sourceSelected: string; + svgClassName: string; + svgStyle: object; + value: number; + width: number; + x: number | null; + y: number | null; +} +export interface ojThematicMapMarkerSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojthemeutils/index.d.ts b/types/oraclejet/ojthemeutils/index.d.ts new file mode 100644 index 0000000000..de718ebef9 --- /dev/null +++ b/types/oraclejet/ojthemeutils/index.d.ts @@ -0,0 +1,4 @@ +export function clearCache(): void; +export function getThemeName(): string | null; +export function getThemeTargetPlatform(): string | null; +export function parseJSONFromFontFamily(selector: string): any; diff --git a/types/oraclejet/ojtime-base/index.d.ts b/types/oraclejet/ojtime-base/index.d.ts new file mode 100644 index 0000000000..c5841cd8ec --- /dev/null +++ b/types/oraclejet/ojtime-base/index.d.ts @@ -0,0 +1,22 @@ +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface dvtTimeComponent extends dvtBaseComponent { + addEventListener>(type: T, listener: (this: HTMLElement, ev: dvtTimeComponentEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): dvtTimeComponent[T]; + getProperty(property: string): any; + setProperty(property: T, value: dvtTimeComponentSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: dvtTimeComponentSettablePropertiesLenient): void; +} +// These interfaces are empty but required to keep the event chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface dvtTimeComponentEventMap extends dvtBaseComponentEventMap { +} +// These interfaces are empty but required to keep the component chain intact. Avoid lint-rule +// tslint:disable-next-line no-empty-interface +export interface dvtTimeComponentSettableProperties extends dvtBaseComponentSettableProperties { +} +export interface dvtTimeComponentSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojtimeaxis/index.d.ts b/types/oraclejet/ojtimeaxis/index.d.ts new file mode 100644 index 0000000000..2505fef16f --- /dev/null +++ b/types/oraclejet/ojtimeaxis/index.d.ts @@ -0,0 +1,87 @@ +import { Converter } from '../ojvalidation-base'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojTimeAxis extends dvtBaseComponent { + converter: ojTimeAxis.Converters | Converter; + end: string; + scale: 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; + start: string; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; + onConverterChanged: ((event: JetElementCustomEvent) => any) | null; + onEndChanged: ((event: JetElementCustomEvent) => any) | null; + onScaleChanged: ((event: JetElementCustomEvent) => any) | null; + onStartChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTimeAxisEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojTimeAxis[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojTimeAxisSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojTimeAxisSettablePropertiesLenient): void; +} +export interface ojTimeAxisEventMap extends dvtBaseComponentEventMap { + 'converterChanged': JetElementCustomEvent; + 'endChanged': JetElementCustomEvent; + 'scaleChanged': JetElementCustomEvent; + 'startChanged': JetElementCustomEvent; +} +export interface ojTimeAxisSettableProperties extends dvtBaseComponentSettableProperties { + converter: ojTimeAxis.Converters | Converter; + end: string; + scale: 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; + start: string; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + }; +} +export interface ojTimeAxisSettablePropertiesLenient extends Partial { + [key: string]: any; +} +export namespace ojTimeAxis { + // tslint:disable-next-line interface-over-type-literal + type Converters = { + default?: Converter; + seconds?: Converter; + minutes?: Converter; + hours?: Converter; + days?: Converter; + weeks?: Converter; + months?: Converter; + quarters?: Converter; + years?: Converter; + }; +} diff --git a/types/oraclejet/ojtimeutils/index.d.ts b/types/oraclejet/ojtimeutils/index.d.ts new file mode 100644 index 0000000000..a77d0f4d36 --- /dev/null +++ b/types/oraclejet/ojtimeutils/index.d.ts @@ -0,0 +1,3 @@ +export function getDate(pos: number, rangeStartTime: Date | string | number, rangeEndTime: Date | string | number, rangeWidth: number): number; +export function getLength(startTime: Date | string | number, endTime: Date | string | number, rangeStartTime: Date | string | number, rangeEndTime: Date | string | number, rangeWidth: number): number; +export function getPosition(time: Date | string | number, rangeStartTime: Date | string | number, rangeEndTime: Date | string | number, rangeWidth: number): number; diff --git a/types/oraclejet/ojtoolbar/index.d.ts b/types/oraclejet/ojtoolbar/index.d.ts new file mode 100644 index 0000000000..c310c831c7 --- /dev/null +++ b/types/oraclejet/ojtoolbar/index.d.ts @@ -0,0 +1,22 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojToolbar extends baseComponent { + chroming: 'full' | 'half' | 'outlined'; + onChromingChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojToolbarEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojToolbar[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojToolbarSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojToolbarSettablePropertiesLenient): void; + refresh(): void; +} +export interface ojToolbarEventMap extends baseComponentEventMap { + 'chromingChanged': JetElementCustomEvent; +} +export interface ojToolbarSettableProperties extends baseComponentSettableProperties { + chroming: 'full' | 'half' | 'outlined'; +} +export interface ojToolbarSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojtrain/index.d.ts b/types/oraclejet/ojtrain/index.d.ts new file mode 100644 index 0000000000..233592fd61 --- /dev/null +++ b/types/oraclejet/ojtrain/index.d.ts @@ -0,0 +1,78 @@ +import { baseComponent, baseComponentEventMap, baseComponentSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojTrain extends baseComponent { + selectedStep: string; + steps: ojTrain.Step[]; + onSelectedStepChanged: ((event: JetElementCustomEvent) => any) | null; + onStepsChanged: ((event: JetElementCustomEvent) => any) | null; + onOjBeforeDeselect: ((event: ojTrain.ojBeforeDeselect) => any) | null; + onOjBeforeSelect: ((event: ojTrain.ojBeforeSelect) => any) | null; + onOjDeselect: ((event: ojTrain.ojDeselect) => any) | null; + onOjSelect: ((event: ojTrain.ojSelect) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTrainEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojTrain[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojTrainSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojTrainSettablePropertiesLenient): void; + getNextSelectableStep(): string | null; + getPreviousSelectableStep(): string | null; + getStep(id: string): ojTrain.Step | null; + refresh(): void; + updateStep(id: string, stepProperties: { + id?: string; + label?: string; + disabled?: boolean; + visited?: boolean; + messageType?: 'info' | 'error' | 'fatal' | 'warning'; + }): void; +} +export namespace ojTrain { + interface ojBeforeDeselect extends CustomEvent<{ + toStep: string; + fromStep: string; + [propName: string]: any; + }> { + } + interface ojBeforeSelect extends CustomEvent<{ + toStep: string; + fromStep: string; + [propName: string]: any; + }> { + } + interface ojDeselect extends CustomEvent<{ + toStep: string; + fromStep: string; + [propName: string]: any; + }> { + } + interface ojSelect extends CustomEvent<{ + toStep: string; + fromStep: string; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type Step = { + id: string; + label: string; + disabled?: boolean; + visited?: boolean; + messageType?: 'info' | 'error' | 'fatal' | 'warning'; + }; +} +export interface ojTrainEventMap extends baseComponentEventMap { + 'ojBeforeDeselect': ojTrain.ojBeforeDeselect; + 'ojBeforeSelect': ojTrain.ojBeforeSelect; + 'ojDeselect': ojTrain.ojDeselect; + 'ojSelect': ojTrain.ojSelect; + 'selectedStepChanged': JetElementCustomEvent; + 'stepsChanged': JetElementCustomEvent; +} +export interface ojTrainSettableProperties extends baseComponentSettableProperties { + selectedStep: string; + steps: ojTrain.Step[]; +} +export interface ojTrainSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojtranslation/index.d.ts b/types/oraclejet/ojtranslation/index.d.ts new file mode 100644 index 0000000000..69957f1980 --- /dev/null +++ b/types/oraclejet/ojtranslation/index.d.ts @@ -0,0 +1,5 @@ +export function applyParameters(pattern: string, parameters: object | any[]): string | null; +export function getComponentTranslations(componentName: string): object; +export function getResource(key: string): object | string | null; +export function getTranslatedString(key: string, ...var_args: Array): string; +export function setBundle(bundle: object): void; diff --git a/types/oraclejet/ojtreedataprovider/index.d.ts b/types/oraclejet/ojtreedataprovider/index.d.ts new file mode 100644 index 0000000000..88d877d363 --- /dev/null +++ b/types/oraclejet/ojtreedataprovider/index.d.ts @@ -0,0 +1,5 @@ +import { DataProvider } from '../ojdataprovider'; +interface TreeDataProvider extends DataProvider { + getChildDataProvider(parentKey: any): TreeDataProvider; +} +export = TreeDataProvider; diff --git a/types/oraclejet/ojtreemap/index.d.ts b/types/oraclejet/ojtreemap/index.d.ts new file mode 100644 index 0000000000..56bfb35de9 --- /dev/null +++ b/types/oraclejet/ojtreemap/index.d.ts @@ -0,0 +1,392 @@ +import { DataProvider } from '../ojdataprovider'; +import { dvtBaseComponent, dvtBaseComponentEventMap, dvtBaseComponentSettableProperties } from '../ojdvt-base'; +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojTreemap extends dvtBaseComponent> { + animationDuration: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: DataProvider | null; + displayLevels: number; + drilling: 'on' | 'off'; + groupGaps: 'all' | 'none' | 'outer'; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + isolatedNode: any; + layout: 'sliceAndDiceHorizontal' | 'sliceAndDiceVertical' | 'squarified'; + nodeContent: { + renderer: ((context: ojTreemap.NodeContentContext) => ({ + insert: Element | string; + })); + }; + nodeDefaults: { + groupLabelDisplay: 'node' | 'off' | 'header'; + header: { + backgroundColor: string; + borderColor: string; + hoverBackgroundColor: string; + hoverInnerColor: string; + hoverOuterColor: string; + isolate: 'off' | 'on'; + labelHalign: 'center' | 'end' | 'start'; + labelStyle: object; + selectedBackgroundColor: string; + selectedInnerColor: string; + selectedOuterColor: string; + useNodeColor: 'on' | 'off'; + }; + hoverColor: string; + labelDisplay: 'off' | 'node'; + labelHalign: 'start' | 'end' | 'center'; + labelMinLength: number; + labelStyle: object; + labelValign: 'top' | 'bottom' | 'center'; + selectedInnerColor: string; + selectedOuterColor: string; + }; + nodeSeparators: 'bevels' | 'gaps'; + rootNode: any; + selection: any[]; + selectionMode: 'none' | 'single' | 'multiple'; + sizeLabel: string; + sorting: 'on' | 'off'; + tooltip: { + renderer: ((context: ojTreemap.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelColor?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + labelSize?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + tooltipIsolate?: string; + tooltipRestore?: string; + }; + onAnimationDurationChanged: ((event: JetElementCustomEvent["animationDuration"]>) => any) | null; + onAnimationOnDataChangeChanged: ((event: JetElementCustomEvent["animationOnDataChange"]>) => any) | null; + onAnimationOnDisplayChanged: ((event: JetElementCustomEvent["animationOnDisplay"]>) => any) | null; + onAnimationUpdateColorChanged: ((event: JetElementCustomEvent["animationUpdateColor"]>) => any) | null; + onAsChanged: ((event: JetElementCustomEvent["as"]>) => any) | null; + onColorLabelChanged: ((event: JetElementCustomEvent["colorLabel"]>) => any) | null; + onDataChanged: ((event: JetElementCustomEvent["data"]>) => any) | null; + onDisplayLevelsChanged: ((event: JetElementCustomEvent["displayLevels"]>) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent["drilling"]>) => any) | null; + onGroupGapsChanged: ((event: JetElementCustomEvent["groupGaps"]>) => any) | null; + onHiddenCategoriesChanged: ((event: JetElementCustomEvent["hiddenCategories"]>) => any) | null; + onHighlightMatchChanged: ((event: JetElementCustomEvent["highlightMatch"]>) => any) | null; + onHighlightedCategoriesChanged: ((event: JetElementCustomEvent["highlightedCategories"]>) => any) | null; + onHoverBehaviorChanged: ((event: JetElementCustomEvent["hoverBehavior"]>) => any) | null; + onHoverBehaviorDelayChanged: ((event: JetElementCustomEvent["hoverBehaviorDelay"]>) => any) | null; + onIsolatedNodeChanged: ((event: JetElementCustomEvent["isolatedNode"]>) => any) | null; + onLayoutChanged: ((event: JetElementCustomEvent["layout"]>) => any) | null; + onNodeContentChanged: ((event: JetElementCustomEvent["nodeContent"]>) => any) | null; + onNodeDefaultsChanged: ((event: JetElementCustomEvent["nodeDefaults"]>) => any) | null; + onNodeSeparatorsChanged: ((event: JetElementCustomEvent["nodeSeparators"]>) => any) | null; + onRootNodeChanged: ((event: JetElementCustomEvent["rootNode"]>) => any) | null; + onSelectionChanged: ((event: JetElementCustomEvent["selection"]>) => any) | null; + onSelectionModeChanged: ((event: JetElementCustomEvent["selectionMode"]>) => any) | null; + onSizeLabelChanged: ((event: JetElementCustomEvent["sizeLabel"]>) => any) | null; + onSortingChanged: ((event: JetElementCustomEvent["sorting"]>) => any) | null; + onTooltipChanged: ((event: JetElementCustomEvent["tooltip"]>) => any) | null; + onTouchResponseChanged: ((event: JetElementCustomEvent["touchResponse"]>) => any) | null; + onOjBeforeDrill: ((event: ojTreemap.ojBeforeDrill) => any) | null; + onOjDrill: ((event: ojTreemap.ojDrill) => any) | null; + addEventListener>(type: T, listener: (this: HTMLElement, ev: ojTreemapEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty>(property: T): ojTreemap[T]; + getProperty(property: string): any; + setProperty>(property: T, value: ojTreemapSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType>): void; + setProperties(properties: ojTreemapSettablePropertiesLenient): void; + getContextByNode(node: Element): ojTreemap.NodeContext | null; + getNode(subIdPath: any[]): ojTreemap.DataContext | null; +} +export namespace ojTreemap { + interface ojBeforeDrill extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + interface ojDrill extends CustomEvent<{ + id: any; + data: object; + itemData: object; + [propName: string]: any; + }> { + } + // tslint:disable-next-line interface-over-type-literal + type DataContext = { + color: string; + label: string; + selected: boolean; + size: number; + tooltip: string; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContentContext = { + bounds: { + x: number; + y: number; + width: number; + height: number; + }; + id: K; + data: object; + itemData: D; + componentElement: Element; + }; + // tslint:disable-next-line interface-over-type-literal + type NodeContext = { + subId: string; + indexPath: number[]; + }; + // tslint:disable-next-line interface-over-type-literal + type TooltipContext = { + parentElement: Element; + id: K; + label: string; + value: number; + color: string; + data: object; + itemData: D; + componentElement: Element; + }; +} +export interface ojTreemapEventMap extends dvtBaseComponentEventMap> { + 'ojBeforeDrill': ojTreemap.ojBeforeDrill; + 'ojDrill': ojTreemap.ojDrill; + 'animationDurationChanged': JetElementCustomEvent["animationDuration"]>; + 'animationOnDataChangeChanged': JetElementCustomEvent["animationOnDataChange"]>; + 'animationOnDisplayChanged': JetElementCustomEvent["animationOnDisplay"]>; + 'animationUpdateColorChanged': JetElementCustomEvent["animationUpdateColor"]>; + 'asChanged': JetElementCustomEvent["as"]>; + 'colorLabelChanged': JetElementCustomEvent["colorLabel"]>; + 'dataChanged': JetElementCustomEvent["data"]>; + 'displayLevelsChanged': JetElementCustomEvent["displayLevels"]>; + 'drillingChanged': JetElementCustomEvent["drilling"]>; + 'groupGapsChanged': JetElementCustomEvent["groupGaps"]>; + 'hiddenCategoriesChanged': JetElementCustomEvent["hiddenCategories"]>; + 'highlightMatchChanged': JetElementCustomEvent["highlightMatch"]>; + 'highlightedCategoriesChanged': JetElementCustomEvent["highlightedCategories"]>; + 'hoverBehaviorChanged': JetElementCustomEvent["hoverBehavior"]>; + 'hoverBehaviorDelayChanged': JetElementCustomEvent["hoverBehaviorDelay"]>; + 'isolatedNodeChanged': JetElementCustomEvent["isolatedNode"]>; + 'layoutChanged': JetElementCustomEvent["layout"]>; + 'nodeContentChanged': JetElementCustomEvent["nodeContent"]>; + 'nodeDefaultsChanged': JetElementCustomEvent["nodeDefaults"]>; + 'nodeSeparatorsChanged': JetElementCustomEvent["nodeSeparators"]>; + 'rootNodeChanged': JetElementCustomEvent["rootNode"]>; + 'selectionChanged': JetElementCustomEvent["selection"]>; + 'selectionModeChanged': JetElementCustomEvent["selectionMode"]>; + 'sizeLabelChanged': JetElementCustomEvent["sizeLabel"]>; + 'sortingChanged': JetElementCustomEvent["sorting"]>; + 'tooltipChanged': JetElementCustomEvent["tooltip"]>; + 'touchResponseChanged': JetElementCustomEvent["touchResponse"]>; +} +export interface ojTreemapSettableProperties extends dvtBaseComponentSettableProperties { + animationDuration: number; + animationOnDataChange: 'auto' | 'none'; + animationOnDisplay: 'auto' | 'none'; + animationUpdateColor: string; + as: string; + colorLabel: string; + data: DataProvider | null; + displayLevels: number; + drilling: 'on' | 'off'; + groupGaps: 'all' | 'none' | 'outer'; + hiddenCategories: string[]; + highlightMatch: 'any' | 'all'; + highlightedCategories: string[]; + hoverBehavior: 'dim' | 'none'; + hoverBehaviorDelay: number; + isolatedNode: any; + layout: 'sliceAndDiceHorizontal' | 'sliceAndDiceVertical' | 'squarified'; + nodeContent: { + renderer: ((context: ojTreemap.NodeContentContext) => ({ + insert: Element | string; + })); + }; + nodeDefaults: { + groupLabelDisplay: 'node' | 'off' | 'header'; + header: { + backgroundColor: string; + borderColor: string; + hoverBackgroundColor: string; + hoverInnerColor: string; + hoverOuterColor: string; + isolate: 'off' | 'on'; + labelHalign: 'center' | 'end' | 'start'; + labelStyle: object; + selectedBackgroundColor: string; + selectedInnerColor: string; + selectedOuterColor: string; + useNodeColor: 'on' | 'off'; + }; + hoverColor: string; + labelDisplay: 'off' | 'node'; + labelHalign: 'start' | 'end' | 'center'; + labelMinLength: number; + labelStyle: object; + labelValign: 'top' | 'bottom' | 'center'; + selectedInnerColor: string; + selectedOuterColor: string; + }; + nodeSeparators: 'bevels' | 'gaps'; + rootNode: any; + selection: any[]; + selectionMode: 'none' | 'single' | 'multiple'; + sizeLabel: string; + sorting: 'on' | 'off'; + tooltip: { + renderer: ((context: ojTreemap.TooltipContext) => ({ + insert: Element | string; + } | { + preventDefault: boolean; + })); + }; + touchResponse: 'touchStart' | 'auto'; + translations: { + componentName?: string; + labelAndValue?: string; + labelClearSelection?: string; + labelColor?: string; + labelCountWithTotal?: string; + labelDataVisualization?: string; + labelInvalidData?: string; + labelNoData?: string; + labelSize?: string; + stateCollapsed?: string; + stateDrillable?: string; + stateExpanded?: string; + stateHidden?: string; + stateIsolated?: string; + stateMaximized?: string; + stateMinimized?: string; + stateSelected?: string; + stateUnselected?: string; + stateVisible?: string; + tooltipIsolate?: string; + tooltipRestore?: string; + }; +} +export interface ojTreemapSettablePropertiesLenient extends Partial> { + [key: string]: any; +} +export interface ojTreemapNode extends JetElement { + categories?: string[]; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + groupLabelDisplay?: 'node' | 'off' | 'header'; + header?: { + isolate?: 'off' | 'on'; + labelHalign?: 'center' | 'end' | 'start'; + labelStyle?: object; + useNodeColor?: 'on' | 'off'; + }; + label?: string; + labelDisplay?: 'off' | 'node'; + labelHalign?: 'start' | 'end' | 'center'; + labelStyle?: object; + labelValign?: 'top' | 'bottom' | 'center'; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + selectable?: 'off' | 'auto'; + shortDesc?: string; + svgClassName?: string; + svgStyle?: object; + value: number; + onCategoriesChanged: ((event: JetElementCustomEvent) => any) | null; + onColorChanged: ((event: JetElementCustomEvent) => any) | null; + onDrillingChanged: ((event: JetElementCustomEvent) => any) | null; + onGroupLabelDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onHeaderChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelDisplayChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelHalignChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onLabelValignChanged: ((event: JetElementCustomEvent) => any) | null; + onPatternChanged: ((event: JetElementCustomEvent) => any) | null; + onSelectableChanged: ((event: JetElementCustomEvent) => any) | null; + onShortDescChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgClassNameChanged: ((event: JetElementCustomEvent) => any) | null; + onSvgStyleChanged: ((event: JetElementCustomEvent) => any) | null; + onValueChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojTreemapNodeEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojTreemapNode[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojTreemapNodeSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojTreemapNodeSettablePropertiesLenient): void; +} +export interface ojTreemapNodeEventMap extends HTMLElementEventMap { + 'categoriesChanged': JetElementCustomEvent; + 'colorChanged': JetElementCustomEvent; + 'drillingChanged': JetElementCustomEvent; + 'groupLabelDisplayChanged': JetElementCustomEvent; + 'headerChanged': JetElementCustomEvent; + 'labelChanged': JetElementCustomEvent; + 'labelDisplayChanged': JetElementCustomEvent; + 'labelHalignChanged': JetElementCustomEvent; + 'labelStyleChanged': JetElementCustomEvent; + 'labelValignChanged': JetElementCustomEvent; + 'patternChanged': JetElementCustomEvent; + 'selectableChanged': JetElementCustomEvent; + 'shortDescChanged': JetElementCustomEvent; + 'svgClassNameChanged': JetElementCustomEvent; + 'svgStyleChanged': JetElementCustomEvent; + 'valueChanged': JetElementCustomEvent; +} +export interface ojTreemapNodeSettableProperties extends JetSettableProperties { + categories?: string[]; + color?: string; + drilling?: 'on' | 'off' | 'inherit'; + groupLabelDisplay?: 'node' | 'off' | 'header'; + header?: { + isolate?: 'off' | 'on'; + labelHalign?: 'center' | 'end' | 'start'; + labelStyle?: object; + useNodeColor?: 'on' | 'off'; + }; + label?: string; + labelDisplay?: 'off' | 'node'; + labelHalign?: 'start' | 'end' | 'center'; + labelStyle?: object; + labelValign?: 'top' | 'bottom' | 'center'; + pattern?: 'smallChecker' | 'smallCrosshatch' | 'smallDiagonalLeft' | 'smallDiagonalRight' | 'smallDiamond' | 'smallTriangle' | 'largeChecker' | 'largeCrosshatch' | 'largeDiagonalLeft' | + 'largeDiagonalRight' | 'largeDiamond' | 'largeTriangle' | 'none'; + selectable?: 'off' | 'auto'; + shortDesc?: string; + svgClassName?: string; + svgStyle?: object; + value: number; +} +export interface ojTreemapNodeSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/ojvalidation-base/index.d.ts b/types/oraclejet/ojvalidation-base/index.d.ts new file mode 100644 index 0000000000..83a20555db --- /dev/null +++ b/types/oraclejet/ojvalidation-base/index.d.ts @@ -0,0 +1,144 @@ +import Message = require('../ojmessaging'); +import Color = require('../ojcolor'); +export interface AsyncValidator { + hint: Promise; + validate(value: V): Promise; +} +export class ColorConverter implements Converter { + constructor(options?: ColorConverter.ConverterOptions); + format(color: Color): string | null; + getHint(): string; + parse(value: string): Color; + resolvedOptions(): ColorConverter.ConverterOptions; +} +export namespace ColorConverter { + // tslint:disable-next-line interface-over-type-literal + type ConverterOptions = { + format?: 'rgb' | 'hsl' | 'hsv' | 'hex' | 'hex3'; + }; +} +export interface ColorConverterFactory { + createConverter(options?: ColorConverter.ConverterOptions): ColorConverter; +} +export interface Converter { + format(value: V): string | null; + getHint?(): string | null; + getOptions?(): object; + parse(value: string): V | null; + resolvedOptions?(): object; +} +export interface ConverterError { + // constructor(summary: string, detail: string); + getMessage(): Message; +} +export interface ConverterFactory { + // static CONVERTER_TYPE_COLOR: string; + // static CONVERTER_TYPE_DATETIME: string; + // static CONVERTER_TYPE_NUMBER: string; + createConverter(options: object | null): Converter; +} +export namespace IntlConverterUtils { + function dateToLocalIso(date: Date): string; + function getConverterInstance(converterOption: string | Validation.RegisteredConverter | Converter): Converter | null; + function getInitials(firstName?: string, lastName?: string): string | undefined; + function getLocalTimeZoneOffset(): string; + function isoToDate(isoString: string): Date; + function isoToLocalDate(isoString: string): Date; +} +export class LengthValidator implements Validator { + static defaults: { + countBy: string; + }; + constructor(options?: LengthValidator.ValidatorOptions); + getHint(): string | null; + validate(value: string | number): void; +} +export namespace LengthValidator { + // tslint:disable-next-line interface-over-type-literal + type ValidatorOptions = { + countBy?: 'codeUnit' | 'codePoint'; + min?: number; + max?: number; + hint?: { + max?: string; + min?: string; + inRange?: string; + exact?: string; + }; + messageDetail?: { + tooLong?: string; + tooShort?: string; + }; + messageSummary?: { + tooLong?: string; + tooShort?: string; + }; + }; +} +export interface LengthValidatorFactory { + createValidator(options?: LengthValidator.ValidatorOptions): LengthValidator; +} +export class RegExpValidator implements Validator { + constructor(options?: RegExpValidator.ValidatorOptions); + getHint(): string | null; + validate(value: string | number): void; +} +export namespace RegExpValidator { + // tslint:disable-next-line interface-over-type-literal + type ValidatorOptions = { + pattern?: string; + hint?: string; + messageSummary?: string; + messageDetail?: string; + }; +} +export interface RegExpValidatorFactory { + createValidator(options: RegExpValidator.ValidatorOptions): RegExpValidator; +} +export class RequiredValidator implements Validator { + constructor(options?: RequiredValidator.ValidatorOptions); + getHint(): string | null; + validate(value: object | string | number): void; +} +export namespace RequiredValidator { + // tslint:disable-next-line interface-over-type-literal + type ValidatorOptions = { + hint?: string; + messageSummary?: string; + messageDetail?: string; + }; +} +export interface RequiredValidatorFactory { + createValidator(options?: RequiredValidator.ValidatorOptions): RequiredValidator; +} +export namespace Validation { + function converterFactory>(type: 'number' | 'color' | 'datetime' | string, instance?: CF): CF | null; + function validatorFactory>(type: 'required' | 'regexp' | 'numberRange' | 'length' | 'dateTimeRange' | 'dateRestriction' | string, instance?: VF): VF | null; + // tslint:disable-next-line interface-over-type-literal + type RegisteredConverter = { + type: string; + options?: object; + }; + // tslint:disable-next-line interface-over-type-literal + type RegisteredValidator = { + type: string; + options?: object; + }; +} +export interface Validator { + getHint?(): string | null; + validate(value: V): void; +} +export interface ValidatorError { + // constructor(summary: string, detail: string); + getMessage(): Message; +} +export interface ValidatorFactory { + // static VALIDATOR_TYPE_DATERESTRICTION: string; + // static VALIDATOR_TYPE_DATETIMERANGE: string; + // static VALIDATOR_TYPE_LENGTH: string; + // static VALIDATOR_TYPE_NUMBERRANGE: string; + // static VALIDATOR_TYPE_REGEXP: string; + // static VALIDATOR_TYPE_REQUIRED: string; + createValidator(options: object | null): Validator; +} diff --git a/types/oraclejet/ojvalidation-datetime/index.d.ts b/types/oraclejet/ojvalidation-datetime/index.d.ts new file mode 100644 index 0000000000..976969a002 --- /dev/null +++ b/types/oraclejet/ojvalidation-datetime/index.d.ts @@ -0,0 +1,130 @@ +import { Converter, Validator, Validation } from '../ojvalidation-base'; +export class DateRestrictionValidator implements Validator { + constructor(options?: DateRestrictionValidator.ValidatorOptions); + getHint(): string | null; + validate(value: string): void; +} +export namespace DateRestrictionValidator { + // tslint:disable-next-line interface-over-type-literal + type DayFormatterInput = { + fullYear: number; + month: number; + date: number; + }; + // tslint:disable-next-line interface-over-type-literal + type DayFormatterOutput = { + disabled?: boolean; + className?: string; + tooltip?: string; + }; + // tslint:disable-next-line interface-over-type-literal + type ValidatorOptions = { + dayFormatter?: ((param0: DayFormatterInput) => DayFormatterOutput | null | 'all'); + messageSummary?: string; + messageDetail?: string; + }; +} +export interface DateRestrictionValidatorFactory { + createValidator(options?: DateRestrictionValidator.ValidatorOptions): DateRestrictionValidator; +} +export abstract class DateTimeConverter implements Converter { + abstract calculateWeek(value: string): number | undefined; + compareISODates(isoStr: string, isoStr2: string): number; + format(value: string): string | null; + getAvailableTimeZones(): any[]; + abstract isDayNameSet(): boolean; + abstract isDaySet(): boolean; + abstract isHourInAMPMSet(): boolean; + abstract isHourInDaySet(): boolean; + abstract isMilliSecondSet(): boolean; + abstract isMinuteSet(): boolean; + abstract isMonthSet(): boolean; + abstract isSecondSet(): boolean; + abstract isYearSet(): boolean; + parse(value: string): string | null; +} +export interface DateTimeConverterFactory { + createConverter(options?: IntlDateTimeConverter.ConverterOptions): IntlDateTimeConverter; +} +export class DateTimeRangeValidator implements Validator { + constructor(options?: DateTimeRangeValidator.ValidatorOptions); + getHint(): string | null; + validate(value: string): void; +} +export namespace DateTimeRangeValidator { + // tslint:disable-next-line interface-over-type-literal + type ValidatorOptions = { + converter: DateTimeConverter; + min?: string; + max?: string; + hint?: { + max?: string; + min?: string; + inRange?: string; + }; + translationKey?: string; + messageDetail?: { + rangeUnderflow?: string; + rangeOverflow?: string; + }; + messageSummary?: { + rangeUnderflow?: string; + rangeOverflow?: string; + }; + }; +} +export interface DateTimeRangeValidatorFactory { + createValidator(options?: DateTimeRangeValidator.ValidatorOptions): DateTimeRangeValidator; +} +export class IntlDateTimeConverter extends DateTimeConverter { + constructor(options?: IntlDateTimeConverter.ConverterOptions); + calculateWeek(value: string): number; + compareISODates(isoStr: string, isoStr2: string): number; + format(value: string): string | null; + formatRelative(value: string, relativeOptions?: { + formatUsing?: string; + dateField?: string; + relativeTime?: string; + dateOnly?: boolean; + timeZone?: string; + }): string | null; + getAvailableTimeZones(): any[]; + getHint(): null; + getOptions(): IntlDateTimeConverter.ConverterOptions; + isDayNameSet(): boolean; + isDaySet(): boolean; + isHourInAMPMSet(): boolean; + isHourInDaySet(): boolean; + isMilliSecondSet(): boolean; + isMinuteSet(): boolean; + isMonthSet(): boolean; + isSecondSet(): boolean; + isYearSet(): boolean; + parse(value: string): string | null; + resolvedOptions(): IntlDateTimeConverter.ConverterOptions; +} +export namespace IntlDateTimeConverter { + // tslint:disable-next-line interface-over-type-literal + type ConverterOptions = { + year?: '2-digit' | 'numeric'; + 'two-digit-year-start'?: number; + month?: '2-digit' | 'numeric' | 'narrow' | 'short' | 'long'; + day?: '2-digit' | 'numeric'; + hour?: '2-digit' | 'numeric'; + minute?: '2-digit' | 'numeric'; + second?: '2-digit' | 'numeric'; + millisecond?: 'numeric'; + weekday?: 'narrow' | 'short' | 'long'; + era?: 'narrow' | 'short' | 'long'; + timeZoneName?: 'short' | 'long'; + timeZone?: string; + isoStrFormat?: 'offset' | 'zulu' | 'local' | 'auto'; + dst?: boolean; + hour12?: boolean; + pattern?: string; + formatType?: 'date' | 'time' | 'datetime'; + dateFormat?: 'short' | 'medium' | 'long' | 'full'; + timeFormat?: 'short' | 'medium' | 'long' | 'full'; + lenientParse?: 'full' | 'none'; + }; +} diff --git a/types/oraclejet/ojvalidation-number/index.d.ts b/types/oraclejet/ojvalidation-number/index.d.ts new file mode 100644 index 0000000000..09addc6522 --- /dev/null +++ b/types/oraclejet/ojvalidation-number/index.d.ts @@ -0,0 +1,67 @@ +import { Converter, Validator, Validation } from '../ojvalidation-base'; +export class IntlNumberConverter extends NumberConverter { + constructor(options?: IntlNumberConverter.ConverterOptions); + format(value: number): string; + getHint(): null; + getOptions(): IntlNumberConverter.ConverterOptions; + parse(value: string): number | null; + resolvedOptions(): IntlNumberConverter.ConverterOptions; +} +export namespace IntlNumberConverter { + // tslint:disable-next-line interface-over-type-literal + type ConverterOptions = { + style?: 'decimal' | 'currency' | 'percent' | 'unit'; + currency?: string; + unit?: 'byte' | 'bit'; + currencyDisplay?: 'code' | 'symbol' | 'name'; + decimalFormat?: 'standard' | 'short' | 'long'; + currencyFormat?: 'standard' | 'short' | 'long'; + minimumIntegerDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + useGrouping?: boolean; + pattern?: string; + roundingMode?: 'HALF_UP' | 'HALF_DOWN' | 'HALF_EVEN'; + roundDuringParse?: boolean; + separators?: object; + lenientParse?: 'full' | 'none'; + }; +} +export class NumberConverter implements Converter { + format(value: number): string | null; + parse(value: string): number | null; +} +export interface NumberConverterFactory { + createConverter(options?: IntlNumberConverter.ConverterOptions): IntlNumberConverter; +} +export class NumberRangeValidator implements Validator { + constructor(options?: NumberRangeValidator.ValidatorOptions); + getHint(): string | null; + validate(value: string | number): void; +} +export namespace NumberRangeValidator { + // tslint:disable-next-line interface-over-type-literal + type ValidatorOptions = { + converter?: NumberConverter; + min?: number; + max?: number; + hint?: { + max?: string; + min?: string; + inRange?: string; + exact?: string; + }; + messageDetail?: { + rangeUnderflow?: string; + rangeOverflow?: string; + exact?: string; + }; + messageSummary?: { + rangeUnderflow?: string; + rangeOverflow?: string; + }; + }; +} +export interface NumberRangeValidatorFactory { + createValidator(options?: NumberRangeValidator.ValidatorOptions): NumberRangeValidator; +} diff --git a/types/oraclejet/ojvalidationgroup/index.d.ts b/types/oraclejet/ojvalidationgroup/index.d.ts new file mode 100644 index 0000000000..e5dceb249a --- /dev/null +++ b/types/oraclejet/ojvalidationgroup/index.d.ts @@ -0,0 +1,23 @@ +import { JetElement, JetSettableProperties, JetElementCustomEvent, JetSetPropertyType } from '..'; +export interface ojValidationGroup extends JetElement { + readonly valid: 'valid' | 'pending' | 'invalidHidden' | 'invalidShown'; + onValidChanged: ((event: JetElementCustomEvent) => any) | null; + addEventListener(type: T, listener: (this: HTMLElement, ev: ojValidationGroupEventMap[T]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + getProperty(property: T): ojValidationGroup[T]; + getProperty(property: string): any; + setProperty(property: T, value: ojValidationGroupSettableProperties[T]): void; + setProperty(property: T, value: JetSetPropertyType): void; + setProperties(properties: ojValidationGroupSettablePropertiesLenient): void; + focusOn(key?: '@firstInvalidShown'): void; + showMessages(): void; +} +export interface ojValidationGroupEventMap extends HTMLElementEventMap { + 'validChanged': JetElementCustomEvent; +} +export interface ojValidationGroupSettableProperties extends JetSettableProperties { + readonly valid: 'valid' | 'pending' | 'invalidHidden' | 'invalidShown'; +} +export interface ojValidationGroupSettablePropertiesLenient extends Partial { + [key: string]: any; +} diff --git a/types/oraclejet/test.ts b/types/oraclejet/test.ts new file mode 100644 index 0000000000..265c0d4856 --- /dev/null +++ b/types/oraclejet/test.ts @@ -0,0 +1,113 @@ +// Since all the definitions are auto generated from jsdoc doclets and internally tested through application, +// add some basic tests here. +import { ojAccordion } from "oraclejet/ojaccordion"; +import AnimationUtils = require("oraclejet/ojanimation"); +import ArrayDataProvider = require("oraclejet/ojarraydataprovider"); +import ArrayTreeDataProvider = require("oraclejet/ojarraytreedataprovider"); +import { AttributeGroupHandler, ColorAttributeGroupHandler, ShapeAttributeGroupHandler } from 'oraclejet/ojattributegrouphandler'; +import { ojAvatar } from "oraclejet/ojavatar"; +import { ojButton, ojButtonsetMany, ojButtonsetOne } from "oraclejet/ojbutton"; +import { ojChart, ojChartGroup, ojChartItem, ojChartSeries, ojSparkChart, ojSparkChartItem } from "oraclejet/ojchart"; +import { ojCheckboxset } from "oraclejet/ojcheckboxset"; +import { ojCollapsible } from "oraclejet/ojcollapsible"; +import CollectionDataprovider = require("oraclejet/ojcollectiondataprovider"); +import Color = require("oraclejet/ojcolor"); +import { ojColorPalette } from "oraclejet/ojcolorpalette"; +import { ojColorSpectrum } from "oraclejet/ojcolorspectrum"; +import Components = require("oraclejet/ojcomponentcore"); +import Composite = require("oraclejet/ojcomposite"); +import Config = require('oraclejet/ojconfig'); +import Context = require("oraclejet/ojcontext"); +import { ojConveyorBelt } from "oraclejet/ojconveyorbelt"; +import { ojDataGrid } from "oraclejet/ojdatagrid"; +import { DataMapping, DataProvider, DataProviderAddOperationEventDetail, DataProviderMutationEventDetail, DataProviderOperationEventDetail } from "oraclejet/ojdataprovider"; +import { ojDatePicker, ojDateTimePicker, ojInputDate, ojInputDateTime, ojInputTime } from "oraclejet/ojdatetimepicker"; +import { ojDefer } from "oraclejet/ojdefer"; +import DeferredDataprovider = require("oraclejet/ojdeferreddataprovider"); +import { ojDiagram, ojDiagramLink, ojDiagramNode } from "oraclejet/ojdiagram"; +import { ojDialog } from "oraclejet/ojdialog"; +import { dvtBaseComponent } from "oraclejet/ojdvt-base"; +import { editableValue } from "oraclejet/ojeditablevalue"; +import ExpressionUtils = require('oraclejet/ojexpressionutils'); +import { ojFilePicker, FileUploadTransport } from "oraclejet/ojfilepicker"; +import { ojFilmStrip } from "oraclejet/ojfilmstrip"; +import { ojFormLayout } from "oraclejet/ojformlayout"; +import { ojGantt, ojGanttRow, ojGanttTask, ojGanttDependency } from "oraclejet/ojgantt"; +import GanttUtils = require ('oraclejet/ojganttutils'); +import { ojLedGauge, ojRatingGauge, ojStatusMeterGauge } from "oraclejet/ojgauge"; +import { ojInputNumber } from "oraclejet/ojinputnumber"; +import { ojInputPassword, ojInputText, ojTextArea } from "oraclejet/ojinputtext"; +import { KeySet, ExpandAllKeySet, ExpandedKeySet } from "oraclejet/ojkeyset"; +import { ObservableExpandedKeySet } from "oraclejet/ojknockout-keyset"; +import KnockoutUtils = require("oraclejet/ojknockout-model"); +import KnockoutTemplateUtils = require('oraclejet/ojknockouttemplateutils'); +import { ojLabel } from "oraclejet/ojlabel"; +import { ojLabelValue } from "oraclejet/ojlabelvalue"; +import { ojLegend } from "oraclejet/ojlegend"; +import ListDataProviderView = require("oraclejet/ojlistdataproviderview"); +import { ojListView } from "oraclejet/ojlistview"; +import LocaleData = require('oraclejet/ojlocaledata'); +import Logger = require('oraclejet/ojlogger'); +import { ojMasonryLayout } from "oraclejet/ojmasonrylayout"; +import { ojMenu } from "oraclejet/ojmenu"; +import { ojMenuSelectMany } from "oraclejet/ojmenuselectmany"; +import { ojMessages } from "oraclejet/ojmessages"; +import { ojMessage } from "oraclejet/ojmessage"; +import Message = require("oraclejet/ojmessaging"); +import { Collection, Model, URLError, OAuth } from "oraclejet/ojmodel"; +import { ojModule } from "oraclejet/ojmodule-element"; +import ModuleElementUtils = require("oraclejet/ojmodule-element-utils"); +import ModuleAnimations = require("oraclejet/ojmoduleanimations") ; +import { ojNavigationList, ojTabBar } from "oraclejet/ojnavigationlist"; +import { ojNBox } from "oraclejet/ojnbox"; +import { ojOptgroup } from "oraclejet/ojoptgroup"; +import { ojOption } from "oraclejet/ojoption"; +import { ojPictoChart, ojPictoChartItem } from "oraclejet/ojpictochart"; +import { ojPopup } from "oraclejet/ojpopup"; +import { ojProgress } from "oraclejet/ojprogress"; +import { ojProgressList, ProgressItem } from "oraclejet/ojprogresslist"; +import PullToRefreshUtils = require("oraclejet/ojpulltorefresh"); +import { ojRadioset } from "oraclejet/ojradioset"; +import { ojRefresher } from "oraclejet/ojrefresher"; +import ResponsiveKnockoutUtils = require('oraclejet/ojresponsiveknockoututils'); +import ResponsiveUtils = require('oraclejet/ojresponsiveutils'); +import Router = require("oraclejet/ojrouter"); +import { ojComboboxOne, ojComboboxMany, ojSelectOne, ojSelectMany } from "oraclejet/ojselectcombobox"; +import { ojSlider } from "oraclejet/ojslider"; +import { ojSunburst } from "oraclejet/ojsunburst"; +import { ojSwipeActions } from "oraclejet/ojswipeactions"; +import SwipeToRevealUtils = require("oraclejet/ojswipetoreveal"); +import { ojSwitch } from "oraclejet/ojswitch"; +import { ojSwitcher } from "oraclejet/ojswitcher"; +import { ojTable } from "oraclejet/ojtable"; +import { ojTagCloud } from "oraclejet/ojtagcloud"; +import { ojThematicMap } from "oraclejet/ojthematicmap"; +import ThemeUtils = require('oraclejet/ojthemeutils'); +import { dvtTimeComponent } from "oraclejet/ojtime-base"; +import { ojTimeAxis } from "oraclejet/ojtimeaxis"; +import TimeUtils = require("oraclejet/ojtimeutils"); +import { ojToolbar } from "oraclejet/ojtoolbar"; +import { ojTrain } from "oraclejet/ojtrain"; +import Translations = require("oraclejet/ojtranslation"); +import TreeDataProvider = require("oraclejet/ojtreedataprovider"); +import { ojTreemap } from "oraclejet/ojtreemap"; +import { Validation, Validator, ValidatorError, ValidatorFactory, + AsyncValidator, LengthValidator, LengthValidatorFactory, RegExpValidator, RegExpValidatorFactory, RequiredValidator, RequiredValidatorFactory } from "oraclejet/ojvalidation-base"; +import { DateRestrictionValidator, DateRestrictionValidatorFactory, DateTimeRangeValidator, DateTimeRangeValidatorFactory } from "oraclejet/ojvalidation-datetime"; +import { NumberRangeValidator, NumberRangeValidatorFactory } from "oraclejet/ojvalidation-number"; +import { ojValidationGroup } from "oraclejet/ojvalidationgroup"; + +const onChangedCallback = (event: CustomEvent) => { +}; +const myHTMLElement = document.getElementById('myelement'); +const accordionElement = myHTMLElement as ojAccordion; +accordionElement.multiple = true; +accordionElement.onMultipleChanged = onChangedCallback; + +const avatarElement = myHTMLElement as ojAvatar; +avatarElement.size = "xxs"; +avatarElement.set("initials", "I"); +avatarElement.unset("src"); + +const button = myHTMLElement as ojButtonsetOne; +button.chroming = 'half'; diff --git a/types/@oracle/tsconfig.json b/types/oraclejet/tsconfig.json similarity index 68% rename from types/@oracle/tsconfig.json rename to types/oraclejet/tsconfig.json index 812f56815d..ec0aacc788 100644 --- a/types/@oracle/tsconfig.json +++ b/types/oraclejet/tsconfig.json @@ -1,20 +1,23 @@ { "compileOnSave": true, "compilerOptions": { - "module": "amd", + "module": "commonjs", "lib": ["dom","es5","scripthost", "es2015.core","es2015.collection","es2015","esnext.asynciterable"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "types": ["knockout"], + "types": [], "forceConsistentCasingInFileNames": true, "noEmit": true, "target": "es5", - "typeRoots": ["../","./oraclejet/","./oraclejet/ojs/"] + "baseUrl": "../", + "typeRoots": [ + "../" + ] }, "include": [ - "/tests/oraclejet/@oraclejet-tests.ts", - "./oraclejet/**/*" + "/test.ts", + "./**/*" ] } \ No newline at end of file diff --git a/types/oraclejet/tslint.json b/types/oraclejet/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/oraclejet/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 3748e4ecbf9ac5489708e661b03b6bd304670480 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 19:34:08 -0700 Subject: [PATCH 013/646] npm test fail fix --- types/oraclejet/tsconfig.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/types/oraclejet/tsconfig.json b/types/oraclejet/tsconfig.json index ec0aacc788..bd455a55c1 100644 --- a/types/oraclejet/tsconfig.json +++ b/types/oraclejet/tsconfig.json @@ -15,9 +15,5 @@ "typeRoots": [ "../" ] - }, - "include": [ - "/test.ts", - "./**/*" - ] + } } \ No newline at end of file From e0149686eb0f9be448e59ea917039e732189bd74 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 20:16:07 -0700 Subject: [PATCH 014/646] fix npm test error --- types/oraclejet/tsconfig.json | 101 +++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/types/oraclejet/tsconfig.json b/types/oraclejet/tsconfig.json index bd455a55c1..fc0ac3ac23 100644 --- a/types/oraclejet/tsconfig.json +++ b/types/oraclejet/tsconfig.json @@ -15,5 +15,104 @@ "typeRoots": [ "../" ] - } + }, + "files": [ + "test.ts", + "index.d.ts", + "ojaccordion/index.d.ts", + "ojanimation/index.d.ts", + "ojarraydataprovider/index.d.ts", + "ojarraytreedataprovider/index.d.ts", + "ojattributegrouphandler/index.d.ts", + "ojavatar/index.d.ts", + "ojbutton/index.d.ts", + "ojchart/index.d.ts", + "ojcheckboxset/index.d.ts", + "ojcollapsible/index.d.ts", + "ojcollectiondataprovider/index.d.ts", + "ojcolor/index.d.ts", + "ojcolorpalette/index.d.ts", + "ojcolorspectrum/index.d.ts", + "ojcomponentcore/index.d.ts", + "ojcomposite/index.d.ts", + "ojconfig/index.d.ts", + "ojcontext/index.d.ts", + "ojconveyorbelt/index.d.ts", + "ojdatagrid/index.d.ts", + "ojdataprovider/index.d.ts", + "ojdatetimepicker/index.d.ts", + "ojdefer/index.d.ts", + "ojdeferreddataprovider/index.d.ts", + "ojdiagram/index.d.ts", + "ojdialog/index.d.ts", + "ojdvt-base/index.d.ts", + "ojeditablevalue/index.d.ts", + "ojexpressionutils/index.d.ts", + "ojfilepicker/index.d.ts", + "ojfilmstrip/index.d.ts", + "ojformlayout/index.d.ts", + "ojgantt/index.d.ts", + "ojganttutils/index.d.ts", + "ojgauge/index.d.ts", + "ojinputnumber/index.d.ts", + "ojinputtext/index.d.ts", + "ojkeyset/index.d.ts", + "ojknockout-keyset/index.d.ts", + "ojknockout-model/index.d.ts", + "ojknockouttemplateutils/index.d.ts", + "ojlabel/index.d.ts", + "ojlabelvalue/index.d.ts", + "ojlegend/index.d.ts", + "ojlistdataproviderview/index.d.ts", + "ojlistview/index.d.ts", + "ojlocaledata/index.d.ts", + "ojlogger/index.d.ts", + "ojmasonrylayout/index.d.ts", + "ojmenu/index.d.ts", + "ojmenuselectmany/index.d.ts", + "ojmessage/index.d.ts", + "ojmessages/index.d.ts", + "ojmessaging/index.d.ts", + "ojmodel/index.d.ts", + "ojmodule-element/index.d.ts", + "ojmodule-element-utils/index.d.ts", + "ojmoduleanimations/index.d.ts", + "ojnavigationlist/index.d.ts", + "ojnbox/index.d.ts", + "ojoptgroup/index.d.ts", + "ojoption/index.d.ts", + "ojpictochart/index.d.ts", + "ojpopup/index.d.ts", + "ojprogress/index.d.ts", + "ojprogresslist/index.d.ts", + "ojpulltorefresh/index.d.ts", + "ojradioset/index.d.ts", + "ojrefresher/index.d.ts", + "ojresponsiveknockoututils/index.d.ts", + "ojresponsiveutils/index.d.ts", + "ojrouter/index.d.ts", + "ojselectcombobox/index.d.ts", + "ojslider/index.d.ts", + "ojsunburst/index.d.ts", + "ojswipeactions/index.d.ts", + "ojswipetoreveal/index.d.ts", + "ojswitch/index.d.ts", + "ojswitcher/index.d.ts", + "ojtable/index.d.ts", + "ojtagcloud/index.d.ts", + "ojthematicmap/index.d.ts", + "ojthemeutils/index.d.ts", + "ojtime-base/index.d.ts", + "ojtimeaxis/index.d.ts", + "ojtimeutils/index.d.ts", + "ojtoolbar/index.d.ts", + "ojtrain/index.d.ts", + "ojtranslation/index.d.ts", + "ojtreedataprovider/index.d.ts", + "ojtreemap/index.d.ts", + "ojvalidation-base/index.d.ts", + "ojvalidation-datetime/index.d.ts", + "ojvalidation-number/index.d.ts", + "ojvalidationgroup/index.d.ts" + ] } \ No newline at end of file From 9ec87fc09a4292fd38029de16e898320e72acc71 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 20:24:04 -0700 Subject: [PATCH 015/646] fix npm test --- types/oraclejet/{test.ts => oraclejetTests.ts} | 0 types/oraclejet/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/oraclejet/{test.ts => oraclejetTests.ts} (100%) diff --git a/types/oraclejet/test.ts b/types/oraclejet/oraclejetTests.ts similarity index 100% rename from types/oraclejet/test.ts rename to types/oraclejet/oraclejetTests.ts diff --git a/types/oraclejet/tsconfig.json b/types/oraclejet/tsconfig.json index fc0ac3ac23..3cecf0fb1d 100644 --- a/types/oraclejet/tsconfig.json +++ b/types/oraclejet/tsconfig.json @@ -17,7 +17,7 @@ ] }, "files": [ - "test.ts", + "oraclejetTests.ts", "index.d.ts", "ojaccordion/index.d.ts", "ojanimation/index.d.ts", From aac14f48d35b44015170cfd4e97d8d10e3fbcf10 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 20:25:34 -0700 Subject: [PATCH 016/646] fix npm test --- types/oraclejet/{oraclejetTests.ts => oraclejet-tests.ts} | 0 types/oraclejet/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/oraclejet/{oraclejetTests.ts => oraclejet-tests.ts} (100%) diff --git a/types/oraclejet/oraclejetTests.ts b/types/oraclejet/oraclejet-tests.ts similarity index 100% rename from types/oraclejet/oraclejetTests.ts rename to types/oraclejet/oraclejet-tests.ts diff --git a/types/oraclejet/tsconfig.json b/types/oraclejet/tsconfig.json index 3cecf0fb1d..e914883a1c 100644 --- a/types/oraclejet/tsconfig.json +++ b/types/oraclejet/tsconfig.json @@ -17,7 +17,7 @@ ] }, "files": [ - "oraclejetTests.ts", + "oraclejet-tests.ts", "index.d.ts", "ojaccordion/index.d.ts", "ojanimation/index.d.ts", From 9ce6b338d104bee241beceae99f488ea416ea011 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 20:57:31 -0700 Subject: [PATCH 017/646] test. move to scoped --- types/{oraclejet => oracle__oraclejet}/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojaccordion/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojanimation/index.d.ts | 0 .../ojarraydataprovider/index.d.ts | 0 .../ojarraytreedataprovider/index.d.ts | 0 .../ojattributegrouphandler/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojavatar/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojbutton/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojchart/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcheckboxset/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcollapsible/index.d.ts | 0 .../ojcollectiondataprovider/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcolor/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcolorpalette/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcolorspectrum/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcomponentcore/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcomposite/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojconfig/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojcontext/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojconveyorbelt/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojdatagrid/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojdataprovider/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojdatetimepicker/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojdefer/index.d.ts | 0 .../ojdeferreddataprovider/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojdiagram/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojdialog/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojdvt-base/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojeditablevalue/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojexpressionutils/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojfilepicker/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojfilmstrip/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojformlayout/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojgantt/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojganttutils/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojgauge/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojinputnumber/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojinputtext/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojkeyset/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojknockout-keyset/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojknockout-model/index.d.ts | 0 .../ojknockouttemplateutils/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojlabel/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojlabelvalue/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojlegend/index.d.ts | 0 .../ojlistdataproviderview/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojlistview/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojlocaledata/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojlogger/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojmasonrylayout/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojmenu/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojmenuselectmany/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojmessage/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojmessages/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojmessaging/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojmodel/index.d.ts | 0 .../ojmodule-element-utils/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojmodule-element/index.d.ts | 0 .../ojmoduleanimations/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojnavigationlist/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojnbox/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojoptgroup/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojoption/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojpictochart/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojpopup/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojprogress/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojprogresslist/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojpulltorefresh/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojradioset/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojrefresher/index.d.ts | 0 .../ojresponsiveknockoututils/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojresponsiveutils/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojrouter/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojselectcombobox/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojslider/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojsunburst/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojswipeactions/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojswipetoreveal/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojswitch/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojswitcher/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtable/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtagcloud/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojthematicmap/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojthemeutils/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtime-base/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtimeaxis/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtimeutils/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtoolbar/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtrain/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtranslation/index.d.ts | 0 .../ojtreedataprovider/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/ojtreemap/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojvalidation-base/index.d.ts | 0 .../ojvalidation-datetime/index.d.ts | 0 .../ojvalidation-number/index.d.ts | 0 .../{oraclejet => oracle__oraclejet}/ojvalidationgroup/index.d.ts | 0 types/{oraclejet => oracle__oraclejet}/oraclejet-tests.ts | 0 types/{oraclejet => oracle__oraclejet}/tsconfig.json | 0 types/{oraclejet => oracle__oraclejet}/tslint.json | 0 99 files changed, 0 insertions(+), 0 deletions(-) rename types/{oraclejet => oracle__oraclejet}/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojaccordion/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojanimation/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojarraydataprovider/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojarraytreedataprovider/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojattributegrouphandler/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojavatar/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojbutton/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojchart/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcheckboxset/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcollapsible/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcollectiondataprovider/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcolor/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcolorpalette/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcolorspectrum/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcomponentcore/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcomposite/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojconfig/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojcontext/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojconveyorbelt/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdatagrid/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdataprovider/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdatetimepicker/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdefer/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdeferreddataprovider/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdiagram/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdialog/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojdvt-base/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojeditablevalue/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojexpressionutils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojfilepicker/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojfilmstrip/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojformlayout/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojgantt/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojganttutils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojgauge/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojinputnumber/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojinputtext/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojkeyset/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojknockout-keyset/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojknockout-model/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojknockouttemplateutils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojlabel/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojlabelvalue/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojlegend/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojlistdataproviderview/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojlistview/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojlocaledata/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojlogger/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmasonrylayout/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmenu/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmenuselectmany/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmessage/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmessages/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmessaging/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmodel/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmodule-element-utils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmodule-element/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojmoduleanimations/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojnavigationlist/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojnbox/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojoptgroup/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojoption/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojpictochart/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojpopup/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojprogress/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojprogresslist/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojpulltorefresh/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojradioset/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojrefresher/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojresponsiveknockoututils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojresponsiveutils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojrouter/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojselectcombobox/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojslider/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojsunburst/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojswipeactions/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojswipetoreveal/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojswitch/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojswitcher/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtable/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtagcloud/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojthematicmap/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojthemeutils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtime-base/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtimeaxis/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtimeutils/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtoolbar/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtrain/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtranslation/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtreedataprovider/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojtreemap/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojvalidation-base/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojvalidation-datetime/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojvalidation-number/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/ojvalidationgroup/index.d.ts (100%) rename types/{oraclejet => oracle__oraclejet}/oraclejet-tests.ts (100%) rename types/{oraclejet => oracle__oraclejet}/tsconfig.json (100%) rename types/{oraclejet => oracle__oraclejet}/tslint.json (100%) diff --git a/types/oraclejet/index.d.ts b/types/oracle__oraclejet/index.d.ts similarity index 100% rename from types/oraclejet/index.d.ts rename to types/oracle__oraclejet/index.d.ts diff --git a/types/oraclejet/ojaccordion/index.d.ts b/types/oracle__oraclejet/ojaccordion/index.d.ts similarity index 100% rename from types/oraclejet/ojaccordion/index.d.ts rename to types/oracle__oraclejet/ojaccordion/index.d.ts diff --git a/types/oraclejet/ojanimation/index.d.ts b/types/oracle__oraclejet/ojanimation/index.d.ts similarity index 100% rename from types/oraclejet/ojanimation/index.d.ts rename to types/oracle__oraclejet/ojanimation/index.d.ts diff --git a/types/oraclejet/ojarraydataprovider/index.d.ts b/types/oracle__oraclejet/ojarraydataprovider/index.d.ts similarity index 100% rename from types/oraclejet/ojarraydataprovider/index.d.ts rename to types/oracle__oraclejet/ojarraydataprovider/index.d.ts diff --git a/types/oraclejet/ojarraytreedataprovider/index.d.ts b/types/oracle__oraclejet/ojarraytreedataprovider/index.d.ts similarity index 100% rename from types/oraclejet/ojarraytreedataprovider/index.d.ts rename to types/oracle__oraclejet/ojarraytreedataprovider/index.d.ts diff --git a/types/oraclejet/ojattributegrouphandler/index.d.ts b/types/oracle__oraclejet/ojattributegrouphandler/index.d.ts similarity index 100% rename from types/oraclejet/ojattributegrouphandler/index.d.ts rename to types/oracle__oraclejet/ojattributegrouphandler/index.d.ts diff --git a/types/oraclejet/ojavatar/index.d.ts b/types/oracle__oraclejet/ojavatar/index.d.ts similarity index 100% rename from types/oraclejet/ojavatar/index.d.ts rename to types/oracle__oraclejet/ojavatar/index.d.ts diff --git a/types/oraclejet/ojbutton/index.d.ts b/types/oracle__oraclejet/ojbutton/index.d.ts similarity index 100% rename from types/oraclejet/ojbutton/index.d.ts rename to types/oracle__oraclejet/ojbutton/index.d.ts diff --git a/types/oraclejet/ojchart/index.d.ts b/types/oracle__oraclejet/ojchart/index.d.ts similarity index 100% rename from types/oraclejet/ojchart/index.d.ts rename to types/oracle__oraclejet/ojchart/index.d.ts diff --git a/types/oraclejet/ojcheckboxset/index.d.ts b/types/oracle__oraclejet/ojcheckboxset/index.d.ts similarity index 100% rename from types/oraclejet/ojcheckboxset/index.d.ts rename to types/oracle__oraclejet/ojcheckboxset/index.d.ts diff --git a/types/oraclejet/ojcollapsible/index.d.ts b/types/oracle__oraclejet/ojcollapsible/index.d.ts similarity index 100% rename from types/oraclejet/ojcollapsible/index.d.ts rename to types/oracle__oraclejet/ojcollapsible/index.d.ts diff --git a/types/oraclejet/ojcollectiondataprovider/index.d.ts b/types/oracle__oraclejet/ojcollectiondataprovider/index.d.ts similarity index 100% rename from types/oraclejet/ojcollectiondataprovider/index.d.ts rename to types/oracle__oraclejet/ojcollectiondataprovider/index.d.ts diff --git a/types/oraclejet/ojcolor/index.d.ts b/types/oracle__oraclejet/ojcolor/index.d.ts similarity index 100% rename from types/oraclejet/ojcolor/index.d.ts rename to types/oracle__oraclejet/ojcolor/index.d.ts diff --git a/types/oraclejet/ojcolorpalette/index.d.ts b/types/oracle__oraclejet/ojcolorpalette/index.d.ts similarity index 100% rename from types/oraclejet/ojcolorpalette/index.d.ts rename to types/oracle__oraclejet/ojcolorpalette/index.d.ts diff --git a/types/oraclejet/ojcolorspectrum/index.d.ts b/types/oracle__oraclejet/ojcolorspectrum/index.d.ts similarity index 100% rename from types/oraclejet/ojcolorspectrum/index.d.ts rename to types/oracle__oraclejet/ojcolorspectrum/index.d.ts diff --git a/types/oraclejet/ojcomponentcore/index.d.ts b/types/oracle__oraclejet/ojcomponentcore/index.d.ts similarity index 100% rename from types/oraclejet/ojcomponentcore/index.d.ts rename to types/oracle__oraclejet/ojcomponentcore/index.d.ts diff --git a/types/oraclejet/ojcomposite/index.d.ts b/types/oracle__oraclejet/ojcomposite/index.d.ts similarity index 100% rename from types/oraclejet/ojcomposite/index.d.ts rename to types/oracle__oraclejet/ojcomposite/index.d.ts diff --git a/types/oraclejet/ojconfig/index.d.ts b/types/oracle__oraclejet/ojconfig/index.d.ts similarity index 100% rename from types/oraclejet/ojconfig/index.d.ts rename to types/oracle__oraclejet/ojconfig/index.d.ts diff --git a/types/oraclejet/ojcontext/index.d.ts b/types/oracle__oraclejet/ojcontext/index.d.ts similarity index 100% rename from types/oraclejet/ojcontext/index.d.ts rename to types/oracle__oraclejet/ojcontext/index.d.ts diff --git a/types/oraclejet/ojconveyorbelt/index.d.ts b/types/oracle__oraclejet/ojconveyorbelt/index.d.ts similarity index 100% rename from types/oraclejet/ojconveyorbelt/index.d.ts rename to types/oracle__oraclejet/ojconveyorbelt/index.d.ts diff --git a/types/oraclejet/ojdatagrid/index.d.ts b/types/oracle__oraclejet/ojdatagrid/index.d.ts similarity index 100% rename from types/oraclejet/ojdatagrid/index.d.ts rename to types/oracle__oraclejet/ojdatagrid/index.d.ts diff --git a/types/oraclejet/ojdataprovider/index.d.ts b/types/oracle__oraclejet/ojdataprovider/index.d.ts similarity index 100% rename from types/oraclejet/ojdataprovider/index.d.ts rename to types/oracle__oraclejet/ojdataprovider/index.d.ts diff --git a/types/oraclejet/ojdatetimepicker/index.d.ts b/types/oracle__oraclejet/ojdatetimepicker/index.d.ts similarity index 100% rename from types/oraclejet/ojdatetimepicker/index.d.ts rename to types/oracle__oraclejet/ojdatetimepicker/index.d.ts diff --git a/types/oraclejet/ojdefer/index.d.ts b/types/oracle__oraclejet/ojdefer/index.d.ts similarity index 100% rename from types/oraclejet/ojdefer/index.d.ts rename to types/oracle__oraclejet/ojdefer/index.d.ts diff --git a/types/oraclejet/ojdeferreddataprovider/index.d.ts b/types/oracle__oraclejet/ojdeferreddataprovider/index.d.ts similarity index 100% rename from types/oraclejet/ojdeferreddataprovider/index.d.ts rename to types/oracle__oraclejet/ojdeferreddataprovider/index.d.ts diff --git a/types/oraclejet/ojdiagram/index.d.ts b/types/oracle__oraclejet/ojdiagram/index.d.ts similarity index 100% rename from types/oraclejet/ojdiagram/index.d.ts rename to types/oracle__oraclejet/ojdiagram/index.d.ts diff --git a/types/oraclejet/ojdialog/index.d.ts b/types/oracle__oraclejet/ojdialog/index.d.ts similarity index 100% rename from types/oraclejet/ojdialog/index.d.ts rename to types/oracle__oraclejet/ojdialog/index.d.ts diff --git a/types/oraclejet/ojdvt-base/index.d.ts b/types/oracle__oraclejet/ojdvt-base/index.d.ts similarity index 100% rename from types/oraclejet/ojdvt-base/index.d.ts rename to types/oracle__oraclejet/ojdvt-base/index.d.ts diff --git a/types/oraclejet/ojeditablevalue/index.d.ts b/types/oracle__oraclejet/ojeditablevalue/index.d.ts similarity index 100% rename from types/oraclejet/ojeditablevalue/index.d.ts rename to types/oracle__oraclejet/ojeditablevalue/index.d.ts diff --git a/types/oraclejet/ojexpressionutils/index.d.ts b/types/oracle__oraclejet/ojexpressionutils/index.d.ts similarity index 100% rename from types/oraclejet/ojexpressionutils/index.d.ts rename to types/oracle__oraclejet/ojexpressionutils/index.d.ts diff --git a/types/oraclejet/ojfilepicker/index.d.ts b/types/oracle__oraclejet/ojfilepicker/index.d.ts similarity index 100% rename from types/oraclejet/ojfilepicker/index.d.ts rename to types/oracle__oraclejet/ojfilepicker/index.d.ts diff --git a/types/oraclejet/ojfilmstrip/index.d.ts b/types/oracle__oraclejet/ojfilmstrip/index.d.ts similarity index 100% rename from types/oraclejet/ojfilmstrip/index.d.ts rename to types/oracle__oraclejet/ojfilmstrip/index.d.ts diff --git a/types/oraclejet/ojformlayout/index.d.ts b/types/oracle__oraclejet/ojformlayout/index.d.ts similarity index 100% rename from types/oraclejet/ojformlayout/index.d.ts rename to types/oracle__oraclejet/ojformlayout/index.d.ts diff --git a/types/oraclejet/ojgantt/index.d.ts b/types/oracle__oraclejet/ojgantt/index.d.ts similarity index 100% rename from types/oraclejet/ojgantt/index.d.ts rename to types/oracle__oraclejet/ojgantt/index.d.ts diff --git a/types/oraclejet/ojganttutils/index.d.ts b/types/oracle__oraclejet/ojganttutils/index.d.ts similarity index 100% rename from types/oraclejet/ojganttutils/index.d.ts rename to types/oracle__oraclejet/ojganttutils/index.d.ts diff --git a/types/oraclejet/ojgauge/index.d.ts b/types/oracle__oraclejet/ojgauge/index.d.ts similarity index 100% rename from types/oraclejet/ojgauge/index.d.ts rename to types/oracle__oraclejet/ojgauge/index.d.ts diff --git a/types/oraclejet/ojinputnumber/index.d.ts b/types/oracle__oraclejet/ojinputnumber/index.d.ts similarity index 100% rename from types/oraclejet/ojinputnumber/index.d.ts rename to types/oracle__oraclejet/ojinputnumber/index.d.ts diff --git a/types/oraclejet/ojinputtext/index.d.ts b/types/oracle__oraclejet/ojinputtext/index.d.ts similarity index 100% rename from types/oraclejet/ojinputtext/index.d.ts rename to types/oracle__oraclejet/ojinputtext/index.d.ts diff --git a/types/oraclejet/ojkeyset/index.d.ts b/types/oracle__oraclejet/ojkeyset/index.d.ts similarity index 100% rename from types/oraclejet/ojkeyset/index.d.ts rename to types/oracle__oraclejet/ojkeyset/index.d.ts diff --git a/types/oraclejet/ojknockout-keyset/index.d.ts b/types/oracle__oraclejet/ojknockout-keyset/index.d.ts similarity index 100% rename from types/oraclejet/ojknockout-keyset/index.d.ts rename to types/oracle__oraclejet/ojknockout-keyset/index.d.ts diff --git a/types/oraclejet/ojknockout-model/index.d.ts b/types/oracle__oraclejet/ojknockout-model/index.d.ts similarity index 100% rename from types/oraclejet/ojknockout-model/index.d.ts rename to types/oracle__oraclejet/ojknockout-model/index.d.ts diff --git a/types/oraclejet/ojknockouttemplateutils/index.d.ts b/types/oracle__oraclejet/ojknockouttemplateutils/index.d.ts similarity index 100% rename from types/oraclejet/ojknockouttemplateutils/index.d.ts rename to types/oracle__oraclejet/ojknockouttemplateutils/index.d.ts diff --git a/types/oraclejet/ojlabel/index.d.ts b/types/oracle__oraclejet/ojlabel/index.d.ts similarity index 100% rename from types/oraclejet/ojlabel/index.d.ts rename to types/oracle__oraclejet/ojlabel/index.d.ts diff --git a/types/oraclejet/ojlabelvalue/index.d.ts b/types/oracle__oraclejet/ojlabelvalue/index.d.ts similarity index 100% rename from types/oraclejet/ojlabelvalue/index.d.ts rename to types/oracle__oraclejet/ojlabelvalue/index.d.ts diff --git a/types/oraclejet/ojlegend/index.d.ts b/types/oracle__oraclejet/ojlegend/index.d.ts similarity index 100% rename from types/oraclejet/ojlegend/index.d.ts rename to types/oracle__oraclejet/ojlegend/index.d.ts diff --git a/types/oraclejet/ojlistdataproviderview/index.d.ts b/types/oracle__oraclejet/ojlistdataproviderview/index.d.ts similarity index 100% rename from types/oraclejet/ojlistdataproviderview/index.d.ts rename to types/oracle__oraclejet/ojlistdataproviderview/index.d.ts diff --git a/types/oraclejet/ojlistview/index.d.ts b/types/oracle__oraclejet/ojlistview/index.d.ts similarity index 100% rename from types/oraclejet/ojlistview/index.d.ts rename to types/oracle__oraclejet/ojlistview/index.d.ts diff --git a/types/oraclejet/ojlocaledata/index.d.ts b/types/oracle__oraclejet/ojlocaledata/index.d.ts similarity index 100% rename from types/oraclejet/ojlocaledata/index.d.ts rename to types/oracle__oraclejet/ojlocaledata/index.d.ts diff --git a/types/oraclejet/ojlogger/index.d.ts b/types/oracle__oraclejet/ojlogger/index.d.ts similarity index 100% rename from types/oraclejet/ojlogger/index.d.ts rename to types/oracle__oraclejet/ojlogger/index.d.ts diff --git a/types/oraclejet/ojmasonrylayout/index.d.ts b/types/oracle__oraclejet/ojmasonrylayout/index.d.ts similarity index 100% rename from types/oraclejet/ojmasonrylayout/index.d.ts rename to types/oracle__oraclejet/ojmasonrylayout/index.d.ts diff --git a/types/oraclejet/ojmenu/index.d.ts b/types/oracle__oraclejet/ojmenu/index.d.ts similarity index 100% rename from types/oraclejet/ojmenu/index.d.ts rename to types/oracle__oraclejet/ojmenu/index.d.ts diff --git a/types/oraclejet/ojmenuselectmany/index.d.ts b/types/oracle__oraclejet/ojmenuselectmany/index.d.ts similarity index 100% rename from types/oraclejet/ojmenuselectmany/index.d.ts rename to types/oracle__oraclejet/ojmenuselectmany/index.d.ts diff --git a/types/oraclejet/ojmessage/index.d.ts b/types/oracle__oraclejet/ojmessage/index.d.ts similarity index 100% rename from types/oraclejet/ojmessage/index.d.ts rename to types/oracle__oraclejet/ojmessage/index.d.ts diff --git a/types/oraclejet/ojmessages/index.d.ts b/types/oracle__oraclejet/ojmessages/index.d.ts similarity index 100% rename from types/oraclejet/ojmessages/index.d.ts rename to types/oracle__oraclejet/ojmessages/index.d.ts diff --git a/types/oraclejet/ojmessaging/index.d.ts b/types/oracle__oraclejet/ojmessaging/index.d.ts similarity index 100% rename from types/oraclejet/ojmessaging/index.d.ts rename to types/oracle__oraclejet/ojmessaging/index.d.ts diff --git a/types/oraclejet/ojmodel/index.d.ts b/types/oracle__oraclejet/ojmodel/index.d.ts similarity index 100% rename from types/oraclejet/ojmodel/index.d.ts rename to types/oracle__oraclejet/ojmodel/index.d.ts diff --git a/types/oraclejet/ojmodule-element-utils/index.d.ts b/types/oracle__oraclejet/ojmodule-element-utils/index.d.ts similarity index 100% rename from types/oraclejet/ojmodule-element-utils/index.d.ts rename to types/oracle__oraclejet/ojmodule-element-utils/index.d.ts diff --git a/types/oraclejet/ojmodule-element/index.d.ts b/types/oracle__oraclejet/ojmodule-element/index.d.ts similarity index 100% rename from types/oraclejet/ojmodule-element/index.d.ts rename to types/oracle__oraclejet/ojmodule-element/index.d.ts diff --git a/types/oraclejet/ojmoduleanimations/index.d.ts b/types/oracle__oraclejet/ojmoduleanimations/index.d.ts similarity index 100% rename from types/oraclejet/ojmoduleanimations/index.d.ts rename to types/oracle__oraclejet/ojmoduleanimations/index.d.ts diff --git a/types/oraclejet/ojnavigationlist/index.d.ts b/types/oracle__oraclejet/ojnavigationlist/index.d.ts similarity index 100% rename from types/oraclejet/ojnavigationlist/index.d.ts rename to types/oracle__oraclejet/ojnavigationlist/index.d.ts diff --git a/types/oraclejet/ojnbox/index.d.ts b/types/oracle__oraclejet/ojnbox/index.d.ts similarity index 100% rename from types/oraclejet/ojnbox/index.d.ts rename to types/oracle__oraclejet/ojnbox/index.d.ts diff --git a/types/oraclejet/ojoptgroup/index.d.ts b/types/oracle__oraclejet/ojoptgroup/index.d.ts similarity index 100% rename from types/oraclejet/ojoptgroup/index.d.ts rename to types/oracle__oraclejet/ojoptgroup/index.d.ts diff --git a/types/oraclejet/ojoption/index.d.ts b/types/oracle__oraclejet/ojoption/index.d.ts similarity index 100% rename from types/oraclejet/ojoption/index.d.ts rename to types/oracle__oraclejet/ojoption/index.d.ts diff --git a/types/oraclejet/ojpictochart/index.d.ts b/types/oracle__oraclejet/ojpictochart/index.d.ts similarity index 100% rename from types/oraclejet/ojpictochart/index.d.ts rename to types/oracle__oraclejet/ojpictochart/index.d.ts diff --git a/types/oraclejet/ojpopup/index.d.ts b/types/oracle__oraclejet/ojpopup/index.d.ts similarity index 100% rename from types/oraclejet/ojpopup/index.d.ts rename to types/oracle__oraclejet/ojpopup/index.d.ts diff --git a/types/oraclejet/ojprogress/index.d.ts b/types/oracle__oraclejet/ojprogress/index.d.ts similarity index 100% rename from types/oraclejet/ojprogress/index.d.ts rename to types/oracle__oraclejet/ojprogress/index.d.ts diff --git a/types/oraclejet/ojprogresslist/index.d.ts b/types/oracle__oraclejet/ojprogresslist/index.d.ts similarity index 100% rename from types/oraclejet/ojprogresslist/index.d.ts rename to types/oracle__oraclejet/ojprogresslist/index.d.ts diff --git a/types/oraclejet/ojpulltorefresh/index.d.ts b/types/oracle__oraclejet/ojpulltorefresh/index.d.ts similarity index 100% rename from types/oraclejet/ojpulltorefresh/index.d.ts rename to types/oracle__oraclejet/ojpulltorefresh/index.d.ts diff --git a/types/oraclejet/ojradioset/index.d.ts b/types/oracle__oraclejet/ojradioset/index.d.ts similarity index 100% rename from types/oraclejet/ojradioset/index.d.ts rename to types/oracle__oraclejet/ojradioset/index.d.ts diff --git a/types/oraclejet/ojrefresher/index.d.ts b/types/oracle__oraclejet/ojrefresher/index.d.ts similarity index 100% rename from types/oraclejet/ojrefresher/index.d.ts rename to types/oracle__oraclejet/ojrefresher/index.d.ts diff --git a/types/oraclejet/ojresponsiveknockoututils/index.d.ts b/types/oracle__oraclejet/ojresponsiveknockoututils/index.d.ts similarity index 100% rename from types/oraclejet/ojresponsiveknockoututils/index.d.ts rename to types/oracle__oraclejet/ojresponsiveknockoututils/index.d.ts diff --git a/types/oraclejet/ojresponsiveutils/index.d.ts b/types/oracle__oraclejet/ojresponsiveutils/index.d.ts similarity index 100% rename from types/oraclejet/ojresponsiveutils/index.d.ts rename to types/oracle__oraclejet/ojresponsiveutils/index.d.ts diff --git a/types/oraclejet/ojrouter/index.d.ts b/types/oracle__oraclejet/ojrouter/index.d.ts similarity index 100% rename from types/oraclejet/ojrouter/index.d.ts rename to types/oracle__oraclejet/ojrouter/index.d.ts diff --git a/types/oraclejet/ojselectcombobox/index.d.ts b/types/oracle__oraclejet/ojselectcombobox/index.d.ts similarity index 100% rename from types/oraclejet/ojselectcombobox/index.d.ts rename to types/oracle__oraclejet/ojselectcombobox/index.d.ts diff --git a/types/oraclejet/ojslider/index.d.ts b/types/oracle__oraclejet/ojslider/index.d.ts similarity index 100% rename from types/oraclejet/ojslider/index.d.ts rename to types/oracle__oraclejet/ojslider/index.d.ts diff --git a/types/oraclejet/ojsunburst/index.d.ts b/types/oracle__oraclejet/ojsunburst/index.d.ts similarity index 100% rename from types/oraclejet/ojsunburst/index.d.ts rename to types/oracle__oraclejet/ojsunburst/index.d.ts diff --git a/types/oraclejet/ojswipeactions/index.d.ts b/types/oracle__oraclejet/ojswipeactions/index.d.ts similarity index 100% rename from types/oraclejet/ojswipeactions/index.d.ts rename to types/oracle__oraclejet/ojswipeactions/index.d.ts diff --git a/types/oraclejet/ojswipetoreveal/index.d.ts b/types/oracle__oraclejet/ojswipetoreveal/index.d.ts similarity index 100% rename from types/oraclejet/ojswipetoreveal/index.d.ts rename to types/oracle__oraclejet/ojswipetoreveal/index.d.ts diff --git a/types/oraclejet/ojswitch/index.d.ts b/types/oracle__oraclejet/ojswitch/index.d.ts similarity index 100% rename from types/oraclejet/ojswitch/index.d.ts rename to types/oracle__oraclejet/ojswitch/index.d.ts diff --git a/types/oraclejet/ojswitcher/index.d.ts b/types/oracle__oraclejet/ojswitcher/index.d.ts similarity index 100% rename from types/oraclejet/ojswitcher/index.d.ts rename to types/oracle__oraclejet/ojswitcher/index.d.ts diff --git a/types/oraclejet/ojtable/index.d.ts b/types/oracle__oraclejet/ojtable/index.d.ts similarity index 100% rename from types/oraclejet/ojtable/index.d.ts rename to types/oracle__oraclejet/ojtable/index.d.ts diff --git a/types/oraclejet/ojtagcloud/index.d.ts b/types/oracle__oraclejet/ojtagcloud/index.d.ts similarity index 100% rename from types/oraclejet/ojtagcloud/index.d.ts rename to types/oracle__oraclejet/ojtagcloud/index.d.ts diff --git a/types/oraclejet/ojthematicmap/index.d.ts b/types/oracle__oraclejet/ojthematicmap/index.d.ts similarity index 100% rename from types/oraclejet/ojthematicmap/index.d.ts rename to types/oracle__oraclejet/ojthematicmap/index.d.ts diff --git a/types/oraclejet/ojthemeutils/index.d.ts b/types/oracle__oraclejet/ojthemeutils/index.d.ts similarity index 100% rename from types/oraclejet/ojthemeutils/index.d.ts rename to types/oracle__oraclejet/ojthemeutils/index.d.ts diff --git a/types/oraclejet/ojtime-base/index.d.ts b/types/oracle__oraclejet/ojtime-base/index.d.ts similarity index 100% rename from types/oraclejet/ojtime-base/index.d.ts rename to types/oracle__oraclejet/ojtime-base/index.d.ts diff --git a/types/oraclejet/ojtimeaxis/index.d.ts b/types/oracle__oraclejet/ojtimeaxis/index.d.ts similarity index 100% rename from types/oraclejet/ojtimeaxis/index.d.ts rename to types/oracle__oraclejet/ojtimeaxis/index.d.ts diff --git a/types/oraclejet/ojtimeutils/index.d.ts b/types/oracle__oraclejet/ojtimeutils/index.d.ts similarity index 100% rename from types/oraclejet/ojtimeutils/index.d.ts rename to types/oracle__oraclejet/ojtimeutils/index.d.ts diff --git a/types/oraclejet/ojtoolbar/index.d.ts b/types/oracle__oraclejet/ojtoolbar/index.d.ts similarity index 100% rename from types/oraclejet/ojtoolbar/index.d.ts rename to types/oracle__oraclejet/ojtoolbar/index.d.ts diff --git a/types/oraclejet/ojtrain/index.d.ts b/types/oracle__oraclejet/ojtrain/index.d.ts similarity index 100% rename from types/oraclejet/ojtrain/index.d.ts rename to types/oracle__oraclejet/ojtrain/index.d.ts diff --git a/types/oraclejet/ojtranslation/index.d.ts b/types/oracle__oraclejet/ojtranslation/index.d.ts similarity index 100% rename from types/oraclejet/ojtranslation/index.d.ts rename to types/oracle__oraclejet/ojtranslation/index.d.ts diff --git a/types/oraclejet/ojtreedataprovider/index.d.ts b/types/oracle__oraclejet/ojtreedataprovider/index.d.ts similarity index 100% rename from types/oraclejet/ojtreedataprovider/index.d.ts rename to types/oracle__oraclejet/ojtreedataprovider/index.d.ts diff --git a/types/oraclejet/ojtreemap/index.d.ts b/types/oracle__oraclejet/ojtreemap/index.d.ts similarity index 100% rename from types/oraclejet/ojtreemap/index.d.ts rename to types/oracle__oraclejet/ojtreemap/index.d.ts diff --git a/types/oraclejet/ojvalidation-base/index.d.ts b/types/oracle__oraclejet/ojvalidation-base/index.d.ts similarity index 100% rename from types/oraclejet/ojvalidation-base/index.d.ts rename to types/oracle__oraclejet/ojvalidation-base/index.d.ts diff --git a/types/oraclejet/ojvalidation-datetime/index.d.ts b/types/oracle__oraclejet/ojvalidation-datetime/index.d.ts similarity index 100% rename from types/oraclejet/ojvalidation-datetime/index.d.ts rename to types/oracle__oraclejet/ojvalidation-datetime/index.d.ts diff --git a/types/oraclejet/ojvalidation-number/index.d.ts b/types/oracle__oraclejet/ojvalidation-number/index.d.ts similarity index 100% rename from types/oraclejet/ojvalidation-number/index.d.ts rename to types/oracle__oraclejet/ojvalidation-number/index.d.ts diff --git a/types/oraclejet/ojvalidationgroup/index.d.ts b/types/oracle__oraclejet/ojvalidationgroup/index.d.ts similarity index 100% rename from types/oraclejet/ojvalidationgroup/index.d.ts rename to types/oracle__oraclejet/ojvalidationgroup/index.d.ts diff --git a/types/oraclejet/oraclejet-tests.ts b/types/oracle__oraclejet/oraclejet-tests.ts similarity index 100% rename from types/oraclejet/oraclejet-tests.ts rename to types/oracle__oraclejet/oraclejet-tests.ts diff --git a/types/oraclejet/tsconfig.json b/types/oracle__oraclejet/tsconfig.json similarity index 100% rename from types/oraclejet/tsconfig.json rename to types/oracle__oraclejet/tsconfig.json diff --git a/types/oraclejet/tslint.json b/types/oracle__oraclejet/tslint.json similarity index 100% rename from types/oraclejet/tslint.json rename to types/oracle__oraclejet/tslint.json From 5d325b1ff2d45d055ff27daaffd7d1d7b0d8faf2 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 20:59:36 -0700 Subject: [PATCH 018/646] move to scoped --- .../{oraclejet-tests.ts => oracle__oraclejet-tests.ts} | 0 types/oracle__oraclejet/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/oracle__oraclejet/{oraclejet-tests.ts => oracle__oraclejet-tests.ts} (100%) diff --git a/types/oracle__oraclejet/oraclejet-tests.ts b/types/oracle__oraclejet/oracle__oraclejet-tests.ts similarity index 100% rename from types/oracle__oraclejet/oraclejet-tests.ts rename to types/oracle__oraclejet/oracle__oraclejet-tests.ts diff --git a/types/oracle__oraclejet/tsconfig.json b/types/oracle__oraclejet/tsconfig.json index e914883a1c..bcad93a766 100644 --- a/types/oracle__oraclejet/tsconfig.json +++ b/types/oracle__oraclejet/tsconfig.json @@ -17,7 +17,7 @@ ] }, "files": [ - "oraclejet-tests.ts", + "oracle__oraclejet-tests.ts", "index.d.ts", "ojaccordion/index.d.ts", "ojanimation/index.d.ts", From 3e270542b9fac5dad56382f7f2d1ab02ae718ad9 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 21:12:40 -0700 Subject: [PATCH 019/646] move to scoped location --- .../oracle__oraclejet-tests.ts | 190 +++++++++--------- types/oracle__oraclejet/tsconfig.json | 7 +- 2 files changed, 101 insertions(+), 96 deletions(-) diff --git a/types/oracle__oraclejet/oracle__oraclejet-tests.ts b/types/oracle__oraclejet/oracle__oraclejet-tests.ts index 265c0d4856..e71977ee39 100644 --- a/types/oracle__oraclejet/oracle__oraclejet-tests.ts +++ b/types/oracle__oraclejet/oracle__oraclejet-tests.ts @@ -1,101 +1,101 @@ // Since all the definitions are auto generated from jsdoc doclets and internally tested through application, // add some basic tests here. -import { ojAccordion } from "oraclejet/ojaccordion"; -import AnimationUtils = require("oraclejet/ojanimation"); -import ArrayDataProvider = require("oraclejet/ojarraydataprovider"); -import ArrayTreeDataProvider = require("oraclejet/ojarraytreedataprovider"); -import { AttributeGroupHandler, ColorAttributeGroupHandler, ShapeAttributeGroupHandler } from 'oraclejet/ojattributegrouphandler'; -import { ojAvatar } from "oraclejet/ojavatar"; -import { ojButton, ojButtonsetMany, ojButtonsetOne } from "oraclejet/ojbutton"; -import { ojChart, ojChartGroup, ojChartItem, ojChartSeries, ojSparkChart, ojSparkChartItem } from "oraclejet/ojchart"; -import { ojCheckboxset } from "oraclejet/ojcheckboxset"; -import { ojCollapsible } from "oraclejet/ojcollapsible"; -import CollectionDataprovider = require("oraclejet/ojcollectiondataprovider"); -import Color = require("oraclejet/ojcolor"); -import { ojColorPalette } from "oraclejet/ojcolorpalette"; -import { ojColorSpectrum } from "oraclejet/ojcolorspectrum"; -import Components = require("oraclejet/ojcomponentcore"); -import Composite = require("oraclejet/ojcomposite"); -import Config = require('oraclejet/ojconfig'); -import Context = require("oraclejet/ojcontext"); -import { ojConveyorBelt } from "oraclejet/ojconveyorbelt"; -import { ojDataGrid } from "oraclejet/ojdatagrid"; -import { DataMapping, DataProvider, DataProviderAddOperationEventDetail, DataProviderMutationEventDetail, DataProviderOperationEventDetail } from "oraclejet/ojdataprovider"; -import { ojDatePicker, ojDateTimePicker, ojInputDate, ojInputDateTime, ojInputTime } from "oraclejet/ojdatetimepicker"; -import { ojDefer } from "oraclejet/ojdefer"; -import DeferredDataprovider = require("oraclejet/ojdeferreddataprovider"); -import { ojDiagram, ojDiagramLink, ojDiagramNode } from "oraclejet/ojdiagram"; -import { ojDialog } from "oraclejet/ojdialog"; -import { dvtBaseComponent } from "oraclejet/ojdvt-base"; -import { editableValue } from "oraclejet/ojeditablevalue"; -import ExpressionUtils = require('oraclejet/ojexpressionutils'); -import { ojFilePicker, FileUploadTransport } from "oraclejet/ojfilepicker"; -import { ojFilmStrip } from "oraclejet/ojfilmstrip"; -import { ojFormLayout } from "oraclejet/ojformlayout"; -import { ojGantt, ojGanttRow, ojGanttTask, ojGanttDependency } from "oraclejet/ojgantt"; -import GanttUtils = require ('oraclejet/ojganttutils'); -import { ojLedGauge, ojRatingGauge, ojStatusMeterGauge } from "oraclejet/ojgauge"; -import { ojInputNumber } from "oraclejet/ojinputnumber"; -import { ojInputPassword, ojInputText, ojTextArea } from "oraclejet/ojinputtext"; -import { KeySet, ExpandAllKeySet, ExpandedKeySet } from "oraclejet/ojkeyset"; -import { ObservableExpandedKeySet } from "oraclejet/ojknockout-keyset"; -import KnockoutUtils = require("oraclejet/ojknockout-model"); -import KnockoutTemplateUtils = require('oraclejet/ojknockouttemplateutils'); -import { ojLabel } from "oraclejet/ojlabel"; -import { ojLabelValue } from "oraclejet/ojlabelvalue"; -import { ojLegend } from "oraclejet/ojlegend"; -import ListDataProviderView = require("oraclejet/ojlistdataproviderview"); -import { ojListView } from "oraclejet/ojlistview"; -import LocaleData = require('oraclejet/ojlocaledata'); -import Logger = require('oraclejet/ojlogger'); -import { ojMasonryLayout } from "oraclejet/ojmasonrylayout"; -import { ojMenu } from "oraclejet/ojmenu"; -import { ojMenuSelectMany } from "oraclejet/ojmenuselectmany"; -import { ojMessages } from "oraclejet/ojmessages"; -import { ojMessage } from "oraclejet/ojmessage"; -import Message = require("oraclejet/ojmessaging"); -import { Collection, Model, URLError, OAuth } from "oraclejet/ojmodel"; -import { ojModule } from "oraclejet/ojmodule-element"; -import ModuleElementUtils = require("oraclejet/ojmodule-element-utils"); -import ModuleAnimations = require("oraclejet/ojmoduleanimations") ; -import { ojNavigationList, ojTabBar } from "oraclejet/ojnavigationlist"; -import { ojNBox } from "oraclejet/ojnbox"; -import { ojOptgroup } from "oraclejet/ojoptgroup"; -import { ojOption } from "oraclejet/ojoption"; -import { ojPictoChart, ojPictoChartItem } from "oraclejet/ojpictochart"; -import { ojPopup } from "oraclejet/ojpopup"; -import { ojProgress } from "oraclejet/ojprogress"; -import { ojProgressList, ProgressItem } from "oraclejet/ojprogresslist"; -import PullToRefreshUtils = require("oraclejet/ojpulltorefresh"); -import { ojRadioset } from "oraclejet/ojradioset"; -import { ojRefresher } from "oraclejet/ojrefresher"; -import ResponsiveKnockoutUtils = require('oraclejet/ojresponsiveknockoututils'); -import ResponsiveUtils = require('oraclejet/ojresponsiveutils'); -import Router = require("oraclejet/ojrouter"); -import { ojComboboxOne, ojComboboxMany, ojSelectOne, ojSelectMany } from "oraclejet/ojselectcombobox"; -import { ojSlider } from "oraclejet/ojslider"; -import { ojSunburst } from "oraclejet/ojsunburst"; -import { ojSwipeActions } from "oraclejet/ojswipeactions"; -import SwipeToRevealUtils = require("oraclejet/ojswipetoreveal"); -import { ojSwitch } from "oraclejet/ojswitch"; -import { ojSwitcher } from "oraclejet/ojswitcher"; -import { ojTable } from "oraclejet/ojtable"; -import { ojTagCloud } from "oraclejet/ojtagcloud"; -import { ojThematicMap } from "oraclejet/ojthematicmap"; -import ThemeUtils = require('oraclejet/ojthemeutils'); -import { dvtTimeComponent } from "oraclejet/ojtime-base"; -import { ojTimeAxis } from "oraclejet/ojtimeaxis"; -import TimeUtils = require("oraclejet/ojtimeutils"); -import { ojToolbar } from "oraclejet/ojtoolbar"; -import { ojTrain } from "oraclejet/ojtrain"; -import Translations = require("oraclejet/ojtranslation"); -import TreeDataProvider = require("oraclejet/ojtreedataprovider"); -import { ojTreemap } from "oraclejet/ojtreemap"; +import { ojAccordion } from "ojs/ojaccordion"; +import AnimationUtils = require("ojs/ojanimation"); +import ArrayDataProvider = require("ojs/ojarraydataprovider"); +import ArrayTreeDataProvider = require("ojs/ojarraytreedataprovider"); +import { AttributeGroupHandler, ColorAttributeGroupHandler, ShapeAttributeGroupHandler } from 'ojs/ojattributegrouphandler'; +import { ojAvatar } from "ojs/ojavatar"; +import { ojButton, ojButtonsetMany, ojButtonsetOne } from "ojs/ojbutton"; +import { ojChart, ojChartGroup, ojChartItem, ojChartSeries, ojSparkChart, ojSparkChartItem } from "ojs/ojchart"; +import { ojCheckboxset } from "ojs/ojcheckboxset"; +import { ojCollapsible } from "ojs/ojcollapsible"; +import CollectionDataprovider = require("ojs/ojcollectiondataprovider"); +import Color = require("ojs/ojcolor"); +import { ojColorPalette } from "ojs/ojcolorpalette"; +import { ojColorSpectrum } from "ojs/ojcolorspectrum"; +import Components = require("ojs/ojcomponentcore"); +import Composite = require("ojs/ojcomposite"); +import Config = require('ojs/ojconfig'); +import Context = require("ojs/ojcontext"); +import { ojConveyorBelt } from "ojs/ojconveyorbelt"; +import { ojDataGrid } from "ojs/ojdatagrid"; +import { DataMapping, DataProvider, DataProviderAddOperationEventDetail, DataProviderMutationEventDetail, DataProviderOperationEventDetail } from "ojs/ojdataprovider"; +import { ojDatePicker, ojDateTimePicker, ojInputDate, ojInputDateTime, ojInputTime } from "ojs/ojdatetimepicker"; +import { ojDefer } from "ojs/ojdefer"; +import DeferredDataprovider = require("ojs/ojdeferreddataprovider"); +import { ojDiagram, ojDiagramLink, ojDiagramNode } from "ojs/ojdiagram"; +import { ojDialog } from "ojs/ojdialog"; +import { dvtBaseComponent } from "ojs/ojdvt-base"; +import { editableValue } from "ojs/ojeditablevalue"; +import ExpressionUtils = require('ojs/ojexpressionutils'); +import { ojFilePicker, FileUploadTransport } from "ojs/ojfilepicker"; +import { ojFilmStrip } from "ojs/ojfilmstrip"; +import { ojFormLayout } from "ojs/ojformlayout"; +import { ojGantt, ojGanttRow, ojGanttTask, ojGanttDependency } from "ojs/ojgantt"; +import GanttUtils = require ('ojs/ojganttutils'); +import { ojLedGauge, ojRatingGauge, ojStatusMeterGauge } from "ojs/ojgauge"; +import { ojInputNumber } from "ojs/ojinputnumber"; +import { ojInputPassword, ojInputText, ojTextArea } from "ojs/ojinputtext"; +import { KeySet, ExpandAllKeySet, ExpandedKeySet } from "ojs/ojkeyset"; +import { ObservableExpandedKeySet } from "ojs/ojknockout-keyset"; +import KnockoutUtils = require("ojs/ojknockout-model"); +import KnockoutTemplateUtils = require('ojs/ojknockouttemplateutils'); +import { ojLabel } from "ojs/ojlabel"; +import { ojLabelValue } from "ojs/ojlabelvalue"; +import { ojLegend } from "ojs/ojlegend"; +import ListDataProviderView = require("ojs/ojlistdataproviderview"); +import { ojListView } from "ojs/ojlistview"; +import LocaleData = require('ojs/ojlocaledata'); +import Logger = require('ojs/ojlogger'); +import { ojMasonryLayout } from "ojs/ojmasonrylayout"; +import { ojMenu } from "ojs/ojmenu"; +import { ojMenuSelectMany } from "ojs/ojmenuselectmany"; +import { ojMessages } from "ojs/ojmessages"; +import { ojMessage } from "ojs/ojmessage"; +import Message = require("ojs/ojmessaging"); +import { Collection, Model, URLError, OAuth } from "ojs/ojmodel"; +import { ojModule } from "ojs/ojmodule-element"; +import ModuleElementUtils = require("ojs/ojmodule-element-utils"); +import ModuleAnimations = require("ojs/ojmoduleanimations") ; +import { ojNavigationList, ojTabBar } from "ojs/ojnavigationlist"; +import { ojNBox } from "ojs/ojnbox"; +import { ojOptgroup } from "ojs/ojoptgroup"; +import { ojOption } from "ojs/ojoption"; +import { ojPictoChart, ojPictoChartItem } from "ojs/ojpictochart"; +import { ojPopup } from "ojs/ojpopup"; +import { ojProgress } from "ojs/ojprogress"; +import { ojProgressList, ProgressItem } from "ojs/ojprogresslist"; +import PullToRefreshUtils = require("ojs/ojpulltorefresh"); +import { ojRadioset } from "ojs/ojradioset"; +import { ojRefresher } from "ojs/ojrefresher"; +import ResponsiveKnockoutUtils = require('ojs/ojresponsiveknockoututils'); +import ResponsiveUtils = require('ojs/ojresponsiveutils'); +import Router = require("ojs/ojrouter"); +import { ojComboboxOne, ojComboboxMany, ojSelectOne, ojSelectMany } from "ojs/ojselectcombobox"; +import { ojSlider } from "ojs/ojslider"; +import { ojSunburst } from "ojs/ojsunburst"; +import { ojSwipeActions } from "ojs/ojswipeactions"; +import SwipeToRevealUtils = require("ojs/ojswipetoreveal"); +import { ojSwitch } from "ojs/ojswitch"; +import { ojSwitcher } from "ojs/ojswitcher"; +import { ojTable } from "ojs/ojtable"; +import { ojTagCloud } from "ojs/ojtagcloud"; +import { ojThematicMap } from "ojs/ojthematicmap"; +import ThemeUtils = require('ojs/ojthemeutils'); +import { dvtTimeComponent } from "ojs/ojtime-base"; +import { ojTimeAxis } from "ojs/ojtimeaxis"; +import TimeUtils = require("ojs/ojtimeutils"); +import { ojToolbar } from "ojs/ojtoolbar"; +import { ojTrain } from "ojs/ojtrain"; +import Translations = require("ojs/ojtranslation"); +import TreeDataProvider = require("ojs/ojtreedataprovider"); +import { ojTreemap } from "ojs/ojtreemap"; import { Validation, Validator, ValidatorError, ValidatorFactory, - AsyncValidator, LengthValidator, LengthValidatorFactory, RegExpValidator, RegExpValidatorFactory, RequiredValidator, RequiredValidatorFactory } from "oraclejet/ojvalidation-base"; -import { DateRestrictionValidator, DateRestrictionValidatorFactory, DateTimeRangeValidator, DateTimeRangeValidatorFactory } from "oraclejet/ojvalidation-datetime"; -import { NumberRangeValidator, NumberRangeValidatorFactory } from "oraclejet/ojvalidation-number"; -import { ojValidationGroup } from "oraclejet/ojvalidationgroup"; + AsyncValidator, LengthValidator, LengthValidatorFactory, RegExpValidator, RegExpValidatorFactory, RequiredValidator, RequiredValidatorFactory } from "ojs/ojvalidation-base"; +import { DateRestrictionValidator, DateRestrictionValidatorFactory, DateTimeRangeValidator, DateTimeRangeValidatorFactory } from "ojs/ojvalidation-datetime"; +import { NumberRangeValidator, NumberRangeValidatorFactory } from "ojs/ojvalidation-number"; +import { ojValidationGroup } from "ojs/ojvalidationgroup"; const onChangedCallback = (event: CustomEvent) => { }; diff --git a/types/oracle__oraclejet/tsconfig.json b/types/oracle__oraclejet/tsconfig.json index bcad93a766..16185df100 100644 --- a/types/oracle__oraclejet/tsconfig.json +++ b/types/oracle__oraclejet/tsconfig.json @@ -14,7 +14,12 @@ "baseUrl": "../", "typeRoots": [ "../" - ] + ], + "paths": { + "ojs/*": [ + "oracle__oraclejet/*" + ] + } }, "files": [ "oracle__oraclejet-tests.ts", From 38f49e7e670f6fdb3a4ec0768b7816693189adf8 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 21:14:50 -0700 Subject: [PATCH 020/646] update for scoped --- types/oracle__oraclejet/tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/oracle__oraclejet/tsconfig.json b/types/oracle__oraclejet/tsconfig.json index 16185df100..6119a97403 100644 --- a/types/oracle__oraclejet/tsconfig.json +++ b/types/oracle__oraclejet/tsconfig.json @@ -16,6 +16,9 @@ "../" ], "paths": { + "ojs": [ + "oracle__oraclejet" + ], "ojs/*": [ "oracle__oraclejet/*" ] From 460a128c6535fa7e48cae4805b16fd8ed6096855 Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 21:20:16 -0700 Subject: [PATCH 021/646] Update for scoped --- .../oracle__oraclejet-tests.ts | 190 +++++++++--------- types/oracle__oraclejet/tsconfig.json | 4 +- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/types/oracle__oraclejet/oracle__oraclejet-tests.ts b/types/oracle__oraclejet/oracle__oraclejet-tests.ts index e71977ee39..41c645e679 100644 --- a/types/oracle__oraclejet/oracle__oraclejet-tests.ts +++ b/types/oracle__oraclejet/oracle__oraclejet-tests.ts @@ -1,101 +1,101 @@ // Since all the definitions are auto generated from jsdoc doclets and internally tested through application, // add some basic tests here. -import { ojAccordion } from "ojs/ojaccordion"; -import AnimationUtils = require("ojs/ojanimation"); -import ArrayDataProvider = require("ojs/ojarraydataprovider"); -import ArrayTreeDataProvider = require("ojs/ojarraytreedataprovider"); -import { AttributeGroupHandler, ColorAttributeGroupHandler, ShapeAttributeGroupHandler } from 'ojs/ojattributegrouphandler'; -import { ojAvatar } from "ojs/ojavatar"; -import { ojButton, ojButtonsetMany, ojButtonsetOne } from "ojs/ojbutton"; -import { ojChart, ojChartGroup, ojChartItem, ojChartSeries, ojSparkChart, ojSparkChartItem } from "ojs/ojchart"; -import { ojCheckboxset } from "ojs/ojcheckboxset"; -import { ojCollapsible } from "ojs/ojcollapsible"; -import CollectionDataprovider = require("ojs/ojcollectiondataprovider"); -import Color = require("ojs/ojcolor"); -import { ojColorPalette } from "ojs/ojcolorpalette"; -import { ojColorSpectrum } from "ojs/ojcolorspectrum"; -import Components = require("ojs/ojcomponentcore"); -import Composite = require("ojs/ojcomposite"); -import Config = require('ojs/ojconfig'); -import Context = require("ojs/ojcontext"); -import { ojConveyorBelt } from "ojs/ojconveyorbelt"; -import { ojDataGrid } from "ojs/ojdatagrid"; -import { DataMapping, DataProvider, DataProviderAddOperationEventDetail, DataProviderMutationEventDetail, DataProviderOperationEventDetail } from "ojs/ojdataprovider"; -import { ojDatePicker, ojDateTimePicker, ojInputDate, ojInputDateTime, ojInputTime } from "ojs/ojdatetimepicker"; -import { ojDefer } from "ojs/ojdefer"; -import DeferredDataprovider = require("ojs/ojdeferreddataprovider"); -import { ojDiagram, ojDiagramLink, ojDiagramNode } from "ojs/ojdiagram"; -import { ojDialog } from "ojs/ojdialog"; -import { dvtBaseComponent } from "ojs/ojdvt-base"; -import { editableValue } from "ojs/ojeditablevalue"; -import ExpressionUtils = require('ojs/ojexpressionutils'); -import { ojFilePicker, FileUploadTransport } from "ojs/ojfilepicker"; -import { ojFilmStrip } from "ojs/ojfilmstrip"; -import { ojFormLayout } from "ojs/ojformlayout"; -import { ojGantt, ojGanttRow, ojGanttTask, ojGanttDependency } from "ojs/ojgantt"; -import GanttUtils = require ('ojs/ojganttutils'); -import { ojLedGauge, ojRatingGauge, ojStatusMeterGauge } from "ojs/ojgauge"; -import { ojInputNumber } from "ojs/ojinputnumber"; -import { ojInputPassword, ojInputText, ojTextArea } from "ojs/ojinputtext"; -import { KeySet, ExpandAllKeySet, ExpandedKeySet } from "ojs/ojkeyset"; -import { ObservableExpandedKeySet } from "ojs/ojknockout-keyset"; -import KnockoutUtils = require("ojs/ojknockout-model"); -import KnockoutTemplateUtils = require('ojs/ojknockouttemplateutils'); -import { ojLabel } from "ojs/ojlabel"; -import { ojLabelValue } from "ojs/ojlabelvalue"; -import { ojLegend } from "ojs/ojlegend"; -import ListDataProviderView = require("ojs/ojlistdataproviderview"); -import { ojListView } from "ojs/ojlistview"; -import LocaleData = require('ojs/ojlocaledata'); -import Logger = require('ojs/ojlogger'); -import { ojMasonryLayout } from "ojs/ojmasonrylayout"; -import { ojMenu } from "ojs/ojmenu"; -import { ojMenuSelectMany } from "ojs/ojmenuselectmany"; -import { ojMessages } from "ojs/ojmessages"; -import { ojMessage } from "ojs/ojmessage"; -import Message = require("ojs/ojmessaging"); -import { Collection, Model, URLError, OAuth } from "ojs/ojmodel"; -import { ojModule } from "ojs/ojmodule-element"; -import ModuleElementUtils = require("ojs/ojmodule-element-utils"); -import ModuleAnimations = require("ojs/ojmoduleanimations") ; -import { ojNavigationList, ojTabBar } from "ojs/ojnavigationlist"; -import { ojNBox } from "ojs/ojnbox"; -import { ojOptgroup } from "ojs/ojoptgroup"; -import { ojOption } from "ojs/ojoption"; -import { ojPictoChart, ojPictoChartItem } from "ojs/ojpictochart"; -import { ojPopup } from "ojs/ojpopup"; -import { ojProgress } from "ojs/ojprogress"; -import { ojProgressList, ProgressItem } from "ojs/ojprogresslist"; -import PullToRefreshUtils = require("ojs/ojpulltorefresh"); -import { ojRadioset } from "ojs/ojradioset"; -import { ojRefresher } from "ojs/ojrefresher"; -import ResponsiveKnockoutUtils = require('ojs/ojresponsiveknockoututils'); -import ResponsiveUtils = require('ojs/ojresponsiveutils'); -import Router = require("ojs/ojrouter"); -import { ojComboboxOne, ojComboboxMany, ojSelectOne, ojSelectMany } from "ojs/ojselectcombobox"; -import { ojSlider } from "ojs/ojslider"; -import { ojSunburst } from "ojs/ojsunburst"; -import { ojSwipeActions } from "ojs/ojswipeactions"; -import SwipeToRevealUtils = require("ojs/ojswipetoreveal"); -import { ojSwitch } from "ojs/ojswitch"; -import { ojSwitcher } from "ojs/ojswitcher"; -import { ojTable } from "ojs/ojtable"; -import { ojTagCloud } from "ojs/ojtagcloud"; -import { ojThematicMap } from "ojs/ojthematicmap"; -import ThemeUtils = require('ojs/ojthemeutils'); -import { dvtTimeComponent } from "ojs/ojtime-base"; -import { ojTimeAxis } from "ojs/ojtimeaxis"; -import TimeUtils = require("ojs/ojtimeutils"); -import { ojToolbar } from "ojs/ojtoolbar"; -import { ojTrain } from "ojs/ojtrain"; -import Translations = require("ojs/ojtranslation"); -import TreeDataProvider = require("ojs/ojtreedataprovider"); -import { ojTreemap } from "ojs/ojtreemap"; +import { ojAccordion } from "@oracle/oraclejet/ojaccordion"; +import AnimationUtils = require("@oracle/oraclejet/ojanimation"); +import ArrayDataProvider = require("@oracle/oraclejet/ojarraydataprovider"); +import ArrayTreeDataProvider = require("@oracle/oraclejet/ojarraytreedataprovider"); +import { AttributeGroupHandler, ColorAttributeGroupHandler, ShapeAttributeGroupHandler } from '@oracle/oraclejet/ojattributegrouphandler'; +import { ojAvatar } from "@oracle/oraclejet/ojavatar"; +import { ojButton, ojButtonsetMany, ojButtonsetOne } from "@oracle/oraclejet/ojbutton"; +import { ojChart, ojChartGroup, ojChartItem, ojChartSeries, ojSparkChart, ojSparkChartItem } from "@oracle/oraclejet/ojchart"; +import { ojCheckboxset } from "@oracle/oraclejet/ojcheckboxset"; +import { ojCollapsible } from "@oracle/oraclejet/ojcollapsible"; +import CollectionDataprovider = require("@oracle/oraclejet/ojcollectiondataprovider"); +import Color = require("@oracle/oraclejet/ojcolor"); +import { ojColorPalette } from "@oracle/oraclejet/ojcolorpalette"; +import { ojColorSpectrum } from "@oracle/oraclejet/ojcolorspectrum"; +import Components = require("@oracle/oraclejet/ojcomponentcore"); +import Composite = require("@oracle/oraclejet/ojcomposite"); +import Config = require('@oracle/oraclejet/ojconfig'); +import Context = require("@oracle/oraclejet/ojcontext"); +import { ojConveyorBelt } from "@oracle/oraclejet/ojconveyorbelt"; +import { ojDataGrid } from "@oracle/oraclejet/ojdatagrid"; +import { DataMapping, DataProvider, DataProviderAddOperationEventDetail, DataProviderMutationEventDetail, DataProviderOperationEventDetail } from "@oracle/oraclejet/ojdataprovider"; +import { ojDatePicker, ojDateTimePicker, ojInputDate, ojInputDateTime, ojInputTime } from "@oracle/oraclejet/ojdatetimepicker"; +import { ojDefer } from "@oracle/oraclejet/ojdefer"; +import DeferredDataprovider = require("@oracle/oraclejet/ojdeferreddataprovider"); +import { ojDiagram, ojDiagramLink, ojDiagramNode } from "@oracle/oraclejet/ojdiagram"; +import { ojDialog } from "@oracle/oraclejet/ojdialog"; +import { dvtBaseComponent } from "@oracle/oraclejet/ojdvt-base"; +import { editableValue } from "@oracle/oraclejet/ojeditablevalue"; +import ExpressionUtils = require('@oracle/oraclejet/ojexpressionutils'); +import { ojFilePicker, FileUploadTransport } from "@oracle/oraclejet/ojfilepicker"; +import { ojFilmStrip } from "@oracle/oraclejet/ojfilmstrip"; +import { ojFormLayout } from "@oracle/oraclejet/ojformlayout"; +import { ojGantt, ojGanttRow, ojGanttTask, ojGanttDependency } from "@oracle/oraclejet/ojgantt"; +import GanttUtils = require ('@oracle/oraclejet/ojganttutils'); +import { ojLedGauge, ojRatingGauge, ojStatusMeterGauge } from "@oracle/oraclejet/ojgauge"; +import { ojInputNumber } from "@oracle/oraclejet/ojinputnumber"; +import { ojInputPassword, ojInputText, ojTextArea } from "@oracle/oraclejet/ojinputtext"; +import { KeySet, ExpandAllKeySet, ExpandedKeySet } from "@oracle/oraclejet/ojkeyset"; +import { ObservableExpandedKeySet } from "@oracle/oraclejet/ojknockout-keyset"; +import KnockoutUtils = require("@oracle/oraclejet/ojknockout-model"); +import KnockoutTemplateUtils = require('@oracle/oraclejet/ojknockouttemplateutils'); +import { ojLabel } from "@oracle/oraclejet/ojlabel"; +import { ojLabelValue } from "@oracle/oraclejet/ojlabelvalue"; +import { ojLegend } from "@oracle/oraclejet/ojlegend"; +import ListDataProviderView = require("@oracle/oraclejet/ojlistdataproviderview"); +import { ojListView } from "@oracle/oraclejet/ojlistview"; +import LocaleData = require('@oracle/oraclejet/ojlocaledata'); +import Logger = require('@oracle/oraclejet/ojlogger'); +import { ojMasonryLayout } from "@oracle/oraclejet/ojmasonrylayout"; +import { ojMenu } from "@oracle/oraclejet/ojmenu"; +import { ojMenuSelectMany } from "@oracle/oraclejet/ojmenuselectmany"; +import { ojMessages } from "@oracle/oraclejet/ojmessages"; +import { ojMessage } from "@oracle/oraclejet/ojmessage"; +import Message = require("@oracle/oraclejet/ojmessaging"); +import { Collection, Model, URLError, OAuth } from "@oracle/oraclejet/ojmodel"; +import { ojModule } from "@oracle/oraclejet/ojmodule-element"; +import ModuleElementUtils = require("@oracle/oraclejet/ojmodule-element-utils"); +import ModuleAnimations = require("@oracle/oraclejet/ojmoduleanimations") ; +import { ojNavigationList, ojTabBar } from "@oracle/oraclejet/ojnavigationlist"; +import { ojNBox } from "@oracle/oraclejet/ojnbox"; +import { ojOptgroup } from "@oracle/oraclejet/ojoptgroup"; +import { ojOption } from "@oracle/oraclejet/ojoption"; +import { ojPictoChart, ojPictoChartItem } from "@oracle/oraclejet/ojpictochart"; +import { ojPopup } from "@oracle/oraclejet/ojpopup"; +import { ojProgress } from "@oracle/oraclejet/ojprogress"; +import { ojProgressList, ProgressItem } from "@oracle/oraclejet/ojprogresslist"; +import PullToRefreshUtils = require("@oracle/oraclejet/ojpulltorefresh"); +import { ojRadioset } from "@oracle/oraclejet/ojradioset"; +import { ojRefresher } from "@oracle/oraclejet/ojrefresher"; +import ResponsiveKnockoutUtils = require('@oracle/oraclejet/ojresponsiveknockoututils'); +import ResponsiveUtils = require('@oracle/oraclejet/ojresponsiveutils'); +import Router = require("@oracle/oraclejet/ojrouter"); +import { ojComboboxOne, ojComboboxMany, ojSelectOne, ojSelectMany } from "@oracle/oraclejet/ojselectcombobox"; +import { ojSlider } from "@oracle/oraclejet/ojslider"; +import { ojSunburst } from "@oracle/oraclejet/ojsunburst"; +import { ojSwipeActions } from "@oracle/oraclejet/ojswipeactions"; +import SwipeToRevealUtils = require("@oracle/oraclejet/ojswipetoreveal"); +import { ojSwitch } from "@oracle/oraclejet/ojswitch"; +import { ojSwitcher } from "@oracle/oraclejet/ojswitcher"; +import { ojTable } from "@oracle/oraclejet/ojtable"; +import { ojTagCloud } from "@oracle/oraclejet/ojtagcloud"; +import { ojThematicMap } from "@oracle/oraclejet/ojthematicmap"; +import ThemeUtils = require('@oracle/oraclejet/ojthemeutils'); +import { dvtTimeComponent } from "@oracle/oraclejet/ojtime-base"; +import { ojTimeAxis } from "@oracle/oraclejet/ojtimeaxis"; +import TimeUtils = require("@oracle/oraclejet/ojtimeutils"); +import { ojToolbar } from "@oracle/oraclejet/ojtoolbar"; +import { ojTrain } from "@oracle/oraclejet/ojtrain"; +import Translations = require("@oracle/oraclejet/ojtranslation"); +import TreeDataProvider = require("@oracle/oraclejet/ojtreedataprovider"); +import { ojTreemap } from "@oracle/oraclejet/ojtreemap"; import { Validation, Validator, ValidatorError, ValidatorFactory, - AsyncValidator, LengthValidator, LengthValidatorFactory, RegExpValidator, RegExpValidatorFactory, RequiredValidator, RequiredValidatorFactory } from "ojs/ojvalidation-base"; -import { DateRestrictionValidator, DateRestrictionValidatorFactory, DateTimeRangeValidator, DateTimeRangeValidatorFactory } from "ojs/ojvalidation-datetime"; -import { NumberRangeValidator, NumberRangeValidatorFactory } from "ojs/ojvalidation-number"; -import { ojValidationGroup } from "ojs/ojvalidationgroup"; + AsyncValidator, LengthValidator, LengthValidatorFactory, RegExpValidator, RegExpValidatorFactory, RequiredValidator, RequiredValidatorFactory } from "@oracle/oraclejet/ojvalidation-base"; +import { DateRestrictionValidator, DateRestrictionValidatorFactory, DateTimeRangeValidator, DateTimeRangeValidatorFactory } from "@oracle/oraclejet/ojvalidation-datetime"; +import { NumberRangeValidator, NumberRangeValidatorFactory } from "@oracle/oraclejet/ojvalidation-number"; +import { ojValidationGroup } from "@oracle/oraclejet/ojvalidationgroup"; const onChangedCallback = (event: CustomEvent) => { }; diff --git a/types/oracle__oraclejet/tsconfig.json b/types/oracle__oraclejet/tsconfig.json index 6119a97403..737bb98852 100644 --- a/types/oracle__oraclejet/tsconfig.json +++ b/types/oracle__oraclejet/tsconfig.json @@ -16,10 +16,10 @@ "../" ], "paths": { - "ojs": [ + "@oracle/oraclejet": [ "oracle__oraclejet" ], - "ojs/*": [ + "@oracle/oraclejet/*": [ "oracle__oraclejet/*" ] } From 1433a0c327ffa2fa99ca9816db5cb2fba437a3bc Mon Sep 17 00:00:00 2001 From: Naizam Olakara Date: Mon, 1 Oct 2018 21:36:58 -0700 Subject: [PATCH 022/646] Remove trailing space --- types/oracle__oraclejet/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/oracle__oraclejet/tsconfig.json b/types/oracle__oraclejet/tsconfig.json index 737bb98852..5f529007f8 100644 --- a/types/oracle__oraclejet/tsconfig.json +++ b/types/oracle__oraclejet/tsconfig.json @@ -22,7 +22,7 @@ "@oracle/oraclejet/*": [ "oracle__oraclejet/*" ] - } + } }, "files": [ "oracle__oraclejet-tests.ts", From 007f5273b5b43f50fe2893a0733aff47754bcdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Fri, 14 Dec 2018 09:35:16 +0800 Subject: [PATCH 023/646] Add base interfaces for request params. --- types/wx-js-sdk-dt/index.d.ts | 168 +++++++++++++++++------ types/wx-js-sdk-dt/tsconfig.json | 7 +- types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts | 23 +++- 3 files changed, 152 insertions(+), 46 deletions(-) diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index 3f09527450..46da21d0df 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -57,10 +57,46 @@ declare namespace wx { */ function error(err: (res: any) => void): void; + /** + * 所有通过wx对象调用的接口的基础请求参数 + * 见:https://mp.weixin.qq.com/wiki?action=doc&id=mp1421141115&t=0.08966560295638093#7 + */ + interface WxBaseRequestConfig { + /** + * 接口调用成功时执行的回调函数 + */ + success?(...params: any): void; + + /** + * 接口调用失败时执行的回调函数 + */ + fail?(...params: any): void; + + /** + * 接口调用完成时执行的回调函数,无论成功或失败都会执行 + */ + complete?(...params: any): void; + + /** + * 用户点击取消时的回调函数,仅部分有用户取消操作的api才会用到 + */ + cancel?(...params: any): void; + } + + /** + * 所有Menu中的相关接口的请求参数 + */ + interface WxBaseMenuRequestConfig extends WxBaseRequestConfig { + /** + * 监听Menu中的按钮点击时触发的方法 + */ + trigger?: () => void; + } + /** * 判断当前客户端版本是否支持指定 JS 接口, checkJsApi 接口是客户端6.0.2新引入的一个预留接口,第一期开放的接口均可不使用 checkJsApi 来检测 */ - interface CheckApiConfig { + interface CheckApiConfig extends WxBaseRequestConfig { /** * 需要检测的JS接口列表 */ @@ -78,7 +114,7 @@ declare namespace wx { */ function checkJsApi(setting: CheckApiConfig): void; - interface ShareTimelineConfig { + interface ShareTimelineConfig extends WxBaseMenuRequestConfig { /** * 分享标题 */ @@ -93,25 +129,66 @@ declare namespace wx { * 分享图标 */ imgUrl?: string; - - /** - * 分享成功后的回调 - */ - success?(): void; - - /** - * 分享失败后的回调 - */ - cancel?(): void; } /** * 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 + * @deprecated */ function onMenuShareTimeline(setting: ShareTimelineConfig): void; + /** + * “分享给朋友”及“分享到QQ”按钮的分享内容 + */ + interface ShareToUserConfig extends WxBaseMenuRequestConfig { + /** + * 分享标题 + */ + title?: string; + + /** + * 分享描述 + */ + desc?: string; + + /** + * 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + */ + link?: string; + + /** + * 分享图标 + */ + imageUrl?: string; + + success?: () => void; + } + + /** + * “分享到朋友圈”及“分享到QQ空间”按钮的分享内容 + */ + interface ShareToTimelineConfig extends WxBaseMenuRequestConfig { + /** + * 分享标题 + */ + title?: string; + + /** + * 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + */ + link?: string; + + /** + * 分享图标 + */ + imageUrl?: string; + + success?: () => void; + } + /** * 消息分享对象 + * @deprecated */ interface SharedAppMessage extends ShareTimelineConfig { /** @@ -132,9 +209,13 @@ declare namespace wx { /** * 获取“分享给朋友”按钮点击状态及自定义分享内容接口 + * @deprecated */ function onMenuShareAppMessage(setting: SharedAppMessage): void; + /** + * @deprecated + */ interface MenuShareQQ extends ShareTimelineConfig { /** * 分享描述 @@ -144,6 +225,7 @@ declare namespace wx { /** * “分享到QQ”按钮点击状态及自定义分享内容接口 + * @deprecated */ function onMenuShareQQ(config: MenuShareQQ): void; @@ -161,9 +243,22 @@ declare namespace wx { /** * 获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 + * @deprecated */ function onMenuShareQZone(config: MenuShareWeibo): void; + /** + * “分享给朋友”及“分享到QQ” + * @param config + */ + function updateAppMessageShareData(config: ShareToUserConfig): void; + + /** + * “分享到朋友圈”及“分享到QQ空间” + * @param config + */ + function updateTimelineShareData(config: ShareToTimelineConfig): void; + interface ChooseImageConfig { /** * 照片数,默认9 @@ -194,7 +289,7 @@ declare namespace wx { /** * 显示照片预览用的配置对象 */ - interface PreviewImageConfig { + interface PreviewImageConfig extends WxBaseRequestConfig { /** * 当前显示图片的 http 链接 */ @@ -210,7 +305,7 @@ declare namespace wx { */ function previewImage(config: PreviewImageConfig): void; - interface UploadImageConfig { + interface UploadImageConfig extends WxBaseRequestConfig { /** * 要上传的图片的本地 ID,由 chooseImage 接口获得 */ @@ -232,7 +327,7 @@ declare namespace wx { */ function uploadImage(config: UploadImageConfig): void; - interface DownLoadImageConfig { + interface DownLoadImageConfig extends WxBaseRequestConfig { /** * serverId: 需要下载的图片的服务器端ID,由 uploadImage 接口获得 */ @@ -248,7 +343,7 @@ declare namespace wx { function downloadImage(config: DownLoadImageConfig): void; - interface GetLocalImgDataConfig { + interface GetLocalImgDataConfig extends WxBaseRequestConfig { /** * 图片的 localID */ @@ -300,7 +395,7 @@ declare namespace wx { */ function onVoicePlayEnd(success: (res: { localId: string }) => void): void; - interface UploadVoiceConfig { + interface UploadVoiceConfig extends WxBaseRequestConfig { localId: string; isShowProgressTips?: number; success(res: any): void; @@ -311,7 +406,7 @@ declare namespace wx { */ function uploadVoice(config: UploadVoiceConfig): void; - interface downloadVoiceConfig { + interface DownloadVoiceConfig extends WxBaseRequestConfig { /** * 需要下载的音频的服务器端 ID,由 uploadVoice 接口获得 */ @@ -328,7 +423,7 @@ declare namespace wx { success(res: any): void; } - function downloadVoice(config: downloadVoiceConfig): void; + function downloadVoice(config: DownloadVoiceConfig): void; /** * 识别音频并返回识别结果接口 @@ -340,7 +435,7 @@ declare namespace wx { */ function getNetworkType(success: (res: { networkType: string }) => void): void; - interface OpenLocationConfig { + interface OpenLocationConfig extends WxBaseRequestConfig { latitude?: number; longitude?: number; @@ -385,7 +480,7 @@ declare namespace wx { accuracy: number; } - interface GetLocationConfig { + interface GetLocationConfig extends WxBaseRequestConfig { /** * 默认为 wgs84 的 gps 坐标,如果要返回直接给 openLocation 用的火星坐标,可传入'gcj02' */ @@ -399,7 +494,7 @@ declare namespace wx { */ function getLocation(config: GetLocationConfig): void; - interface StartSearchBeaconsConfig { + interface StartSearchBeaconsConfig extends WxBaseRequestConfig { /** * 摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面 */ @@ -416,7 +511,7 @@ declare namespace wx { */ function startSearchBeacons(config: StartSearchBeaconsConfig): void; - interface StopSearchBeaconsConfig { + interface StopSearchBeaconsConfig extends WxBaseRequestConfig { complete(res: any): void; } @@ -425,7 +520,7 @@ declare namespace wx { */ function stopSearchBeacons(config: StopSearchBeaconsConfig): void; - interface OnSearchBeaconsConfig { + interface OnSearchBeaconsConfig extends WxBaseRequestConfig { complete(argv: any): void; } /** @@ -439,7 +534,7 @@ declare namespace wx { */ function closeWindow(): void; - interface MenuItemsConfig { + interface MenuItemsConfig extends WxBaseRequestConfig { /** * 要隐藏/显示的菜单项,只能隐藏“传播类”和“保护类”按钮 */ @@ -466,7 +561,7 @@ declare namespace wx { */ function showAllNonBaseMenuItem(): void; - interface ScanQRCodeConfig { + interface ScanQRCodeConfig extends WxBaseRequestConfig { /** * 默认为0,扫描结果由微信处理,1则直接返回扫描结果, */ @@ -488,7 +583,7 @@ declare namespace wx { */ function scanQRCode(config: ScanQRCodeConfig): void; - interface OpenProductSpecificViewConfig { + interface OpenProductSpecificViewConfig extends WxBaseRequestConfig { /** * 商品id */ @@ -505,7 +600,7 @@ declare namespace wx { */ function openProductSpecificView(config: OpenProductSpecificViewConfig): void; - interface ChooseCardConfig { + interface ChooseCardConfig extends WxBaseRequestConfig { /** * 门店Id */ @@ -578,7 +673,7 @@ declare namespace wx { /** * 需要打开的卡券列表 */ - interface OpenCardConfig { + interface OpenCardConfig extends WxBaseRequestConfig { cardList: OpenCardObj[]; } @@ -587,7 +682,7 @@ declare namespace wx { */ function openCard(config: OpenCardConfig): void; - interface ChooseWXPayConfig { + interface ChooseWXPayConfig extends WxBaseRequestConfig { /** * 支付签名时间戳,注意微信jssdk中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的S字符 */ @@ -612,19 +707,6 @@ declare namespace wx { * 支付签名 */ paySign: string; - - /** - * 支付成功后的回调函数 - */ - success(res: any): void; - /** - * 支付取消后的回调函数 - */ - cancel?(res: any): void; - /** - * 支付失败后的回调函数 - */ - fail?(res: any): void; } /** diff --git a/types/wx-js-sdk-dt/tsconfig.json b/types/wx-js-sdk-dt/tsconfig.json index b97e63e9c3..b8e46b6302 100644 --- a/types/wx-js-sdk-dt/tsconfig.json +++ b/types/wx-js-sdk-dt/tsconfig.json @@ -14,10 +14,13 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "paths": { + "wx-js-sdk-dt": ["."] + } }, "files": [ "index.d.ts", "wx-js-sdk-dt-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts index 212c9a79c1..62b47e355c 100644 --- a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts +++ b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts @@ -16,7 +16,13 @@ wx.error((res: any) => { wx.checkJsApi({ jsApiList: [''], - success: (res) => { + success: res => { + res.checkResult; + if (res.errMsg) { + res.errMsg.msg; + } + }, + complete: () => { } }); @@ -127,3 +133,18 @@ wx.onVoicePlayEnd((res) => { wx.openProductSpecificView({ productId: '' }); + +wx.updateAppMessageShareData({ + title: '', + desc: '', + link: '', + imageUrl: '', + success: () => { + } +}); + +wx.updateTimelineShareData({ + title: '', + link: '', + imageUrl: '' +}); From a767c5576dbcb86c629d080cb419adbda04e6f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Wed, 19 Dec 2018 13:58:45 +0100 Subject: [PATCH 024/646] added context prop to provider + exposed ReactReduxContext from react-redux. --- types/react-redux/index.d.ts | 43 +++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index bcbcced0bd..1a62ed6b56 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -31,7 +31,8 @@ import { Component, ComponentClass, ComponentType, - StatelessComponent + StatelessComponent, + Context } from 'react'; import { @@ -66,10 +67,10 @@ export type AdvancedComponentDecorator = */ export type Matching = { [P in keyof DecorationTargetProps]: P extends keyof InjectedProps - ? InjectedProps[P] extends DecorationTargetProps[P] - ? DecorationTargetProps[P] - : InjectedProps[P] - : DecorationTargetProps[P]; + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; }; /** @@ -114,22 +115,22 @@ export type InferableComponentEnhancer = export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn - ? (...args: TParams) => TReturn - : TActionCreator; + ? (...args: TParams) => TReturn + : TActionCreator; export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any - ? InferThunkActionCreatorType - : TActionCreator; + ? InferThunkActionCreatorType + : TActionCreator; // redux-thunk middleware returns thunk's return value from dispatch call // https://github.com/reduxjs/redux-thunk#composition export type ResolveThunks = TDispatchProps extends { [key: string]: any } - ? { - [C in keyof TDispatchProps]: HandleThunkActionCreator - } - : TDispatchProps; + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps; /** * Connects a React component to a Redux store. @@ -390,11 +391,21 @@ export interface ConnectOptions { withRef?: boolean; } +export interface ReactReduxContextType { + store: Store; + storeState: SS; +} + export interface ProviderProps { /** * The single Redux store in your application. */ store: Store; + /** + * Optional context to be used internally in react-redux. Initial value doesn't matter, as it is overwritten with the + * internal state of Provider. + */ + context?: Context>; } /** @@ -410,3 +421,9 @@ export class Provider extends Component; From 3fe641a47dd4d1a869b7a6af3ad45c3cf8cd6b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Wed, 19 Dec 2018 14:17:54 +0100 Subject: [PATCH 025/646] Changed context prop of Provider to Context to reflect that initial context doesn't matter, as it is overwritten internally in Provider on instantiation. --- types/react-redux/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 1a62ed6b56..101c34dea0 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -402,10 +402,10 @@ export interface ProviderProps { */ store: Store; /** - * Optional context to be used internally in react-redux. Initial value doesn't matter, as it is overwritten with the - * internal state of Provider. + * Optional context to be used internally in react-redux. Use React.createContext() to create a context to be used. + * Initial value doesn't matter, as it is overwritten with the internal state of Provider. */ - context?: Context>; + context?: Context; } /** From 502924bc077aa7d7525a73dfcf03ced125494a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Wed, 19 Dec 2018 14:18:16 +0100 Subject: [PATCH 026/646] Added tests for provider with context. --- types/react-redux/react-redux-tests.tsx | 98 +++++++++++++++---------- 1 file changed, 61 insertions(+), 37 deletions(-) diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 554ace09ff..80545fbcb8 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject, Reducer } from 'redux'; -import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options } from 'react-redux'; +import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options, ReactReduxContext } from 'react-redux'; import objectAssign = require('object-assign'); // @@ -18,7 +18,7 @@ function Empty() { foo: string; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect()(TestComponent); @@ -29,7 +29,7 @@ function MapState() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = (_: any) => ({ bar: 1 @@ -46,7 +46,7 @@ function MapStateWithDispatchProp() { interface OwnProps { foo: string; } interface StateProps { bar: number; dispatch: Dispatch; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = (_: any) => ({ bar: 1 @@ -63,7 +63,7 @@ function MapStateFactory() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = () => () => ({ bar: 1 @@ -80,10 +80,10 @@ function MapDispatch() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); const TestNull = connect( @@ -117,8 +117,8 @@ function MapDispatchWithThunkActionCreators() { interface TestComponentProps extends OwnProps { simpleAction: typeof simpleAction; thunkAction(param1: number, param2: string): Promise; - } - class TestComponent extends React.Component {} + } + class TestComponent extends React.Component { } const mapStateToProps = ({ foo }: { foo: string }) => ({ foo }); const mapDispatchToProps = { simpleAction, thunkAction }; @@ -145,7 +145,7 @@ function MapManualDispatchThatLooksLikeThunk() { } interface TestComponentProps extends OwnProps { remove: (item: string) => () => object; - } + } class TestComponent extends React.Component { render() { return
; @@ -192,7 +192,7 @@ function MapStateAndDispatchObject() { bar: 1 }); - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect( mapStateToProps, @@ -206,10 +206,10 @@ function MapDispatchFactory() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapDispatchToPropsFactory = () => () => ({ - onClick: () => {} + onClick: () => { } }); const TestNull = connect( @@ -232,14 +232,14 @@ function MapStateAndDispatch() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); const Test = connect( @@ -260,10 +260,10 @@ function MapStateFactoryAndDispatch() { }); const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect( mapStateToPropsFactory, @@ -283,10 +283,10 @@ function MapStateFactoryAndDispatchFactory() { }); const mapDispatchToPropsFactory = () => () => ({ - onClick: () => {} + onClick: () => { } }); - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect( mapStateToPropsFactory, @@ -301,14 +301,14 @@ function MapStateAndDispatchAndMerge() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); const mergeProps = (stateProps: StateProps, dispatchProps: DispatchProps) => ( @@ -330,7 +330,7 @@ function MapStateAndOptions() { interface StateProps { bar: number; } interface DispatchProps { dispatch: Dispatch; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = (state: State) => ({ bar: 1 @@ -444,9 +444,9 @@ ReactDOM.render(( declare var store: Store; class MyRootComponent extends React.Component { } -class TodoApp extends React.Component {} +class TodoApp extends React.Component { } interface TodoState { - todos: string[]|string; + todos: string[] | string; } interface TodoProps { userId: number; @@ -629,7 +629,7 @@ function TestTOwnPropsInference() { class OwnPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -667,7 +667,7 @@ function TestTOwnPropsInference() { class AllPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -701,7 +701,7 @@ function TestMergedPropsInference() { class MergedPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -747,7 +747,7 @@ function Issue16652() { comments: Array<({ id: string } | undefined)>; } - class CommentList extends React.Component {} + class CommentList extends React.Component { } const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { return { @@ -861,7 +861,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { const Header = connect( ( - { app: { title }}: { app: { title: string }}, + { app: { title } }: { app: { title: string } }, { extraText }: { extraText: string } ) => ({ title, @@ -873,7 +873,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestInferredFunctionalComponentWithImplicitOwnProps() { @@ -885,7 +885,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { const Header = connect( ( - { app: { title }}: { app: { title: string }}, + { app: { title } }: { app: { title: string } }, ) => ({ title, }), @@ -895,7 +895,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestWrappedComponent() { @@ -1082,7 +1082,7 @@ function TestOptionalPropsMergedCorrectly() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => {} + dependsOnDispatch: () => { } }; } @@ -1126,7 +1126,7 @@ function TestMoreGeneralDecorationProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => {} + dependsOnDispatch: () => { } }; } @@ -1165,7 +1165,7 @@ function TestFailsMoreSpecificInjectedProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => {} + dependsOnDispatch: () => { } }; } @@ -1205,8 +1205,32 @@ function TestLibraryManagedAttributes() { } const ConnectedComponent = connect(mapStateToProps)(Component); - {}} />; + { }} />; const ConnectedComponent2 = connect(mapStateToProps)(Component); - {}} />; + { }} />; +} + +function TestProviderContext() { + + //Internally in react-redux, null is used initially and overwritten in Provider with store and storeState. + const context = React.createContext(null); + + class ComponentWithOwnContext extends React.Component { + public static contextType = context; + } + + + ; + + + class ComponentWithDefaultContext extends React.Component { + public static contextType = ReactReduxContext; + } + + + + ; + + // $ExpectError } From 197e49c7663542eb5a841c2dc50a48bf387f3a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Wed, 19 Dec 2018 14:38:58 +0100 Subject: [PATCH 027/646] Revert editor auto-indentation. --- types/react-redux/index.d.ts | 20 +++---- types/react-redux/react-redux-tests.tsx | 72 ++++++++++++------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 101c34dea0..1ba25ddd43 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -67,10 +67,10 @@ export type AdvancedComponentDecorator = */ export type Matching = { [P in keyof DecorationTargetProps]: P extends keyof InjectedProps - ? InjectedProps[P] extends DecorationTargetProps[P] - ? DecorationTargetProps[P] - : InjectedProps[P] - : DecorationTargetProps[P]; + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; }; /** @@ -115,8 +115,8 @@ export type InferableComponentEnhancer = export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn - ? (...args: TParams) => TReturn - : TActionCreator; + ? (...args: TParams) => TReturn + : TActionCreator; export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any @@ -127,10 +127,10 @@ export type HandleThunkActionCreator = // https://github.com/reduxjs/redux-thunk#composition export type ResolveThunks = TDispatchProps extends { [key: string]: any } - ? { - [C in keyof TDispatchProps]: HandleThunkActionCreator - } - : TDispatchProps; + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps; /** * Connects a React component to a Redux store. diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 80545fbcb8..110d53cc1a 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -18,7 +18,7 @@ function Empty() { foo: string; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect()(TestComponent); @@ -29,7 +29,7 @@ function MapState() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (_: any) => ({ bar: 1 @@ -46,7 +46,7 @@ function MapStateWithDispatchProp() { interface OwnProps { foo: string; } interface StateProps { bar: number; dispatch: Dispatch; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (_: any) => ({ bar: 1 @@ -63,7 +63,7 @@ function MapStateFactory() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => () => ({ bar: 1 @@ -80,10 +80,10 @@ function MapDispatch() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const TestNull = connect( @@ -117,8 +117,8 @@ function MapDispatchWithThunkActionCreators() { interface TestComponentProps extends OwnProps { simpleAction: typeof simpleAction; thunkAction(param1: number, param2: string): Promise; - } - class TestComponent extends React.Component { } + } + class TestComponent extends React.Component {} const mapStateToProps = ({ foo }: { foo: string }) => ({ foo }); const mapDispatchToProps = { simpleAction, thunkAction }; @@ -145,7 +145,7 @@ function MapManualDispatchThatLooksLikeThunk() { } interface TestComponentProps extends OwnProps { remove: (item: string) => () => object; - } + } class TestComponent extends React.Component { render() { return
; @@ -192,7 +192,7 @@ function MapStateAndDispatchObject() { bar: 1 }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToProps, @@ -206,10 +206,10 @@ function MapDispatchFactory() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapDispatchToPropsFactory = () => () => ({ - onClick: () => { } + onClick: () => {} }); const TestNull = connect( @@ -232,14 +232,14 @@ function MapStateAndDispatch() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const Test = connect( @@ -260,10 +260,10 @@ function MapStateFactoryAndDispatch() { }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToPropsFactory, @@ -283,10 +283,10 @@ function MapStateFactoryAndDispatchFactory() { }); const mapDispatchToPropsFactory = () => () => ({ - onClick: () => { } + onClick: () => {} }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToPropsFactory, @@ -301,14 +301,14 @@ function MapStateAndDispatchAndMerge() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const mergeProps = (stateProps: StateProps, dispatchProps: DispatchProps) => ( @@ -330,7 +330,7 @@ function MapStateAndOptions() { interface StateProps { bar: number; } interface DispatchProps { dispatch: Dispatch; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (state: State) => ({ bar: 1 @@ -444,9 +444,9 @@ ReactDOM.render(( declare var store: Store; class MyRootComponent extends React.Component { } -class TodoApp extends React.Component { } +class TodoApp extends React.Component {} interface TodoState { - todos: string[] | string; + todos: string[]|string; } interface TodoProps { userId: number; @@ -629,7 +629,7 @@ function TestTOwnPropsInference() { class OwnPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -667,7 +667,7 @@ function TestTOwnPropsInference() { class AllPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -701,7 +701,7 @@ function TestMergedPropsInference() { class MergedPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -747,7 +747,7 @@ function Issue16652() { comments: Array<({ id: string } | undefined)>; } - class CommentList extends React.Component { } + class CommentList extends React.Component {} const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { return { @@ -861,7 +861,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { const Header = connect( ( - { app: { title } }: { app: { title: string } }, + { app: { title }}: { app: { title: string }}, { extraText }: { extraText: string } ) => ({ title, @@ -873,7 +873,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestInferredFunctionalComponentWithImplicitOwnProps() { @@ -885,7 +885,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { const Header = connect( ( - { app: { title } }: { app: { title: string } }, + { app: { title }}: { app: { title: string }}, ) => ({ title, }), @@ -895,7 +895,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestWrappedComponent() { @@ -1082,7 +1082,7 @@ function TestOptionalPropsMergedCorrectly() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1126,7 +1126,7 @@ function TestMoreGeneralDecorationProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1165,7 +1165,7 @@ function TestFailsMoreSpecificInjectedProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1205,10 +1205,10 @@ function TestLibraryManagedAttributes() { } const ConnectedComponent = connect(mapStateToProps)(Component); - { }} />; + {}} />; const ConnectedComponent2 = connect(mapStateToProps)(Component); - { }} />; + {}} />; } function TestProviderContext() { From 8b5375508616f03d99524e9249ddd7a3acb5d24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Wed, 19 Dec 2018 14:38:58 +0100 Subject: [PATCH 028/646] Revert editor auto-indentation. --- types/react-redux/index.d.ts | 24 ++++----- types/react-redux/react-redux-tests.tsx | 72 ++++++++++++------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 101c34dea0..8ff3352ecb 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -67,10 +67,10 @@ export type AdvancedComponentDecorator = */ export type Matching = { [P in keyof DecorationTargetProps]: P extends keyof InjectedProps - ? InjectedProps[P] extends DecorationTargetProps[P] - ? DecorationTargetProps[P] - : InjectedProps[P] - : DecorationTargetProps[P]; + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; }; /** @@ -115,22 +115,22 @@ export type InferableComponentEnhancer = export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn - ? (...args: TParams) => TReturn - : TActionCreator; + ? (...args: TParams) => TReturn + : TActionCreator; export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any - ? InferThunkActionCreatorType - : TActionCreator; + ? InferThunkActionCreatorType + : TActionCreator; // redux-thunk middleware returns thunk's return value from dispatch call // https://github.com/reduxjs/redux-thunk#composition export type ResolveThunks = TDispatchProps extends { [key: string]: any } - ? { - [C in keyof TDispatchProps]: HandleThunkActionCreator - } - : TDispatchProps; + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps; /** * Connects a React component to a Redux store. diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 80545fbcb8..110d53cc1a 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -18,7 +18,7 @@ function Empty() { foo: string; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect()(TestComponent); @@ -29,7 +29,7 @@ function MapState() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (_: any) => ({ bar: 1 @@ -46,7 +46,7 @@ function MapStateWithDispatchProp() { interface OwnProps { foo: string; } interface StateProps { bar: number; dispatch: Dispatch; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (_: any) => ({ bar: 1 @@ -63,7 +63,7 @@ function MapStateFactory() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => () => ({ bar: 1 @@ -80,10 +80,10 @@ function MapDispatch() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const TestNull = connect( @@ -117,8 +117,8 @@ function MapDispatchWithThunkActionCreators() { interface TestComponentProps extends OwnProps { simpleAction: typeof simpleAction; thunkAction(param1: number, param2: string): Promise; - } - class TestComponent extends React.Component { } + } + class TestComponent extends React.Component {} const mapStateToProps = ({ foo }: { foo: string }) => ({ foo }); const mapDispatchToProps = { simpleAction, thunkAction }; @@ -145,7 +145,7 @@ function MapManualDispatchThatLooksLikeThunk() { } interface TestComponentProps extends OwnProps { remove: (item: string) => () => object; - } + } class TestComponent extends React.Component { render() { return
; @@ -192,7 +192,7 @@ function MapStateAndDispatchObject() { bar: 1 }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToProps, @@ -206,10 +206,10 @@ function MapDispatchFactory() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapDispatchToPropsFactory = () => () => ({ - onClick: () => { } + onClick: () => {} }); const TestNull = connect( @@ -232,14 +232,14 @@ function MapStateAndDispatch() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const Test = connect( @@ -260,10 +260,10 @@ function MapStateFactoryAndDispatch() { }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToPropsFactory, @@ -283,10 +283,10 @@ function MapStateFactoryAndDispatchFactory() { }); const mapDispatchToPropsFactory = () => () => ({ - onClick: () => { } + onClick: () => {} }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToPropsFactory, @@ -301,14 +301,14 @@ function MapStateAndDispatchAndMerge() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const mergeProps = (stateProps: StateProps, dispatchProps: DispatchProps) => ( @@ -330,7 +330,7 @@ function MapStateAndOptions() { interface StateProps { bar: number; } interface DispatchProps { dispatch: Dispatch; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (state: State) => ({ bar: 1 @@ -444,9 +444,9 @@ ReactDOM.render(( declare var store: Store; class MyRootComponent extends React.Component { } -class TodoApp extends React.Component { } +class TodoApp extends React.Component {} interface TodoState { - todos: string[] | string; + todos: string[]|string; } interface TodoProps { userId: number; @@ -629,7 +629,7 @@ function TestTOwnPropsInference() { class OwnPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -667,7 +667,7 @@ function TestTOwnPropsInference() { class AllPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -701,7 +701,7 @@ function TestMergedPropsInference() { class MergedPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -747,7 +747,7 @@ function Issue16652() { comments: Array<({ id: string } | undefined)>; } - class CommentList extends React.Component { } + class CommentList extends React.Component {} const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { return { @@ -861,7 +861,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { const Header = connect( ( - { app: { title } }: { app: { title: string } }, + { app: { title }}: { app: { title: string }}, { extraText }: { extraText: string } ) => ({ title, @@ -873,7 +873,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestInferredFunctionalComponentWithImplicitOwnProps() { @@ -885,7 +885,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { const Header = connect( ( - { app: { title } }: { app: { title: string } }, + { app: { title }}: { app: { title: string }}, ) => ({ title, }), @@ -895,7 +895,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestWrappedComponent() { @@ -1082,7 +1082,7 @@ function TestOptionalPropsMergedCorrectly() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1126,7 +1126,7 @@ function TestMoreGeneralDecorationProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1165,7 +1165,7 @@ function TestFailsMoreSpecificInjectedProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1205,10 +1205,10 @@ function TestLibraryManagedAttributes() { } const ConnectedComponent = connect(mapStateToProps)(Component); - { }} />; + {}} />; const ConnectedComponent2 = connect(mapStateToProps)(Component); - { }} />; + {}} />; } function TestProviderContext() { From ffb95adb2717d637da0459705cae7b5411df7667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Wed, 19 Dec 2018 15:19:28 +0100 Subject: [PATCH 029/646] Added context to connectAdvanced options. --- types/react-redux/index.d.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 8ff3352ecb..914505b2a9 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -389,13 +389,21 @@ export interface ConnectOptions { * @default false */ withRef?: boolean; + /** + * The react context to get the store from. + * + * @default ReactReduxContext + */ + context?: Context; } -export interface ReactReduxContextType { +export interface ReactReduxContextObject { store: Store; storeState: SS; } +export type ReactReduxContextType = Context> + export interface ProviderProps { /** * The single Redux store in your application. @@ -403,7 +411,8 @@ export interface ProviderProps { store: Store; /** * Optional context to be used internally in react-redux. Use React.createContext() to create a context to be used. - * Initial value doesn't matter, as it is overwritten with the internal state of Provider. + * If this is used, generate own connect HOC by using connectAdvanced, supplying the same context provided to the + * Provider. Initial value doesn't matter, as it is overwritten with the internal state of Provider. */ context?: Context; } @@ -426,4 +435,4 @@ export function createProvider(storeKey: string): typeof Provider; * Exposes the internal context used in react-redux. It is generally advised to use the connect HOC to connect to the * redux store instead of this approeach. */ -export const ReactReduxContext: Context; +export const ReactReduxContext: ReactReduxContextType; From e93e7d6d8d5945efab20a47417c0acdf1bba6ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Thu, 20 Dec 2018 08:14:10 +0100 Subject: [PATCH 030/646] Fixed lint errors. --- types/react-redux/index.d.ts | 6 +++--- types/react-redux/react-redux-tests.tsx | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 914505b2a9..a182c15526 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -391,7 +391,7 @@ export interface ConnectOptions { withRef?: boolean; /** * The react context to get the store from. - * + * * @default ReactReduxContext */ context?: Context; @@ -402,7 +402,7 @@ export interface ReactReduxContextObject storeState: SS; } -export type ReactReduxContextType = Context> +export type ReactReduxContextType = Context>; export interface ProviderProps { /** @@ -411,7 +411,7 @@ export interface ProviderProps { store: Store; /** * Optional context to be used internally in react-redux. Use React.createContext() to create a context to be used. - * If this is used, generate own connect HOC by using connectAdvanced, supplying the same context provided to the + * If this is used, generate own connect HOC by using connectAdvanced, supplying the same context provided to the * Provider. Initial value doesn't matter, as it is overwritten with the internal state of Provider. */ context?: Context; diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 110d53cc1a..ba42d57f28 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1212,25 +1212,24 @@ function TestLibraryManagedAttributes() { } function TestProviderContext() { - - //Internally in react-redux, null is used initially and overwritten in Provider with store and storeState. + // Internally in react-redux, null is used initially and overwritten in Provider with store and storeState. const context = React.createContext(null); class ComponentWithOwnContext extends React.Component { - public static contextType = context; + static contextType = context; } ; - + ; class ComponentWithDefaultContext extends React.Component { - public static contextType = ReactReduxContext; + static contextType = ReactReduxContext; } ; - // $ExpectError + ; // $ExpectError } From a329287eb6d7f02b1b98020726fe290b822ed2a8 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Thu, 20 Dec 2018 13:50:56 -0500 Subject: [PATCH 031/646] [intl-tel-input] Enable importing as a module. --- types/intl-tel-input/global.d.ts | 395 ++++++++++++++++++ types/intl-tel-input/index.d.ts | 400 +------------------ types/intl-tel-input/intl-tel-input-tests.ts | 5 + types/intl-tel-input/test/module-tests.ts | 4 + types/intl-tel-input/tsconfig.json | 3 +- 5 files changed, 414 insertions(+), 393 deletions(-) create mode 100644 types/intl-tel-input/global.d.ts create mode 100644 types/intl-tel-input/test/module-tests.ts diff --git a/types/intl-tel-input/global.d.ts b/types/intl-tel-input/global.d.ts new file mode 100644 index 0000000000..7c09dc07f0 --- /dev/null +++ b/types/intl-tel-input/global.d.ts @@ -0,0 +1,395 @@ +declare namespace IntlTelInput { + interface Static { + /** + * Default options for all instances + */ + defaults: Options; + + /** + * Get all of the plugin's country data - either to re-use elsewhere + * e.g. to populate a country dropdown. + */ + getCountryData(): intlTelInputUtils.CountryData[]; + + /** + * Load the utils.js script (included in the lib directory) to enable + * formatting/validation etc. + */ + loadUtils(path: string, utilsScriptDeferred?: boolean): void; + } + + interface Plugin { + /** + * Remove the plugin from the input, and unbind any event listeners. + */ + destroy(): void; + + /** + * Get the extension from the current number. + * Requires the utilsScript option. + * e.g. if the input value was "(702) 555-5555 ext. 1234", this would + * return "1234". + */ + getExtension(): string; + + /** + * Get the current number in the given format (defaults to E.164 standard). + * The different formats are available in the enum + * intlTelInputUtils.numberFormat - taken from here. + * Requires the utilsScript option. + * Note that even if nationalMode is enabled, this can still return a full + * international number. + * @param numberFormat the format in which the number will be returned. + */ + getNumber(numberFormat?: intlTelInputUtils.numberFormat): string; + + /** + * Get the type (fixed-line/mobile/toll-free etc) of the current number. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum intlTelInputUtils.numberType. + * Note that in the US there's no way to differentiate between fixed-line and + * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. + */ + getNumberType(): intlTelInputUtils.numberType; + + /** + * Get the country data for the currently selected flag. + */ + getSelectedCountryData(): intlTelInputUtils.CountryData; + + /** + * Get more information about a validation error. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum ValidationError + */ + getValidationError(): intlTelInputUtils.validationError; + + /** + * Validate the current number. Expects an internationally formatted number + * (unless nationalMode is enabled). If validation fails, you can use + * getValidationError to get more information. + * Requires the utilsScript option. + * Also see getNumberType if you want to make sure the user enters a certain + * type of number e.g. a mobile number. + */ + isValidNumber(): boolean; + + /** + * Change the country selection (e.g. when the user is entering their address). + * @param countryCode country code of the country to be set. + */ + setCountry(countryCode: string): void; + + /** + * Insert a number, and update the selected flag accordingly. + * Note that by default, if nationalMode is enabled it will try to use + * national formatting. + * @param aNumber number to be set. + */ + setNumber(aNumber: string): void; + + /** + * Set the type of the placeholder number + * @param type Placeholder number type to be set + */ + setPlaceholderNumberType(type: intlTelInputUtils.placeholderNumberType): void; + } + + interface JQueryPlugin { + /** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ + (options?: Options): JQueryDeferred; + + /** + * Remove the plugin from the input, and unbind any event listeners. + */ + (method: 'destroy'): void; + + /** + * Get the extension from the current number. + * Requires the utilsScript option. + * e.g. if the input value was "(702) 555-5555 ext. 1234", this would + * return "1234". + */ + (method: 'getExtension'): string; + + /** + * Get the current number in the given format (defaults to E.164 standard). + * The different formats are available in the enum + * intlTelInputUtils.numberFormat - taken from here. + * Requires the utilsScript option. + * Note that even if nationalMode is enabled, this can still return a full + * international number. + * @param numberFormat the format in which the number will be returned. + */ + (method: 'getNumber', numberFormat?: intlTelInputUtils.numberFormat): string; + (method: string, numberFormat: intlTelInputUtils.numberFormat): string; + + /** + * Get the type (fixed-line/mobile/toll-free etc) of the current number. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum intlTelInputUtils.numberType. + * Note that in the US there's no way to differentiate between fixed-line and + * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. + */ + (method: 'getNumberType'): intlTelInputUtils.numberType; + + /** + * Get the country data for the currently selected flag. + */ + (method: 'getSelectedCountryData'): intlTelInputUtils.CountryData; + + /** + * Get more information about a validation error. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum ValidationError + */ + (method: 'getValidationError'): intlTelInputUtils.validationError; + + /** + * Validate the current number. Expects an internationally formatted number + * (unless nationalMode is enabled). If validation fails, you can use + * getValidationError to get more information. + * Requires the utilsScript option. + * Also see getNumberType if you want to make sure the user enters a certain + * type of number e.g. a mobile number. + */ + (method: 'isValidNumber'): boolean; + + /** + * Change the country selection (e.g. when the user is entering their address). + * @param countryCode country code of the country to be set. + */ + (method: 'setCountry', countryCode: string): void; + + /** + * Insert a number, and update the selected flag accordingly. + * Note that by default, if nationalMode is enabled it will try to use + * national formatting. + * @param aNumber number to be set. + */ + (method: 'setNumber', aNumber: string): void; + + /** + * Set the type of the placeholder number + * @param type Placeholder number type to be set + */ + (method: 'setPlaceholderNumberType', type: intlTelInputUtils.placeholderNumberType): void; + } + + interface Options { + /** + * Whether or not to allow the dropdown. If disabled, there is no dropdown + * arrow, and the selected flag is not clickable. Also we display the + * selected flag on the right instead because it is just a marker of state. + * Default = true + */ + allowDropdown?: boolean; + + /** + * If there is just a dial code in the input: remove it on blur or submit, + * and re-add it on focus. This is to prevent just a dial code getting + * submitted with the form. Requires nationalMode to be set to false. + * Default = true + */ + autoHideDialCode?: boolean; + + /** + * Set the input's placeholder to an example number for the selected country, and update it if the country changes. + * You can specify the number type using the placeholderNumberType option. + * By default it is set to "polite", which means it will only set the placeholder if the input doesn't already have one. + * You can also set it to "aggressive", which will replace any existing placeholder, or "off". + * Requires the utilsScript option. + * Default = "polite" + */ + autoPlaceholder?: "off" | "polite" | "aggressive"; + + /** + * Change the placeholder generated by autoPlaceholder. Must return a string. + * Default = null + */ + customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: intlTelInputUtils.CountryData) => string; + + /** + * Expects a node e.g. document.body. Instead of putting the country dropdown next to the input, + * append it to the specified node, and it will then be positioned absolutely next to the input using JavaScript. + * This is useful when the input is inside a container with overflow: hidden. + * Note that the absolute positioning can be broken by scrolling, so it will automatically close on the window scroll event. + * Default = null + */ + dropdownContainer?: Node; + + /** + * In the dropdown, display all countries except the ones you specify here. + * Default = null + */ + excludeCountries?: string[]; + + /** + * Format the input value (according to the nationalMode option) during initialisation, and on setNumber. + * Requires the utilsScript option. + * Default = true + */ + formatOnDisplay?: boolean; + + /** + * When setting initialCountry to "auto", you must use this option to + * specify a custom function that looks up the user's location, + * and then calls the success callback with the relevant country code. + * Also note that when instantiating the plugin, if the Promise object is defined, + * one of those is returned under the promise instance property, so you can + * do something like iti.promise.then(callback) to know when initialisation requests like this have completed. + * Default = null + */ + geoIpLookup?: (callback: (countryCode: string) => void) => void; + + /** + * Add a hidden input with the given name (or if your input name contains square brackets then it will give the hidden input the same name, + * replacing the contents of the brackets with the given name). On submit, populate it with the full international number (using getNumber). + * This is a quick way for people using non-ajax forms to get the full international number, even when nationalMode is enabled. + * Note: requires the input to be inside a form element, as this feature works by listening for the submit event on the closest form element. + * Also note that since this uses getNumber internally, it expects a valid number, and so should only be used after validation. + * Default = "" + */ + hiddenInput?: string; + + /** + * Set the initial country selection by specifying it's country code. + * You can also set it to "auto", which will lookup the user's country based + * on their IP address (requires the geoIpLookup option). + * Note that the "auto" option will not update the country selection if the + * input already contains a number. If you leave initialCountry blank, + * it will default to the first country in the list. + */ + initialCountry?: string; + + /** + * Allows to translate the countries by its given iso code e.g.: { 'de': 'Deutschland' } + * Default = {} + */ + localizedCountries?: object; + + /** + * Allow users to enter national numbers (and not have to think about + * international dial codes). Formatting, validation and placeholders still + * work. Then you can use getNumber to extract a full international number. + * This option now defaults to true, and it is recommended that you leave it + * that way as it provides a better experience for the user. + * Default = true + */ + nationalMode?: boolean; + + /** + * In the dropdown, display only the countries you specify. + * Default = undefined + */ + onlyCountries?: string[]; + + /** + * Specify one of the keys from the global enum intlTelInputUtils.numberType + * e.g. "FIXED_LINE" to set the number type to use for the placeholder. + * Default = MOBILE + */ + placeholderNumberType?: intlTelInputUtils.placeholderNumberType; + + /** + * Specify the countries to appear at the top of the list. + * Default = ["us", "gb"] + */ + preferredCountries?: string[]; + + /** + * Display the country dial code next to the selected flag so it's not part + * of the typed number. Note that this will disable nationalMode because + * technically we are dealing with international numbers, but with the + * dial code separated. + * Default = false + */ + separateDialCode?: boolean; + + /** + * Enable formatting/validation etc. by specifying the URL of the included utils.js script + * (or alternatively just point it to the file on cdnjs.com). The script is fetched when the page has finished loading (on the window load event) + * to prevent blocking (the script is ~215KB). When instantiating the plugin, if the Promise object is defined, + * one of those is returned under the promise instance property, so you can do something like + * iti.promise.then(callback) to know when initialisation requests like this have finished. + * Note that if you're lazy loading the plugin script itself (intlTelInput.js) + * this will not work and you will need to use the loadUtils method instead. + * Example: "build/js/utils.js" + * Default = "" + */ + utilsScript?: string; + } +} + +declare namespace intlTelInputUtils { + interface CountryData { + name: string; + iso2: string; + dialCode: string; + } + + enum numberFormat { + E164 = 0, + INTERNATIONAL = 1, + NATIONAL = 2, + RFC3966 = 3 + } + + enum numberType { + FIXED_LINE = 0, + MOBILE = 1, + FIXED_LINE_OR_MOBILE = 2, + TOLL_FREE = 3, + PREMIUM_RATE = 4, + SHARED_COST = 5, + VOIP = 6, + PERSONAL_NUMBER = 7, + PAGER = 8, + UAN = 9, + VOICEMAIL = 10, + UNKNOWN = -1 + } + + enum validationError { + IS_POSSIBLE = 0, + INVALID_COUNTRY_CODE = 1, + TOO_SHORT = 2, + TOO_LONG = 3, + NOT_A_NUMBER = 4 + } + + type placeholderNumberType = + | "FIXED_LINE_OR_MOBILE" + | "FIXED_LINE" + | "MOBILE" + | "PAGER" + | "PERSONAL_NUMBER" + | "PREMIUM_RATE" + | "SHARED_COST" + | "TOLL_FREE" + | "UAN" + | "UNKNOWN" + | "VOICEMAIL" + | "VOIP"; +} + +interface Window { + intlTelInputGlobals: IntlTelInput.Static; + + /** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ + intlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; +} + +interface JQuery { + intlTelInput: IntlTelInput.JQueryPlugin; +} diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index 667a210087..7bb99accb6 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -4,398 +4,14 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -declare namespace IntlTelInput { - interface Static { - /** - * Default options for all instances - */ - defaults: Options; +/// - /** - * Get all of the plugin's country data - either to re-use elsewhere - * e.g. to populate a country dropdown. - */ - getCountryData(): intlTelInputUtils.CountryData[]; +export as namespace intlTelInput; - /** - * Load the utils.js script (included in the lib directory) to enable - * formatting/validation etc. - */ - loadUtils(path: string, utilsScriptDeferred?: boolean): void; - } +export = IntlTelInput; - interface Plugin { - /** - * Remove the plugin from the input, and unbind any event listeners. - */ - destroy(): void; - - /** - * Get the extension from the current number. - * Requires the utilsScript option. - * e.g. if the input value was "(702) 555-5555 ext. 1234", this would - * return "1234". - */ - getExtension(): string; - - /** - * Get the current number in the given format (defaults to E.164 standard). - * The different formats are available in the enum - * intlTelInputUtils.numberFormat - taken from here. - * Requires the utilsScript option. - * Note that even if nationalMode is enabled, this can still return a full - * international number. - * @param numberFormat the format in which the number will be returned. - */ - getNumber(numberFormat?: intlTelInputUtils.numberFormat): string; - - /** - * Get the type (fixed-line/mobile/toll-free etc) of the current number. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum intlTelInputUtils.numberType. - * Note that in the US there's no way to differentiate between fixed-line and - * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. - */ - getNumberType(): intlTelInputUtils.numberType; - - /** - * Get the country data for the currently selected flag. - */ - getSelectedCountryData(): intlTelInputUtils.CountryData; - - /** - * Get more information about a validation error. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum ValidationError - */ - getValidationError(): intlTelInputUtils.validationError; - - /** - * Validate the current number. Expects an internationally formatted number - * (unless nationalMode is enabled). If validation fails, you can use - * getValidationError to get more information. - * Requires the utilsScript option. - * Also see getNumberType if you want to make sure the user enters a certain - * type of number e.g. a mobile number. - */ - isValidNumber(): boolean; - - /** - * Change the country selection (e.g. when the user is entering their address). - * @param countryCode country code of the country to be set. - */ - setCountry(countryCode: string): void; - - /** - * Insert a number, and update the selected flag accordingly. - * Note that by default, if nationalMode is enabled it will try to use - * national formatting. - * @param aNumber number to be set. - */ - setNumber(aNumber: string): void; - - /** - * Set the type of the placeholder number - * @param type Placeholder number type to be set - */ - setPlaceholderNumberType(type: intlTelInputUtils.placeholderNumberType): void; - } - - interface JQueryPlugin { - /** - * initialise the plugin with optional options. - * @param options options that can be provided during initialization. - */ - (options?: Options): JQueryDeferred; - - /** - * Remove the plugin from the input, and unbind any event listeners. - */ - (method: 'destroy'): void; - - /** - * Get the extension from the current number. - * Requires the utilsScript option. - * e.g. if the input value was "(702) 555-5555 ext. 1234", this would - * return "1234". - */ - (method: 'getExtension'): string; - - /** - * Get the current number in the given format (defaults to E.164 standard). - * The different formats are available in the enum - * intlTelInputUtils.numberFormat - taken from here. - * Requires the utilsScript option. - * Note that even if nationalMode is enabled, this can still return a full - * international number. - * @param numberFormat the format in which the number will be returned. - */ - (method: 'getNumber', numberFormat?: intlTelInputUtils.numberFormat): string; - (method: string, numberFormat: intlTelInputUtils.numberFormat): string; - - /** - * Get the type (fixed-line/mobile/toll-free etc) of the current number. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum intlTelInputUtils.numberType. - * Note that in the US there's no way to differentiate between fixed-line and - * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. - */ - (method: 'getNumberType'): intlTelInputUtils.numberType; - - /** - * Get the country data for the currently selected flag. - */ - (method: 'getSelectedCountryData'): intlTelInputUtils.CountryData; - - /** - * Get more information about a validation error. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum ValidationError - */ - (method: 'getValidationError'): intlTelInputUtils.validationError; - - /** - * Validate the current number. Expects an internationally formatted number - * (unless nationalMode is enabled). If validation fails, you can use - * getValidationError to get more information. - * Requires the utilsScript option. - * Also see getNumberType if you want to make sure the user enters a certain - * type of number e.g. a mobile number. - */ - (method: 'isValidNumber'): boolean; - - /** - * Change the country selection (e.g. when the user is entering their address). - * @param countryCode country code of the country to be set. - */ - (method: 'setCountry', countryCode: string): void; - - /** - * Insert a number, and update the selected flag accordingly. - * Note that by default, if nationalMode is enabled it will try to use - * national formatting. - * @param aNumber number to be set. - */ - (method: 'setNumber', aNumber: string): void; - - /** - * Set the type of the placeholder number - * @param type Placeholder number type to be set - */ - (method: 'setPlaceholderNumberType', type: intlTelInputUtils.placeholderNumberType): void; - } - - interface Options { - /** - * Whether or not to allow the dropdown. If disabled, there is no dropdown - * arrow, and the selected flag is not clickable. Also we display the - * selected flag on the right instead because it is just a marker of state. - * Default = true - */ - allowDropdown?: boolean; - - /** - * If there is just a dial code in the input: remove it on blur or submit, - * and re-add it on focus. This is to prevent just a dial code getting - * submitted with the form. Requires nationalMode to be set to false. - * Default = true - */ - autoHideDialCode?: boolean; - - /** - * Set the input's placeholder to an example number for the selected country, and update it if the country changes. - * You can specify the number type using the placeholderNumberType option. - * By default it is set to "polite", which means it will only set the placeholder if the input doesn't already have one. - * You can also set it to "aggressive", which will replace any existing placeholder, or "off". - * Requires the utilsScript option. - * Default = "polite" - */ - autoPlaceholder?: "off" | "polite" | "aggressive"; - - /** - * Change the placeholder generated by autoPlaceholder. Must return a string. - * Default = null - */ - customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: intlTelInputUtils.CountryData) => string; - - /** - * Expects a node e.g. document.body. Instead of putting the country dropdown next to the input, - * append it to the specified node, and it will then be positioned absolutely next to the input using JavaScript. - * This is useful when the input is inside a container with overflow: hidden. - * Note that the absolute positioning can be broken by scrolling, so it will automatically close on the window scroll event. - * Default = null - */ - dropdownContainer?: Node; - - /** - * In the dropdown, display all countries except the ones you specify here. - * Default = null - */ - excludeCountries?: string[]; - - /** - * Format the input value (according to the nationalMode option) during initialisation, and on setNumber. - * Requires the utilsScript option. - * Default = true - */ - formatOnDisplay?: boolean; - - /** - * When setting initialCountry to "auto", you must use this option to - * specify a custom function that looks up the user's location, - * and then calls the success callback with the relevant country code. - * Also note that when instantiating the plugin, if the Promise object is defined, - * one of those is returned under the promise instance property, so you can - * do something like iti.promise.then(callback) to know when initialisation requests like this have completed. - * Default = null - */ - geoIpLookup?: (callback: (countryCode: string) => void) => void; - - /** - * Add a hidden input with the given name (or if your input name contains square brackets then it will give the hidden input the same name, - * replacing the contents of the brackets with the given name). On submit, populate it with the full international number (using getNumber). - * This is a quick way for people using non-ajax forms to get the full international number, even when nationalMode is enabled. - * Note: requires the input to be inside a form element, as this feature works by listening for the submit event on the closest form element. - * Also note that since this uses getNumber internally, it expects a valid number, and so should only be used after validation. - * Default = "" - */ - hiddenInput?: string; - - /** - * Set the initial country selection by specifying it's country code. - * You can also set it to "auto", which will lookup the user's country based - * on their IP address (requires the geoIpLookup option). - * Note that the "auto" option will not update the country selection if the - * input already contains a number. If you leave initialCountry blank, - * it will default to the first country in the list. - */ - initialCountry?: string; - - /** - * Allows to translate the countries by its given iso code e.g.: { 'de': 'Deutschland' } - * Default = {} - */ - localizedCountries?: object; - - /** - * Allow users to enter national numbers (and not have to think about - * international dial codes). Formatting, validation and placeholders still - * work. Then you can use getNumber to extract a full international number. - * This option now defaults to true, and it is recommended that you leave it - * that way as it provides a better experience for the user. - * Default = true - */ - nationalMode?: boolean; - - /** - * In the dropdown, display only the countries you specify. - * Default = undefined - */ - onlyCountries?: string[]; - - /** - * Specify one of the keys from the global enum intlTelInputUtils.numberType - * e.g. "FIXED_LINE" to set the number type to use for the placeholder. - * Default = MOBILE - */ - placeholderNumberType?: intlTelInputUtils.placeholderNumberType; - - /** - * Specify the countries to appear at the top of the list. - * Default = ["us", "gb"] - */ - preferredCountries?: string[]; - - /** - * Display the country dial code next to the selected flag so it's not part - * of the typed number. Note that this will disable nationalMode because - * technically we are dealing with international numbers, but with the - * dial code separated. - * Default = false - */ - separateDialCode?: boolean; - - /** - * Enable formatting/validation etc. by specifying the URL of the included utils.js script - * (or alternatively just point it to the file on cdnjs.com). The script is fetched when the page has finished loading (on the window load event) - * to prevent blocking (the script is ~215KB). When instantiating the plugin, if the Promise object is defined, - * one of those is returned under the promise instance property, so you can do something like - * iti.promise.then(callback) to know when initialisation requests like this have finished. - * Note that if you're lazy loading the plugin script itself (intlTelInput.js) - * this will not work and you will need to use the loadUtils method instead. - * Example: "build/js/utils.js" - * Default = "" - */ - utilsScript?: string; - } -} - -declare namespace intlTelInputUtils { - interface CountryData { - name: string; - iso2: string; - dialCode: string; - } - - enum numberFormat { - E164 = 0, - INTERNATIONAL = 1, - NATIONAL = 2, - RFC3966 = 3 - } - - enum numberType { - FIXED_LINE = 0, - MOBILE = 1, - FIXED_LINE_OR_MOBILE = 2, - TOLL_FREE = 3, - PREMIUM_RATE = 4, - SHARED_COST = 5, - VOIP = 6, - PERSONAL_NUMBER = 7, - PAGER = 8, - UAN = 9, - VOICEMAIL = 10, - UNKNOWN = -1 - } - - enum validationError { - IS_POSSIBLE = 0, - INVALID_COUNTRY_CODE = 1, - TOO_SHORT = 2, - TOO_LONG = 3, - NOT_A_NUMBER = 4 - } - - type placeholderNumberType = - | "FIXED_LINE_OR_MOBILE" - | "FIXED_LINE" - | "MOBILE" - | "PAGER" - | "PERSONAL_NUMBER" - | "PREMIUM_RATE" - | "SHARED_COST" - | "TOLL_FREE" - | "UAN" - | "UNKNOWN" - | "VOICEMAIL" - | "VOIP"; -} - -interface Window { - intlTelInputGlobals: IntlTelInput.Static; - - /** - * initialise the plugin with optional options. - * @param options options that can be provided during initialization. - */ - intlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; -} - -interface JQuery { - intlTelInput: IntlTelInput.JQueryPlugin; -} +/** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ +declare function IntlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; diff --git a/types/intl-tel-input/intl-tel-input-tests.ts b/types/intl-tel-input/intl-tel-input-tests.ts index ab6808bbed..6bb705cafb 100644 --- a/types/intl-tel-input/intl-tel-input-tests.ts +++ b/types/intl-tel-input/intl-tel-input-tests.ts @@ -1,5 +1,10 @@ /// +// Global + +// $ExpectType (node: Element, options?: Options) => Plugin +intlTelInput; + // Normal version const input = document.querySelector("#phone"); diff --git a/types/intl-tel-input/test/module-tests.ts b/types/intl-tel-input/test/module-tests.ts new file mode 100644 index 0000000000..d1f85574dc --- /dev/null +++ b/types/intl-tel-input/test/module-tests.ts @@ -0,0 +1,4 @@ +import intlTelInput = require('intl-tel-input'); + +// $ExpectType (node: Element, options?: Options) => Plugin +intlTelInput; diff --git a/types/intl-tel-input/tsconfig.json b/types/intl-tel-input/tsconfig.json index e067880440..302c298ef8 100644 --- a/types/intl-tel-input/tsconfig.json +++ b/types/intl-tel-input/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "intl-tel-input-tests.ts" + "intl-tel-input-tests.ts", + "test/module-tests.ts" ] } From f7bb21cb75d96eefbdbe5c597fc5b76436a593cb Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Thu, 20 Dec 2018 13:58:58 -0500 Subject: [PATCH 032/646] [intl-tel-input] Format header. --- types/intl-tel-input/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index 7bb99accb6..feb08fbed6 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for intl-tel-input 14.0 // Project: https://github.com/jackocnr/intl-tel-input -// Definitions by: Fidan Hakaj , Leonard Thieu , Márton Molnár +// Definitions by: Fidan Hakaj +// Leonard Thieu +// Márton Molnár // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 9bbad69ad25892b481b1a0511d8964c675513e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Fri, 21 Dec 2018 10:06:32 +0100 Subject: [PATCH 033/646] Added type requirements to context supplied to Provider. --- types/react-redux/index.d.ts | 32 ++++----- types/react-redux/react-redux-tests.tsx | 93 +++++++++++++------------ 2 files changed, 63 insertions(+), 62 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index a182c15526..352c72d7a7 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -67,10 +67,10 @@ export type AdvancedComponentDecorator = */ export type Matching = { [P in keyof DecorationTargetProps]: P extends keyof InjectedProps - ? InjectedProps[P] extends DecorationTargetProps[P] - ? DecorationTargetProps[P] - : InjectedProps[P] - : DecorationTargetProps[P]; + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; }; /** @@ -115,22 +115,22 @@ export type InferableComponentEnhancer = export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn - ? (...args: TParams) => TReturn - : TActionCreator; + ? (...args: TParams) => TReturn + : TActionCreator; export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any - ? InferThunkActionCreatorType - : TActionCreator; + ? InferThunkActionCreatorType + : TActionCreator; // redux-thunk middleware returns thunk's return value from dispatch call // https://github.com/reduxjs/redux-thunk#composition export type ResolveThunks = TDispatchProps extends { [key: string]: any } - ? { - [C in keyof TDispatchProps]: HandleThunkActionCreator - } - : TDispatchProps; + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps; /** * Connects a React component to a Redux store. @@ -394,7 +394,7 @@ export interface ConnectOptions { * * @default ReactReduxContext */ - context?: Context; + context?: Context; } export interface ReactReduxContextObject { @@ -402,8 +402,6 @@ export interface ReactReduxContextObject storeState: SS; } -export type ReactReduxContextType = Context>; - export interface ProviderProps { /** * The single Redux store in your application. @@ -414,7 +412,7 @@ export interface ProviderProps { * If this is used, generate own connect HOC by using connectAdvanced, supplying the same context provided to the * Provider. Initial value doesn't matter, as it is overwritten with the internal state of Provider. */ - context?: Context; + context?: Context; } /** @@ -435,4 +433,4 @@ export function createProvider(storeKey: string): typeof Provider; * Exposes the internal context used in react-redux. It is generally advised to use the connect HOC to connect to the * redux store instead of this approeach. */ -export const ReactReduxContext: ReactReduxContextType; +export const ReactReduxContext: Context; diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index ba42d57f28..e7c7bca3ce 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject, Reducer } from 'redux'; -import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options, ReactReduxContext } from 'react-redux'; +import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options, ReactReduxContext, ReactReduxContextObject } from 'react-redux'; import objectAssign = require('object-assign'); // @@ -18,7 +18,7 @@ function Empty() { foo: string; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect()(TestComponent); @@ -29,7 +29,7 @@ function MapState() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = (_: any) => ({ bar: 1 @@ -46,7 +46,7 @@ function MapStateWithDispatchProp() { interface OwnProps { foo: string; } interface StateProps { bar: number; dispatch: Dispatch; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = (_: any) => ({ bar: 1 @@ -63,7 +63,7 @@ function MapStateFactory() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = () => () => ({ bar: 1 @@ -80,10 +80,10 @@ function MapDispatch() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); const TestNull = connect( @@ -117,8 +117,8 @@ function MapDispatchWithThunkActionCreators() { interface TestComponentProps extends OwnProps { simpleAction: typeof simpleAction; thunkAction(param1: number, param2: string): Promise; - } - class TestComponent extends React.Component {} + } + class TestComponent extends React.Component { } const mapStateToProps = ({ foo }: { foo: string }) => ({ foo }); const mapDispatchToProps = { simpleAction, thunkAction }; @@ -145,7 +145,7 @@ function MapManualDispatchThatLooksLikeThunk() { } interface TestComponentProps extends OwnProps { remove: (item: string) => () => object; - } + } class TestComponent extends React.Component { render() { return
; @@ -192,7 +192,7 @@ function MapStateAndDispatchObject() { bar: 1 }); - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect( mapStateToProps, @@ -206,10 +206,10 @@ function MapDispatchFactory() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapDispatchToPropsFactory = () => () => ({ - onClick: () => {} + onClick: () => { } }); const TestNull = connect( @@ -232,14 +232,14 @@ function MapStateAndDispatch() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); const Test = connect( @@ -260,10 +260,10 @@ function MapStateFactoryAndDispatch() { }); const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect( mapStateToPropsFactory, @@ -283,10 +283,10 @@ function MapStateFactoryAndDispatchFactory() { }); const mapDispatchToPropsFactory = () => () => ({ - onClick: () => {} + onClick: () => { } }); - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const Test = connect( mapStateToPropsFactory, @@ -301,14 +301,14 @@ function MapStateAndDispatchAndMerge() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => {} + onClick: () => { } }); const mergeProps = (stateProps: StateProps, dispatchProps: DispatchProps) => ( @@ -330,7 +330,7 @@ function MapStateAndOptions() { interface StateProps { bar: number; } interface DispatchProps { dispatch: Dispatch; } - class TestComponent extends React.Component {} + class TestComponent extends React.Component { } const mapStateToProps = (state: State) => ({ bar: 1 @@ -444,9 +444,9 @@ ReactDOM.render(( declare var store: Store; class MyRootComponent extends React.Component { } -class TodoApp extends React.Component {} +class TodoApp extends React.Component { } interface TodoState { - todos: string[]|string; + todos: string[] | string; } interface TodoProps { userId: number; @@ -629,7 +629,7 @@ function TestTOwnPropsInference() { class OwnPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -667,7 +667,7 @@ function TestTOwnPropsInference() { class AllPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -701,7 +701,7 @@ function TestMergedPropsInference() { class MergedPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -747,7 +747,7 @@ function Issue16652() { comments: Array<({ id: string } | undefined)>; } - class CommentList extends React.Component {} + class CommentList extends React.Component { } const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { return { @@ -861,7 +861,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { const Header = connect( ( - { app: { title }}: { app: { title: string }}, + { app: { title } }: { app: { title: string } }, { extraText }: { extraText: string } ) => ({ title, @@ -873,7 +873,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestInferredFunctionalComponentWithImplicitOwnProps() { @@ -885,7 +885,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { const Header = connect( ( - { app: { title }}: { app: { title: string }}, + { app: { title } }: { app: { title: string } }, ) => ({ title, }), @@ -895,7 +895,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestWrappedComponent() { @@ -1082,7 +1082,7 @@ function TestOptionalPropsMergedCorrectly() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => {} + dependsOnDispatch: () => { } }; } @@ -1126,7 +1126,7 @@ function TestMoreGeneralDecorationProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => {} + dependsOnDispatch: () => { } }; } @@ -1165,7 +1165,7 @@ function TestFailsMoreSpecificInjectedProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => {} + dependsOnDispatch: () => { } }; } @@ -1205,24 +1205,26 @@ function TestLibraryManagedAttributes() { } const ConnectedComponent = connect(mapStateToProps)(Component); - {}} />; + { }} />; const ConnectedComponent2 = connect(mapStateToProps)(Component); - {}} />; + { }} />; } function TestProviderContext() { - // Internally in react-redux, null is used initially and overwritten in Provider with store and storeState. - const context = React.createContext(null); + const store: Store = createStore((state = {}) => state); + const nullContext = React.createContext(null); - class ComponentWithOwnContext extends React.Component { - static contextType = context; - } + // To ensure type safety when consuming the context in an app, a null-context does not suffice. + ; // $ExpectError - - ; - ; + // Providing a an object of the correct type ensures type safety when consuming the context. + const initialContextValue: ReactReduxContextObject = { storeState: null, store }; + const context = React.createContext(initialContextValue); + ; + + // react-redux exports a default context used internally if none is supplied, used as shown below. class ComponentWithDefaultContext extends React.Component { static contextType = ReactReduxContext; } @@ -1231,5 +1233,6 @@ function TestProviderContext() { ; + // Null is not a valid value for the context. ; // $ExpectError } From 1ce633c3083281d001498478f8fb5f1c40b1b077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Fri, 21 Dec 2018 10:06:58 +0100 Subject: [PATCH 034/646] Bumped version to 7.0. --- types/react-redux/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 352c72d7a7..fc06356465 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-redux 6.0 +// Type definitions for react-redux 7.0 // Project: https://github.com/reduxjs/react-redux // Definitions by: Qubo , // Kenzie Togami , From d710b22e3094588089d84572297796cf43c9f298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Fri, 21 Dec 2018 10:18:45 +0100 Subject: [PATCH 035/646] Removed explicit default type parameter. --- types/react-redux/react-redux-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index e7c7bca3ce..017ba61d30 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1212,7 +1212,7 @@ function TestLibraryManagedAttributes() { } function TestProviderContext() { - const store: Store = createStore((state = {}) => state); + const store: Store = createStore((state = {}) => state); const nullContext = React.createContext(null); // To ensure type safety when consuming the context in an app, a null-context does not suffice. From 9a1e55c1e889fb7fae8caf86830a05ad8a630047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Fri, 21 Dec 2018 12:04:25 +0100 Subject: [PATCH 036/646] Reverted autoformatting. --- types/react-redux/index.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index fc06356465..408ef1ad9a 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -67,10 +67,10 @@ export type AdvancedComponentDecorator = */ export type Matching = { [P in keyof DecorationTargetProps]: P extends keyof InjectedProps - ? InjectedProps[P] extends DecorationTargetProps[P] - ? DecorationTargetProps[P] - : InjectedProps[P] - : DecorationTargetProps[P]; + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; }; /** @@ -115,22 +115,22 @@ export type InferableComponentEnhancer = export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn - ? (...args: TParams) => TReturn - : TActionCreator; + ? (...args: TParams) => TReturn + : TActionCreator; export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any - ? InferThunkActionCreatorType - : TActionCreator; + ? InferThunkActionCreatorType + : TActionCreator; // redux-thunk middleware returns thunk's return value from dispatch call // https://github.com/reduxjs/redux-thunk#composition export type ResolveThunks = TDispatchProps extends { [key: string]: any } - ? { - [C in keyof TDispatchProps]: HandleThunkActionCreator - } - : TDispatchProps; + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps; /** * Connects a React component to a Redux store. From 5196b80b78f9565731377379df46217ce5602ba4 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Fri, 21 Dec 2018 13:37:52 -0500 Subject: [PATCH 037/646] [intl-tel-input] Hide types that are not imported in modules. --- types/intl-tel-input/global.d.ts | 395 -------------------- types/intl-tel-input/index.d.ts | 432 +++++++++++++++++++++- types/intl-tel-input/test/module-tests.ts | 5 + 3 files changed, 435 insertions(+), 397 deletions(-) delete mode 100644 types/intl-tel-input/global.d.ts diff --git a/types/intl-tel-input/global.d.ts b/types/intl-tel-input/global.d.ts deleted file mode 100644 index 7c09dc07f0..0000000000 --- a/types/intl-tel-input/global.d.ts +++ /dev/null @@ -1,395 +0,0 @@ -declare namespace IntlTelInput { - interface Static { - /** - * Default options for all instances - */ - defaults: Options; - - /** - * Get all of the plugin's country data - either to re-use elsewhere - * e.g. to populate a country dropdown. - */ - getCountryData(): intlTelInputUtils.CountryData[]; - - /** - * Load the utils.js script (included in the lib directory) to enable - * formatting/validation etc. - */ - loadUtils(path: string, utilsScriptDeferred?: boolean): void; - } - - interface Plugin { - /** - * Remove the plugin from the input, and unbind any event listeners. - */ - destroy(): void; - - /** - * Get the extension from the current number. - * Requires the utilsScript option. - * e.g. if the input value was "(702) 555-5555 ext. 1234", this would - * return "1234". - */ - getExtension(): string; - - /** - * Get the current number in the given format (defaults to E.164 standard). - * The different formats are available in the enum - * intlTelInputUtils.numberFormat - taken from here. - * Requires the utilsScript option. - * Note that even if nationalMode is enabled, this can still return a full - * international number. - * @param numberFormat the format in which the number will be returned. - */ - getNumber(numberFormat?: intlTelInputUtils.numberFormat): string; - - /** - * Get the type (fixed-line/mobile/toll-free etc) of the current number. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum intlTelInputUtils.numberType. - * Note that in the US there's no way to differentiate between fixed-line and - * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. - */ - getNumberType(): intlTelInputUtils.numberType; - - /** - * Get the country data for the currently selected flag. - */ - getSelectedCountryData(): intlTelInputUtils.CountryData; - - /** - * Get more information about a validation error. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum ValidationError - */ - getValidationError(): intlTelInputUtils.validationError; - - /** - * Validate the current number. Expects an internationally formatted number - * (unless nationalMode is enabled). If validation fails, you can use - * getValidationError to get more information. - * Requires the utilsScript option. - * Also see getNumberType if you want to make sure the user enters a certain - * type of number e.g. a mobile number. - */ - isValidNumber(): boolean; - - /** - * Change the country selection (e.g. when the user is entering their address). - * @param countryCode country code of the country to be set. - */ - setCountry(countryCode: string): void; - - /** - * Insert a number, and update the selected flag accordingly. - * Note that by default, if nationalMode is enabled it will try to use - * national formatting. - * @param aNumber number to be set. - */ - setNumber(aNumber: string): void; - - /** - * Set the type of the placeholder number - * @param type Placeholder number type to be set - */ - setPlaceholderNumberType(type: intlTelInputUtils.placeholderNumberType): void; - } - - interface JQueryPlugin { - /** - * initialise the plugin with optional options. - * @param options options that can be provided during initialization. - */ - (options?: Options): JQueryDeferred; - - /** - * Remove the plugin from the input, and unbind any event listeners. - */ - (method: 'destroy'): void; - - /** - * Get the extension from the current number. - * Requires the utilsScript option. - * e.g. if the input value was "(702) 555-5555 ext. 1234", this would - * return "1234". - */ - (method: 'getExtension'): string; - - /** - * Get the current number in the given format (defaults to E.164 standard). - * The different formats are available in the enum - * intlTelInputUtils.numberFormat - taken from here. - * Requires the utilsScript option. - * Note that even if nationalMode is enabled, this can still return a full - * international number. - * @param numberFormat the format in which the number will be returned. - */ - (method: 'getNumber', numberFormat?: intlTelInputUtils.numberFormat): string; - (method: string, numberFormat: intlTelInputUtils.numberFormat): string; - - /** - * Get the type (fixed-line/mobile/toll-free etc) of the current number. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum intlTelInputUtils.numberType. - * Note that in the US there's no way to differentiate between fixed-line and - * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. - */ - (method: 'getNumberType'): intlTelInputUtils.numberType; - - /** - * Get the country data for the currently selected flag. - */ - (method: 'getSelectedCountryData'): intlTelInputUtils.CountryData; - - /** - * Get more information about a validation error. - * Requires the utilsScript option. - * Returns an integer, which you can match against the various options in the - * global enum ValidationError - */ - (method: 'getValidationError'): intlTelInputUtils.validationError; - - /** - * Validate the current number. Expects an internationally formatted number - * (unless nationalMode is enabled). If validation fails, you can use - * getValidationError to get more information. - * Requires the utilsScript option. - * Also see getNumberType if you want to make sure the user enters a certain - * type of number e.g. a mobile number. - */ - (method: 'isValidNumber'): boolean; - - /** - * Change the country selection (e.g. when the user is entering their address). - * @param countryCode country code of the country to be set. - */ - (method: 'setCountry', countryCode: string): void; - - /** - * Insert a number, and update the selected flag accordingly. - * Note that by default, if nationalMode is enabled it will try to use - * national formatting. - * @param aNumber number to be set. - */ - (method: 'setNumber', aNumber: string): void; - - /** - * Set the type of the placeholder number - * @param type Placeholder number type to be set - */ - (method: 'setPlaceholderNumberType', type: intlTelInputUtils.placeholderNumberType): void; - } - - interface Options { - /** - * Whether or not to allow the dropdown. If disabled, there is no dropdown - * arrow, and the selected flag is not clickable. Also we display the - * selected flag on the right instead because it is just a marker of state. - * Default = true - */ - allowDropdown?: boolean; - - /** - * If there is just a dial code in the input: remove it on blur or submit, - * and re-add it on focus. This is to prevent just a dial code getting - * submitted with the form. Requires nationalMode to be set to false. - * Default = true - */ - autoHideDialCode?: boolean; - - /** - * Set the input's placeholder to an example number for the selected country, and update it if the country changes. - * You can specify the number type using the placeholderNumberType option. - * By default it is set to "polite", which means it will only set the placeholder if the input doesn't already have one. - * You can also set it to "aggressive", which will replace any existing placeholder, or "off". - * Requires the utilsScript option. - * Default = "polite" - */ - autoPlaceholder?: "off" | "polite" | "aggressive"; - - /** - * Change the placeholder generated by autoPlaceholder. Must return a string. - * Default = null - */ - customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: intlTelInputUtils.CountryData) => string; - - /** - * Expects a node e.g. document.body. Instead of putting the country dropdown next to the input, - * append it to the specified node, and it will then be positioned absolutely next to the input using JavaScript. - * This is useful when the input is inside a container with overflow: hidden. - * Note that the absolute positioning can be broken by scrolling, so it will automatically close on the window scroll event. - * Default = null - */ - dropdownContainer?: Node; - - /** - * In the dropdown, display all countries except the ones you specify here. - * Default = null - */ - excludeCountries?: string[]; - - /** - * Format the input value (according to the nationalMode option) during initialisation, and on setNumber. - * Requires the utilsScript option. - * Default = true - */ - formatOnDisplay?: boolean; - - /** - * When setting initialCountry to "auto", you must use this option to - * specify a custom function that looks up the user's location, - * and then calls the success callback with the relevant country code. - * Also note that when instantiating the plugin, if the Promise object is defined, - * one of those is returned under the promise instance property, so you can - * do something like iti.promise.then(callback) to know when initialisation requests like this have completed. - * Default = null - */ - geoIpLookup?: (callback: (countryCode: string) => void) => void; - - /** - * Add a hidden input with the given name (or if your input name contains square brackets then it will give the hidden input the same name, - * replacing the contents of the brackets with the given name). On submit, populate it with the full international number (using getNumber). - * This is a quick way for people using non-ajax forms to get the full international number, even when nationalMode is enabled. - * Note: requires the input to be inside a form element, as this feature works by listening for the submit event on the closest form element. - * Also note that since this uses getNumber internally, it expects a valid number, and so should only be used after validation. - * Default = "" - */ - hiddenInput?: string; - - /** - * Set the initial country selection by specifying it's country code. - * You can also set it to "auto", which will lookup the user's country based - * on their IP address (requires the geoIpLookup option). - * Note that the "auto" option will not update the country selection if the - * input already contains a number. If you leave initialCountry blank, - * it will default to the first country in the list. - */ - initialCountry?: string; - - /** - * Allows to translate the countries by its given iso code e.g.: { 'de': 'Deutschland' } - * Default = {} - */ - localizedCountries?: object; - - /** - * Allow users to enter national numbers (and not have to think about - * international dial codes). Formatting, validation and placeholders still - * work. Then you can use getNumber to extract a full international number. - * This option now defaults to true, and it is recommended that you leave it - * that way as it provides a better experience for the user. - * Default = true - */ - nationalMode?: boolean; - - /** - * In the dropdown, display only the countries you specify. - * Default = undefined - */ - onlyCountries?: string[]; - - /** - * Specify one of the keys from the global enum intlTelInputUtils.numberType - * e.g. "FIXED_LINE" to set the number type to use for the placeholder. - * Default = MOBILE - */ - placeholderNumberType?: intlTelInputUtils.placeholderNumberType; - - /** - * Specify the countries to appear at the top of the list. - * Default = ["us", "gb"] - */ - preferredCountries?: string[]; - - /** - * Display the country dial code next to the selected flag so it's not part - * of the typed number. Note that this will disable nationalMode because - * technically we are dealing with international numbers, but with the - * dial code separated. - * Default = false - */ - separateDialCode?: boolean; - - /** - * Enable formatting/validation etc. by specifying the URL of the included utils.js script - * (or alternatively just point it to the file on cdnjs.com). The script is fetched when the page has finished loading (on the window load event) - * to prevent blocking (the script is ~215KB). When instantiating the plugin, if the Promise object is defined, - * one of those is returned under the promise instance property, so you can do something like - * iti.promise.then(callback) to know when initialisation requests like this have finished. - * Note that if you're lazy loading the plugin script itself (intlTelInput.js) - * this will not work and you will need to use the loadUtils method instead. - * Example: "build/js/utils.js" - * Default = "" - */ - utilsScript?: string; - } -} - -declare namespace intlTelInputUtils { - interface CountryData { - name: string; - iso2: string; - dialCode: string; - } - - enum numberFormat { - E164 = 0, - INTERNATIONAL = 1, - NATIONAL = 2, - RFC3966 = 3 - } - - enum numberType { - FIXED_LINE = 0, - MOBILE = 1, - FIXED_LINE_OR_MOBILE = 2, - TOLL_FREE = 3, - PREMIUM_RATE = 4, - SHARED_COST = 5, - VOIP = 6, - PERSONAL_NUMBER = 7, - PAGER = 8, - UAN = 9, - VOICEMAIL = 10, - UNKNOWN = -1 - } - - enum validationError { - IS_POSSIBLE = 0, - INVALID_COUNTRY_CODE = 1, - TOO_SHORT = 2, - TOO_LONG = 3, - NOT_A_NUMBER = 4 - } - - type placeholderNumberType = - | "FIXED_LINE_OR_MOBILE" - | "FIXED_LINE" - | "MOBILE" - | "PAGER" - | "PERSONAL_NUMBER" - | "PREMIUM_RATE" - | "SHARED_COST" - | "TOLL_FREE" - | "UAN" - | "UNKNOWN" - | "VOICEMAIL" - | "VOIP"; -} - -interface Window { - intlTelInputGlobals: IntlTelInput.Static; - - /** - * initialise the plugin with optional options. - * @param options options that can be provided during initialization. - */ - intlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; -} - -interface JQuery { - intlTelInput: IntlTelInput.JQueryPlugin; -} diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index feb08fbed6..be705c86b6 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -6,8 +6,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// - export as namespace intlTelInput; export = IntlTelInput; @@ -17,3 +15,433 @@ export = IntlTelInput; * @param options options that can be provided during initialization. */ declare function IntlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; + +declare namespace IntlTelInput { + interface Static { + /** + * Default options for all instances + */ + defaults: Options; + + /** + * Get all of the plugin's country data - either to re-use elsewhere + * e.g. to populate a country dropdown. + */ + getCountryData(): intlTelInputUtils.CountryData[]; + + /** + * Load the utils.js script (included in the lib directory) to enable + * formatting/validation etc. + */ + loadUtils(path: string, utilsScriptDeferred?: boolean): void; + } + + interface Plugin { + /** + * Remove the plugin from the input, and unbind any event listeners. + */ + destroy(): void; + + /** + * Get the extension from the current number. + * Requires the utilsScript option. + * e.g. if the input value was "(702) 555-5555 ext. 1234", this would + * return "1234". + */ + getExtension(): string; + + /** + * Get the current number in the given format (defaults to E.164 standard). + * The different formats are available in the enum + * intlTelInputUtils.numberFormat - taken from here. + * Requires the utilsScript option. + * Note that even if nationalMode is enabled, this can still return a full + * international number. + * @param numberFormat the format in which the number will be returned. + */ + getNumber(numberFormat?: intlTelInputUtils.numberFormat): string; + + /** + * Get the type (fixed-line/mobile/toll-free etc) of the current number. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum intlTelInputUtils.numberType. + * Note that in the US there's no way to differentiate between fixed-line and + * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. + */ + getNumberType(): intlTelInputUtils.numberType; + + /** + * Get the country data for the currently selected flag. + */ + getSelectedCountryData(): intlTelInputUtils.CountryData; + + /** + * Get more information about a validation error. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum ValidationError + */ + getValidationError(): intlTelInputUtils.validationError; + + /** + * Validate the current number. Expects an internationally formatted number + * (unless nationalMode is enabled). If validation fails, you can use + * getValidationError to get more information. + * Requires the utilsScript option. + * Also see getNumberType if you want to make sure the user enters a certain + * type of number e.g. a mobile number. + */ + isValidNumber(): boolean; + + /** + * Change the country selection (e.g. when the user is entering their address). + * @param countryCode country code of the country to be set. + */ + setCountry(countryCode: string): void; + + /** + * Insert a number, and update the selected flag accordingly. + * Note that by default, if nationalMode is enabled it will try to use + * national formatting. + * @param aNumber number to be set. + */ + setNumber(aNumber: string): void; + + /** + * Set the type of the placeholder number + * @param type Placeholder number type to be set + */ + setPlaceholderNumberType(type: intlTelInputUtils.placeholderNumberType): void; + } + + interface JQueryPlugin { + /** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ + (options?: Options): JQueryDeferred; + + /** + * Remove the plugin from the input, and unbind any event listeners. + */ + (method: 'destroy'): void; + + /** + * Get the extension from the current number. + * Requires the utilsScript option. + * e.g. if the input value was "(702) 555-5555 ext. 1234", this would + * return "1234". + */ + (method: 'getExtension'): string; + + /** + * Get the current number in the given format (defaults to E.164 standard). + * The different formats are available in the enum + * intlTelInputUtils.numberFormat - taken from here. + * Requires the utilsScript option. + * Note that even if nationalMode is enabled, this can still return a full + * international number. + * @param numberFormat the format in which the number will be returned. + */ + (method: 'getNumber', numberFormat?: intlTelInputUtils.numberFormat): string; + (method: string, numberFormat: intlTelInputUtils.numberFormat): string; + + /** + * Get the type (fixed-line/mobile/toll-free etc) of the current number. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum intlTelInputUtils.numberType. + * Note that in the US there's no way to differentiate between fixed-line and + * mobile numbers, so instead it will return FIXED_LINE_OR_MOBILE. + */ + (method: 'getNumberType'): intlTelInputUtils.numberType; + + /** + * Get the country data for the currently selected flag. + */ + (method: 'getSelectedCountryData'): intlTelInputUtils.CountryData; + + /** + * Get more information about a validation error. + * Requires the utilsScript option. + * Returns an integer, which you can match against the various options in the + * global enum ValidationError + */ + (method: 'getValidationError'): intlTelInputUtils.validationError; + + /** + * Validate the current number. Expects an internationally formatted number + * (unless nationalMode is enabled). If validation fails, you can use + * getValidationError to get more information. + * Requires the utilsScript option. + * Also see getNumberType if you want to make sure the user enters a certain + * type of number e.g. a mobile number. + */ + (method: 'isValidNumber'): boolean; + + /** + * Change the country selection (e.g. when the user is entering their address). + * @param countryCode country code of the country to be set. + */ + (method: 'setCountry', countryCode: string): void; + + /** + * Insert a number, and update the selected flag accordingly. + * Note that by default, if nationalMode is enabled it will try to use + * national formatting. + * @param aNumber number to be set. + */ + (method: 'setNumber', aNumber: string): void; + + /** + * Set the type of the placeholder number + * @param type Placeholder number type to be set + */ + (method: 'setPlaceholderNumberType', type: intlTelInputUtils.placeholderNumberType): void; + } + + interface Options { + /** + * Whether or not to allow the dropdown. If disabled, there is no dropdown + * arrow, and the selected flag is not clickable. Also we display the + * selected flag on the right instead because it is just a marker of state. + * Default = true + */ + allowDropdown?: boolean; + + /** + * If there is just a dial code in the input: remove it on blur or submit, + * and re-add it on focus. This is to prevent just a dial code getting + * submitted with the form. Requires nationalMode to be set to false. + * Default = true + */ + autoHideDialCode?: boolean; + + /** + * Set the input's placeholder to an example number for the selected country, and update it if the country changes. + * You can specify the number type using the placeholderNumberType option. + * By default it is set to "polite", which means it will only set the placeholder if the input doesn't already have one. + * You can also set it to "aggressive", which will replace any existing placeholder, or "off". + * Requires the utilsScript option. + * Default = "polite" + */ + autoPlaceholder?: "off" | "polite" | "aggressive"; + + /** + * Change the placeholder generated by autoPlaceholder. Must return a string. + * Default = null + */ + customPlaceholder?: (selectedCountryPlaceholder: string, selectedCountryData: intlTelInputUtils.CountryData) => string; + + /** + * Expects a node e.g. document.body. Instead of putting the country dropdown next to the input, + * append it to the specified node, and it will then be positioned absolutely next to the input using JavaScript. + * This is useful when the input is inside a container with overflow: hidden. + * Note that the absolute positioning can be broken by scrolling, so it will automatically close on the window scroll event. + * Default = null + */ + dropdownContainer?: Node; + + /** + * In the dropdown, display all countries except the ones you specify here. + * Default = null + */ + excludeCountries?: string[]; + + /** + * Format the input value (according to the nationalMode option) during initialisation, and on setNumber. + * Requires the utilsScript option. + * Default = true + */ + formatOnDisplay?: boolean; + + /** + * When setting initialCountry to "auto", you must use this option to + * specify a custom function that looks up the user's location, + * and then calls the success callback with the relevant country code. + * Also note that when instantiating the plugin, if the Promise object is defined, + * one of those is returned under the promise instance property, so you can + * do something like iti.promise.then(callback) to know when initialisation requests like this have completed. + * Default = null + */ + geoIpLookup?: (callback: (countryCode: string) => void) => void; + + /** + * Add a hidden input with the given name (or if your input name contains square brackets then it will give the hidden input the same name, + * replacing the contents of the brackets with the given name). On submit, populate it with the full international number (using getNumber). + * This is a quick way for people using non-ajax forms to get the full international number, even when nationalMode is enabled. + * Note: requires the input to be inside a form element, as this feature works by listening for the submit event on the closest form element. + * Also note that since this uses getNumber internally, it expects a valid number, and so should only be used after validation. + * Default = "" + */ + hiddenInput?: string; + + /** + * Set the initial country selection by specifying it's country code. + * You can also set it to "auto", which will lookup the user's country based + * on their IP address (requires the geoIpLookup option). + * Note that the "auto" option will not update the country selection if the + * input already contains a number. If you leave initialCountry blank, + * it will default to the first country in the list. + */ + initialCountry?: string; + + /** + * Allows to translate the countries by its given iso code e.g.: { 'de': 'Deutschland' } + * Default = {} + */ + localizedCountries?: object; + + /** + * Allow users to enter national numbers (and not have to think about + * international dial codes). Formatting, validation and placeholders still + * work. Then you can use getNumber to extract a full international number. + * This option now defaults to true, and it is recommended that you leave it + * that way as it provides a better experience for the user. + * Default = true + */ + nationalMode?: boolean; + + /** + * In the dropdown, display only the countries you specify. + * Default = undefined + */ + onlyCountries?: string[]; + + /** + * Specify one of the keys from the global enum intlTelInputUtils.numberType + * e.g. "FIXED_LINE" to set the number type to use for the placeholder. + * Default = MOBILE + */ + placeholderNumberType?: intlTelInputUtils.placeholderNumberType; + + /** + * Specify the countries to appear at the top of the list. + * Default = ["us", "gb"] + */ + preferredCountries?: string[]; + + /** + * Display the country dial code next to the selected flag so it's not part + * of the typed number. Note that this will disable nationalMode because + * technically we are dealing with international numbers, but with the + * dial code separated. + * Default = false + */ + separateDialCode?: boolean; + + /** + * Enable formatting/validation etc. by specifying the URL of the included utils.js script + * (or alternatively just point it to the file on cdnjs.com). The script is fetched when the page has finished loading (on the window load event) + * to prevent blocking (the script is ~215KB). When instantiating the plugin, if the Promise object is defined, + * one of those is returned under the promise instance property, so you can do something like + * iti.promise.then(callback) to know when initialisation requests like this have finished. + * Note that if you're lazy loading the plugin script itself (intlTelInput.js) + * this will not work and you will need to use the loadUtils method instead. + * Example: "build/js/utils.js" + * Default = "" + */ + utilsScript?: string; + } +} + +declare namespace intlTelInputUtils { + interface CountryData { + name: string; + iso2: string; + dialCode: string; + } + + enum numberFormat { + E164 = 0, + INTERNATIONAL = 1, + NATIONAL = 2, + RFC3966 = 3 + } + + enum numberType { + FIXED_LINE = 0, + MOBILE = 1, + FIXED_LINE_OR_MOBILE = 2, + TOLL_FREE = 3, + PREMIUM_RATE = 4, + SHARED_COST = 5, + VOIP = 6, + PERSONAL_NUMBER = 7, + PAGER = 8, + UAN = 9, + VOICEMAIL = 10, + UNKNOWN = -1 + } + + enum validationError { + IS_POSSIBLE = 0, + INVALID_COUNTRY_CODE = 1, + TOO_SHORT = 2, + TOO_LONG = 3, + NOT_A_NUMBER = 4 + } + + type placeholderNumberType = + | "FIXED_LINE_OR_MOBILE" + | "FIXED_LINE" + | "MOBILE" + | "PAGER" + | "PERSONAL_NUMBER" + | "PREMIUM_RATE" + | "SHARED_COST" + | "TOLL_FREE" + | "UAN" + | "UNKNOWN" + | "VOICEMAIL" + | "VOIP"; +} + +declare global { + namespace intlTelInputUtils { + enum numberFormat { + E164 = 0, + INTERNATIONAL = 1, + NATIONAL = 2, + RFC3966 = 3 + } + + enum numberType { + FIXED_LINE = 0, + MOBILE = 1, + FIXED_LINE_OR_MOBILE = 2, + TOLL_FREE = 3, + PREMIUM_RATE = 4, + SHARED_COST = 5, + VOIP = 6, + PERSONAL_NUMBER = 7, + PAGER = 8, + UAN = 9, + VOICEMAIL = 10, + UNKNOWN = -1 + } + + enum validationError { + IS_POSSIBLE = 0, + INVALID_COUNTRY_CODE = 1, + TOO_SHORT = 2, + TOO_LONG = 3, + NOT_A_NUMBER = 4 + } + } + + interface Window { + intlTelInputGlobals: IntlTelInput.Static; + + /** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ + intlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; + } + + interface JQuery { + intlTelInput: IntlTelInput.JQueryPlugin; + } +} diff --git a/types/intl-tel-input/test/module-tests.ts b/types/intl-tel-input/test/module-tests.ts index d1f85574dc..13ee33c6e2 100644 --- a/types/intl-tel-input/test/module-tests.ts +++ b/types/intl-tel-input/test/module-tests.ts @@ -2,3 +2,8 @@ import intlTelInput = require('intl-tel-input'); // $ExpectType (node: Element, options?: Options) => Plugin intlTelInput; + +// $ExpectError +const options: IntlTelInput.Options = { + allowDropdown: true +}; From 157cf118d886e5b059e07a836d127598ebcfe635 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Mon, 24 Dec 2018 17:36:03 -0500 Subject: [PATCH 038/646] [intl-tel-input] Add `promise` property. --- types/intl-tel-input/index.d.ts | 2 ++ types/intl-tel-input/test/module-tests.ts | 27 ++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index be705c86b6..f0c8407f18 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -37,6 +37,8 @@ declare namespace IntlTelInput { } interface Plugin { + promise: Promise; + /** * Remove the plugin from the input, and unbind any event listeners. */ diff --git a/types/intl-tel-input/test/module-tests.ts b/types/intl-tel-input/test/module-tests.ts index 13ee33c6e2..4bfdd3c6a7 100644 --- a/types/intl-tel-input/test/module-tests.ts +++ b/types/intl-tel-input/test/module-tests.ts @@ -1,9 +1,24 @@ import intlTelInput = require('intl-tel-input'); -// $ExpectType (node: Element, options?: Options) => Plugin -intlTelInput; +function test_import() { + // $ExpectType (node: Element, options?: Options) => Plugin + intlTelInput; +} -// $ExpectError -const options: IntlTelInput.Options = { - allowDropdown: true -}; +function test_IntlTelInput_not_visible() { + // $ExpectError + const options: IntlTelInput.Options = { + allowDropdown: true + }; +} + +function test_intlTelInputUtils_global() { + const input = document.querySelector('#phone'); + const iti = intlTelInput(input, { + utilsScript: 'node_modules/intl-tel-input/build/js/utils.js' + }); + + iti.promise.then(() => { + console.log(intlTelInputUtils.numberFormat.E164); + }); +} From 15a42cb90767d65bed9c7a10a1e5a8515cae9286 Mon Sep 17 00:00:00 2001 From: Rishi Sharma <5098873+rthreei@users.noreply.github.com> Date: Mon, 31 Dec 2018 16:49:43 -0500 Subject: [PATCH 039/646] Adds ensure to API interface --- types/xmlpoke/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/xmlpoke/index.d.ts b/types/xmlpoke/index.d.ts index d8566d4364..68bde4f9ab 100644 --- a/types/xmlpoke/index.d.ts +++ b/types/xmlpoke/index.d.ts @@ -25,6 +25,7 @@ declare module XmlPoke { // ghost module withBasePath(xpath: string): API; addNamespace(prefix: string, uri: string): API; errorOnNoMatches(): API; + ensure(xpath: string): API; } interface CDataValue { value: string; From a85ec9001a6a77c53fe59f84aa7b4a1a3fb0580e Mon Sep 17 00:00:00 2001 From: Rishi Sharma <5098873+rthreei@users.noreply.github.com> Date: Mon, 31 Dec 2018 16:54:26 -0500 Subject: [PATCH 040/646] Add a test --- types/xmlpoke/xmlpoke-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/xmlpoke/xmlpoke-tests.ts b/types/xmlpoke/xmlpoke-tests.ts index 1079d19756..04cab2aa1f 100644 --- a/types/xmlpoke/xmlpoke-tests.ts +++ b/types/xmlpoke/xmlpoke-tests.ts @@ -76,3 +76,7 @@ result = xmlpoke('', xml => return 'y'; })); assert.equal(result, 'y'); + +// ensure +result = xmlpoke('', xml => xml.ensure('a/b')); +assert.equal(result, ''); From b5bb7b09f84bffe6a229f0349c4565c717ba6656 Mon Sep 17 00:00:00 2001 From: Ivan Ha Date: Tue, 1 Jan 2019 09:51:17 +0800 Subject: [PATCH 041/646] [randomcolor] support for setting hue from a hex color --- types/randomcolor/index.d.ts | 4 ++-- types/randomcolor/randomcolor-tests.ts | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/types/randomcolor/index.d.ts b/types/randomcolor/index.d.ts index 8a95bf6d65..d0d36297b8 100644 --- a/types/randomcolor/index.d.ts +++ b/types/randomcolor/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for randomColor 0.5.0 +// Type definitions for randomColor 0.5.2 // Project: https://github.com/davidmerfield/randomColor // Definitions by: Mathias Feitzinger , Brady Liles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,7 +6,7 @@ declare function randomColor(options?: RandomColorOptions): string; interface RandomColorOptions { - hue?: number | "red" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "monochrome" | "random"; + hue?: number | string; luminosity?: "bright" | "light" | "dark" | "random"; count?: number; seed?: number | string; diff --git a/types/randomcolor/randomcolor-tests.ts b/types/randomcolor/randomcolor-tests.ts index 5bd36b7eb4..595ea0781f 100644 --- a/types/randomcolor/randomcolor-tests.ts +++ b/types/randomcolor/randomcolor-tests.ts @@ -35,4 +35,16 @@ randomColor({ randomColor({ luminosity: 'light', format: 'hsla' // e.g. 'hsla(27, 88.99%, 81.83%, 0.6450211517512798)' -}); \ No newline at end of file +}); + +// Returns a dark RGB color with specified alpha +randomColor({ + luminosity: 'dark', + format: 'rgba', + alpha: 0.5 // e.g. 'rgba(9, 1, 107, 0.5)', +}); + +// Support for setting hue from a hex color +randomColor({ + hue: "#00FFFF" +}); From a051a8341db5f319eb3d4fb661a6dcd898859087 Mon Sep 17 00:00:00 2001 From: Hamed Baatour Date: Tue, 1 Jan 2019 15:41:27 +0300 Subject: [PATCH 042/646] types(showdown): add missing showdown types for v1.9.0 --- types/showdown/index.d.ts | 70 ++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 8 deletions(-) diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index 21075fd6c7..df2f17ab52 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Showdown 1.9.0 -// Project: https://github.com/coreyti/showdown -// Definitions by: cbowdon , Pei-Tang Huang , Ariel-Saldana +// Project: https://github.com/showdownjs/showdown +// Definitions by: Hamed Baatour, cbowdon , Pei-Tang Huang , Ariel-Saldana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = Showdown; @@ -64,6 +64,10 @@ declare namespace Showdown { output: ShowdownExtension[]; } + interface Metadata { + [meta: string]: string; + } + interface ShowdownOptions { /** * Omit the trailing newline in a code block. Ex: @@ -279,6 +283,43 @@ declare namespace Showdown { * @default false */ backslashEscapesHTMLTags?: boolean; + + /** + * Enable emoji support. Ex: `this is a :smile: emoji. + * + * @default false + */ + emoji?: boolean; + + /** + * Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, + * underscores no longer parses into `` and `` + * + * @default false + */ + underline?: boolean; + + /** + * Outputs a complete html document, including ``, `` and `` tags + * + * @default false + */ + completeHTMLDocument?: boolean; + + /** + * Outputs a complete html document, including ``, `` and `` tags + * + * @default false + */ + metadata?: boolean; + + /** + * Split adjacent blockquote blocks + * + * @default false + */ + splitAdjacentBlockquotes?: boolean; + } @@ -296,11 +337,11 @@ declare namespace Showdown { /** * Converts an HTML string into a markdown string - * - * @param src The input text (HTML) - * @returns The output markdown + * @param src + * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used. + * @returns {string} */ - makeMarkdown(src: string): string; + makeMarkdown(src: string, HTMLParser?: any): string; /** * Setting a "local" option only affects the specified Converter object. @@ -360,7 +401,20 @@ declare namespace Showdown { * * @param flavor name */ - setFlavor(name: string): void; + setFlavor(name: 'github' | 'original' | 'ghost' | 'vanilla' | 'allOn'): void; + + /** + * Get the metadata of the previously parsed document + * @param raw + * @returns {string|{}} + */ + getMetadata(raw?: boolean): string | Metadata + + /** + * Get the metadata format of the previously parsed document + * @returns {string} + */ + getMetadataFormat(): string; } @@ -477,5 +531,5 @@ declare namespace Showdown { * * @param name */ - function setFlavor(name: string): void; + function setFlavor(name: 'github' | 'original' | 'ghost' | 'vanilla' | 'allOn'): void; } From 36fa54b6d15414e50c362bee7e1c07dfa98f5253 Mon Sep 17 00:00:00 2001 From: Hamed Baatour Date: Tue, 1 Jan 2019 16:31:52 +0300 Subject: [PATCH 043/646] types(showdown): fix header authors format --- types/showdown/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index df2f17ab52..c0f3134f77 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -1,6 +1,9 @@ -// Type definitions for Showdown 1.9.0 +// Type definitions for Showdown 1.9. // Project: https://github.com/showdownjs/showdown -// Definitions by: Hamed Baatour, cbowdon , Pei-Tang Huang , Ariel-Saldana +// Definitions by: Hamed Baatour , +// cbowdon , +// Pei-Tang Huang , +// Ariel-Saldana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = Showdown; From a270ca9e8570b70a8a0f083071600e46c573730f Mon Sep 17 00:00:00 2001 From: Hamed Baatour Date: Tue, 1 Jan 2019 16:49:42 +0300 Subject: [PATCH 044/646] types(showdown): fix missing version patch number --- types/showdown/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index c0f3134f77..c058591d91 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Showdown 1.9. +// Type definitions for Showdown 1.9.0 // Project: https://github.com/showdownjs/showdown // Definitions by: Hamed Baatour , // cbowdon , From feac900bf5d10bfcbd916bacd84dab1b4e4fe13a Mon Sep 17 00:00:00 2001 From: bocai Date: Tue, 1 Jan 2019 23:26:42 +0800 Subject: [PATCH 045/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UpdateManager?= =?UTF-8?q?=E3=80=81onLaunch=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/weapp-api-tests.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 82a5b8d91d..e13f3766d5 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -347,6 +347,30 @@ wx.getSystemInfo({ } }) +const updateManager = wx.getUpdateManager() + +// updateManager.onCheckForUpdate(function (res) { +// //请求完新版本信息的回调 +// console.log(res.hasUpdate) +// }) + +updateManager.onUpdateReady(function () { + // wx.showModal({ + // title: '更新提示', + // content: '新版本已经准备好,是否重启应用?', + // success(res) { + // if (res.confirm) { + // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + // updateManager.applyUpdate() + // } + // } + // }) +}) + +updateManager.onUpdateFailed(function () { + // 新版本下载失败 +}) + wx.onAccelerometerChange(function(res) { console.log(res.x) console.log(res.y) @@ -673,3 +697,9 @@ wx.requestPayment({ 'fail':function(res){ } }) + +App({ + onLaunch(options){ + console.log(options.query) + } +}) From 184abf8051f2583ccf68e00abb96af82e3356ba0 Mon Sep 17 00:00:00 2001 From: bocai Date: Tue, 1 Jan 2019 23:28:51 +0800 Subject: [PATCH 046/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UpdateManager?= =?UTF-8?q?=E3=80=81onLaunch=E7=9B=B8=E5=85=B3=E5=A3=B0=E6=98=8E=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E4=BD=BF=E7=94=A8type=20aliases/interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 51 +++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index f22ed51765..c3b85a658a 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -37,12 +37,33 @@ declare namespace wx { [key: string]: any; } + interface referrerInfo { + /** 来源小程序、公众号或 App 的 appId */ + appId: string, + /** 来源小程序传过来的数据,scene=1037或1038时支持 */ + extraData: Object + } + + interface LaunchOptions { + /** 启动小程序的路径 */ + path: string, + /** 启动小程序的场景值 */ + scene: number, + /** 启动小程序的query参数 */ + query: Object, + shareTicket: string, + /** 来源信息。从另一个小程序、公众号或App进入小程序时返回。范泽返回{} */ + referrerInfo: referrerInfo + } + + type LaunchCallback = (options: LaunchOptions) => void; + interface AppOptions { /** * 生命周期函数--监听小程序初始化 * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) */ - onLaunch?: NoneParamCallback; + onLaunch?: LaunchCallback; /** * 生命周期函数--监听小程序显示 * 当小程序启动,或从后台进入前台显示,会触发 onShow @@ -561,6 +582,34 @@ declare namespace wx { */ function getSystemInfo(options: GetSystemInfoOptions): void; + interface UpdateManager { + /** + * 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 onUpdateReady 回调)调用。 + */ + applyUpdate(callback: DataResponseCallback): void; + /** + * 监听向微信后台请求检查更新结果事件。微信在小程序冷启动时自动检查更新,不需由开发者主动触发。 + */ + onCheckForUpdate(): void; + /** + * 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调 + */ + onUpdateReady(callback: NoneParamCallback): void; + /** + * 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调 + */ + onUpdateFailed(callback: NoneParamCallback): void; + } + /** + * 获取全局唯一的版本更新管理器,用于管理小程序更新。关于小程序的更新机制,可以查看运行机制文档。 + */ + function getUpdateManager(): UpdateManager; + + /** + * 获取小程序启动时的参数。与 App.onLaunch 的回调参数一致。 + */ + function getLaunchOptionsSync(): LaunchCallback; + interface AccelerometerData { /** X 轴 */ x: number; From 0330b0179cf5676f90a3bf9c3be71998541cfc08 Mon Sep 17 00:00:00 2001 From: bocai Date: Wed, 2 Jan 2019 01:40:37 +0800 Subject: [PATCH 047/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=BA=A7=E4=BA=8B=E4=BB=B6=E3=80=81=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E3=80=81=E8=B7=AF=E7=94=B1=E3=80=81=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 131 +++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 5 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index c3b85a658a..0e06bd8357 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: vargeek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import functions from "../react-icons/md/functions"; + declare namespace wx { type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; @@ -44,7 +46,7 @@ declare namespace wx { extraData: Object } - interface LaunchOptions { + interface onLaunchOptions { /** 启动小程序的路径 */ path: string, /** 启动小程序的场景值 */ @@ -56,24 +58,34 @@ declare namespace wx { referrerInfo: referrerInfo } - type LaunchCallback = (options: LaunchOptions) => void; + type onLaunchCallback = (options: onLaunchOptions) => void; + type onShowOptions = onLaunchOptions; interface AppOptions { /** * 生命周期函数--监听小程序初始化 * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) */ - onLaunch?: LaunchCallback; + onLaunch?: onLaunchCallback; /** * 生命周期函数--监听小程序显示 * 当小程序启动,或从后台进入前台显示,会触发 onShow */ - onShow?: NoneParamCallback; + onShow?: (options: onShowOptions) => void; /** * 生命周期函数--监听小程序隐藏 * 当小程序从前台进入后台,会触发 onHide */ onHide?: NoneParamCallback; + /** 小程序发生脚本错误或 API 调用报错时触发。也可以使用 wx.onError 绑定监听。*/ + onError?: ErrorCallback; + /** + * 小程序要打开的页面不存在时触发 + * 1. 开发者可以在回调中进行页面重定向,但必须在回调中同步处理,异步处理(例如 setTimeout 异步执行)无效。 + * 2. 若开发者没有调用 wx.onPageNotFound 绑定监听,也没有声明 App.onPageNotFound,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。 + * 3. 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。 + */ + onPageNotFound?: NoneParamCallback; [key: string]: any } @@ -608,7 +620,87 @@ declare namespace wx { /** * 获取小程序启动时的参数。与 App.onLaunch 的回调参数一致。 */ - function getLaunchOptionsSync(): LaunchCallback; + function getLaunchOptionsSync(): onLaunchCallback; + + // 应用级事件 + /** + * 取消监听小程序要打开的页面不存在事件 + */ + function offPageNotFound(): NoneParamCallback; + /** + * 监听小程序要打开的页面不存在事件。该事件与 App.onPageNotFound 的回调时机一致。 + */ + function onPageNotFound(): NoneParamCallback; + /** + * 取消监听小程序错误事件。 + */ + function offError(): NoneParamCallback; + /** + * 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 App.onError 的回调时机与参数一致。 + */ + function onError(): ErrorCallback; + /** + * 取消监听小程序切前台事件 + */ + function offAppShow(): NoneParamCallback; + /** + * 监听小程序切前台事件。该事件与 App.onShow 的回调参数一致。 + * @param callback + */ + function onAppShow(callback: onShowOptions): void; + /** + * 取消监听小程序切后台事件 + */ + function offAppHide(): NoneParamCallback; + /** + * 监听小程序切后台事件。该事件与 App.onHide 的回调时机一致。 + */ + function onAppHide(): NoneParamCallback; + + // 调试 TODO + + // 路由 + interface routerOptions { + + } + /** + * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。 + */ + function navigateBack(): void; + function switchTab(): void; + function navigateTo(): void; + function reLaunch(): void; + function redirectTo(): void; + + // 界面 + // 交互 + // tapIndex为用户点击的按钮序号,从上到下的顺序,从0开始 + type ActionSheetSuccessCallback = (res: {tapIndex: number}) => void; + + interface ActionSheetOptions { + // 必填,按钮的文字数组,数组长度最大为 6 + itemList: Array; + // 按钮的文字颜色 + itemColor?: string; + success?: ActionSheetSuccessCallback; + fail?: ResponseCallback; + complete?: ResponseCallback; + } + /** + * 显示操作菜单 + */ + function showActionSheet(options: ActionSheetOptions): void; + function hideLoading(): void; + function showLoading(): void; + function hideToast(): void; + function showToast(): void; + function showModal(): void; + + // 导航栏 + function setNavigationBarColor(): void; + function hideNavigationBarLoading(): void; + function showNavigationBarLoading(): void; + function setNavigationBarTitle(): void; interface AccelerometerData { /** X 轴 */ @@ -1182,3 +1274,32 @@ declare var App: AppConstructor; * 我们提供了全局的 getApp() 函数,可以获取到小程序实例。 */ declare function getApp(): App; + +// 定时器 +/** + * 设定一个定时器。在定时到期以后执行注册的回调函数 + * @param callback + * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 + * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 + */ +declare function setTimeout(callback: functions, delay: number, rest: any): number; + +/** + * 取消由 setTimeout 设置的定时器。 + * @param timeoutID 要取消的定时器的ID + */ +declare function clearTimeout(timeoutID: number): number; + +/** + * 设定一个定时器。按照指定的周期(以毫秒计)来执行注册的回调函数 + * @param callback + * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 + * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 + */ +declare function setInterval(callback: functions, delay: number, rest: any): number; + +/** + * 取消由 setInterval 设置的定时器。 + * @param timeoutID 要取消的定时器的ID + */ +declare function clearInterval(timeoutID: number): number; From 80d3201a48fb41e96ecbd58246815132de68d2de Mon Sep 17 00:00:00 2001 From: Slobodan Kletnikov Date: Wed, 2 Jan 2019 00:00:10 +0100 Subject: [PATCH 048/646] Add UncontrolledCarousel type --- types/reactstrap/index.d.ts | 7 +++++-- types/reactstrap/lib/Carousel.d.ts | 20 ++++++++++++++++++++ types/reactstrap/lib/Uncontrolled.d.ts | 3 +++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/types/reactstrap/index.d.ts b/types/reactstrap/index.d.ts index 8197cf5bb1..d2779b4ab6 100644 --- a/types/reactstrap/index.d.ts +++ b/types/reactstrap/index.d.ts @@ -241,17 +241,20 @@ import { UncontrolledButtonDropdown as UncontrolledButtonDropdown_, UncontrolledDropdown as UncontrolledDropdown_, UncontrolledTooltip as UncontrolledTooltip_, - UncontrolledCollapse as UncontrolledCollapse_ + UncontrolledCollapse as UncontrolledCollapse_, + UncontrolledCarousel as UncontrolledCarousel_ } from './lib/Uncontrolled'; export class UncontrolledAlert extends UncontrolledAlert_ {} export class UncontrolledButtonDropdown extends UncontrolledButtonDropdown_ {} export class UncontrolledDropdown extends UncontrolledDropdown_ {} export class UncontrolledTooltip extends UncontrolledTooltip_ {} export class UncontrolledCollapse extends UncontrolledCollapse_ {} +export class UncontrolledCarousel extends UncontrolledCarousel_ {} export { UncontrolledButtonDropdownProps, UncontrolledAlertProps, UncontrolledDropdownProps, UncontrolledTooltipProps, - UncontrolledCollapseProps + UncontrolledCollapseProps, + UncontrolledCarouselProps } from './lib/Uncontrolled'; diff --git a/types/reactstrap/lib/Carousel.d.ts b/types/reactstrap/lib/Carousel.d.ts index 0f59105f77..69899eff34 100644 --- a/types/reactstrap/lib/Carousel.d.ts +++ b/types/reactstrap/lib/Carousel.d.ts @@ -15,5 +15,25 @@ export type CarouselProps = React.HTMLProps & { cssModule?: CSSModule } & T; +export type UncontrolledProps = React.HTMLProps & { + items: any[]; + activeIndex?: number; + next?: () => void; + previous?: () => void; + keyboard?: boolean; + pause?: "hover" | false; + ride?: "carousel"; + interval?: number | string | boolean; + mouseEnter?: () => void; + mouseExit?: () => void; + slide?: boolean; + cssModule?: CSSModule; + controls?: boolean; + indicators?: boolean; + autoPlay?: boolean; +} & T; + +export type UncontrolledCarouselProps = UncontrolledProps; + declare class Carousel extends React.Component> {} export default Carousel; diff --git a/types/reactstrap/lib/Uncontrolled.d.ts b/types/reactstrap/lib/Uncontrolled.d.ts index 118b76d0d1..3be770852f 100644 --- a/types/reactstrap/lib/Uncontrolled.d.ts +++ b/types/reactstrap/lib/Uncontrolled.d.ts @@ -5,15 +5,18 @@ import { UncontrolledButtonDropdownProps } from './ButtonDropdown'; import { UncontrolledDropdownProps } from './Dropdown'; import { UncontrolledTooltipProps } from './Tooltip'; import { UncontrolledCollapseProps } from './Collapse'; +import { UncontrolledCarouselProps } from "./Carousel"; export class UncontrolledAlert extends React.Component> {} export class UncontrolledButtonDropdown extends React.Component> {} export class UncontrolledDropdown extends React.Component> {} export class UncontrolledTooltip extends React.Component> {} export class UncontrolledCollapse extends React.Component> {} +export class UncontrolledCarousel extends React.Component> {} export { UncontrolledAlertProps } from './Alert'; export { UncontrolledButtonDropdownProps } from './ButtonDropdown'; export { UncontrolledDropdownProps } from './Dropdown'; export { UncontrolledTooltipProps } from './Tooltip'; export { UncontrolledCollapseProps } from './Collapse'; +export { UncontrolledCarouselProps } from "./Carousel"; From b9256feb46be0b27b5a304690a8db0d37d6bcb2d Mon Sep 17 00:00:00 2001 From: Slobodan Kletnikov Date: Wed, 2 Jan 2019 00:16:18 +0100 Subject: [PATCH 049/646] Add UncontrolledCarousel test --- types/reactstrap/reactstrap-tests.tsx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index 427c5ae19e..4c6d1a98db 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -75,6 +75,7 @@ import { UncontrolledDropdown, UncontrolledTooltip, UncontrolledCollapse, + UncontrolledCarousel, TabContent, Table, Tag, @@ -4297,3 +4298,28 @@ function Example123() {
); } + +function Example124() { + // https://reactstrap.github.io/components/carousel/ + const items = [ + { + src: 'data:image/svg+xml...', + altText: 'Slide 1', + caption: 'Slide 1' + }, + { + src: 'data:image/svg+xml...', + altText: 'Slide 2', + caption: 'Slide 2' + }, + { + src: 'data:image/svg+xml...', + altText: 'Slide 3', + caption: 'Slide 3' + } + ]; + + return ( + + ); +} From b94e246170fbd182788f258a590beb445320bc91 Mon Sep 17 00:00:00 2001 From: Henri Lahtinen Date: Wed, 2 Jan 2019 13:08:42 +0200 Subject: [PATCH 050/646] [react-native] Action types for Android date and time pickers --- types/react-native/index.d.ts | 42 ++++++++++++++++++++++--------- types/react-native/test/index.tsx | 19 +++++++++++++- 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 865a46eefa..eecd4cd148 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7226,13 +7226,19 @@ export interface DatePickerAndroidOpenOptions { } // Deduced from DatePickerAndroid.android.js -export interface DatePickerAndroidOpenReturn { - action: string; // "dateSetAction" | "dismissedAction" - year?: number; - month?: number; - day?: number; +export interface DatePickerAndroidDateSetAction { + action: 'dateSetAction'; + year: number; + month: number; + day: number; } +export interface DatePickerAndroidDismissedAction { + action: 'dismissedAction'; +} + +export type DatePickerAndroidOpenReturn = DatePickerAndroidDateSetAction | DatePickerAndroidDismissedAction + export interface DatePickerAndroidStatic { /** * Opens the standard Android date picker dialog. @@ -7257,12 +7263,12 @@ export interface DatePickerAndroidStatic { /** * A date has been selected. */ - dateSetAction: string; + dateSetAction: 'dateSetAction'; /** * The dialog has been dismissed. */ - dismissedAction: string; + dismissedAction: 'dismissedAction'; } export interface IntentAndroidStatic { @@ -8002,12 +8008,24 @@ export class StatusBar extends React.Component { */ export interface StatusBarIOSStatic extends NativeEventEmitter {} -type TimePickerAndroidOpenOptions = { +export interface TimePickerAndroidOpenOptions { hour?: number; minute?: number; is24Hour?: boolean; mode?: "clock" | "spinner" | "default"; -}; +} + +export interface TimePickerAndroidTimeSetAction { + action: 'timeSetAction'; + hour: number; + minute: number; +} + +export interface TimePickerAndroidDismissedAction { + action: 'dismissedAction'; +} + +export type TimePickerAndroidOpenReturn = TimePickerAndroidTimeSetAction | TimePickerAndroidDismissedAction; /** * Opens the standard Android time picker dialog. @@ -8049,17 +8067,17 @@ export interface TimePickerAndroidStatic { * still be resolved with action being `TimePickerAndroid.dismissedAction` and all the other keys * being undefined. **Always** check whether the `action` before reading the values. */ - open(options: TimePickerAndroidOpenOptions): Promise<{ action: string; hour: number; minute: number }>; + open(options: TimePickerAndroidOpenOptions): Promise; /** * A time has been selected. */ - timeSetAction: string; + timeSetAction: 'timeSetAction'; /** * The dialog has been dismissed. */ - dismissedAction: string; + dismissedAction: 'dismissedAction'; } /** diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 842882cc29..4186b082fb 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -78,6 +78,7 @@ import { KeyboardAvoidingView, Modal, TimePickerAndroid, + DatePickerAndroid, ViewPropTypes, requireNativeComponent, } from "react-native"; @@ -762,13 +763,29 @@ const AlertIOSTest = () => { const ModalTest = () => ; -const TimePickerAndroidTest = () => +const TimePickerAndroidTest = () => { TimePickerAndroid.open({ hour: 8, minute: 15, is24Hour: true, mode: "spinner", + }).then(result => { + if (result.action === TimePickerAndroid.timeSetAction) { + console.log('Time', result.hour, result.minute) + } }); +} + +const DatePickerAndroidTest = () => { + DatePickerAndroid.open({ + date: new Date(), + mode: 'calendar' + }).then(result => { + if (result.action === DatePickerAndroid.dateSetAction) { + console.log('Date', result.year, result.month, result.day) + } + }); +} class BridgedComponentTest extends React.Component { static propTypes = { From fda4a8bab76702763a01347d450ff566bebf44d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Wed, 2 Jan 2019 21:45:48 +0800 Subject: [PATCH 051/646] modify --- types/weapp-api/index.d.ts | 67 +++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0e06bd8357..fa328782ca 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -686,15 +686,72 @@ declare namespace wx { fail?: ResponseCallback; complete?: ResponseCallback; } + + interface CommonCallbackOptions { + success?: ResponseCallback; + fail?: ResponseCallback; + complete?: ResponseCallback; + } + + interface LoadingOptions extends CommonCallbackOptions{ + // must,提示的内容 + title: string; + // 默认false。是否显示透明蒙层,防止触摸穿透 + mask: boolean; + } + + type icon = 'success' | 'loading' | 'none'; + interface ToastOptions extends CommonCallbackOptions{ + // 提示的内容 + title: string; + // 图标,默认值'success' + icon?: icon; + // 自定义图标的本地路径,image 的优先级高于 icon + imgage?: string; + // 提示的延迟时间,默认值1500ms + duration?: number; + // 是否显示透明蒙层,防止触摸穿透,默认值false + mask: boolean; + } + + interface ModalOptions extends CommonCallbackOptions{ + // 提示的内容 + title: string; + // 提示的内容 + content: string; + // 是否显示取消按钮,默认值true + showCancel?: boolean; + // 取消按钮的文字,最多 4 个字符,默认值'取消' + cancelText?: string; + // 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串,默认值'#000000' + cancelColor?: string; + // 确认按钮的文字,最多 4 个字符 + confirmText?: string; + // 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串,默认值'#3cc51f' + confirmColor?: boolean; + } /** * 显示操作菜单 */ function showActionSheet(options: ActionSheetOptions): void; - function hideLoading(): void; - function showLoading(): void; - function hideToast(): void; - function showToast(): void; - function showModal(): void; + /** + * 隐藏 loading 提示框 + * @param options + */ + function hideLoading(options?: CommonCallbackOptions): void; + /** + * 显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框 + * @param options + */ + function showLoading(options: LoadingOptions): void; + function hideToast(options?: CommonCallbackOptions): void; + function showToast(options: ToastOptions): void; + + /** + * 显示模态对话框 + * @param options + */ + function showModal(options: ModalOptions): void; // 导航栏 function setNavigationBarColor(): void; From b058eee449120414cfc85cba5bbef9a5c0fe0397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 3 Jan 2019 11:43:26 +0200 Subject: [PATCH 052/646] fix(operations): review props and options --- types/stellar-sdk/index.d.ts | 139 +++++++++++++++-------------------- 1 file changed, 61 insertions(+), 78 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 89f534c629..9b2afa301e 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for stellar-sdk 0.10 +// Type definitions for stellar-sdk 0.11 // Project: https://github.com/stellar/js-stellar-sdk // Definitions by: Carl Foster // Triston Jones @@ -154,98 +154,89 @@ export namespace StellarBase { } namespace Operation { - interface Operation { - type: OperationType; - source: string | null; - } - interface AccountMerge extends Operation { - type: OperationType.accountMerge; - destination: string; - } - interface AccountMergeOptions { - destination: string; + interface Operation { + type: T; source?: string; } + interface OperationOptions { + source?: string; + } + + interface AccountMerge extends Operation { + destination: string; + } + interface AccountMergeOptions extends OperationOptions { + destination: string; + } function accountMerge(options: AccountMergeOptions): xdr.Operation; - interface AllowTrust extends Operation { - type: OperationType.allowTrust; + interface AllowTrust extends Operation { trustor: string; assetCode: string; - authorize: boolean; + authorize: boolean | undefined; } - interface AllowTrustOptions { + interface AllowTrustOptions extends OperationOptions { trustor: string; assetCode: string; - authorize: boolean; - source?: string; + authorize?: boolean; } function allowTrust(options: AllowTrustOptions): xdr.Operation; - interface ChangeTrust extends Operation { - type: OperationType.changeTrust; + interface ChangeTrust extends Operation { line: Asset; - limit: string | number; + limit: string; } - interface ChangeTrustOptions { + interface ChangeTrustOptions extends OperationOptions { asset: Asset; limit?: string; - source?: string; } function changeTrust(options: ChangeTrustOptions): xdr.Operation; - interface CreateAccount extends Operation { - type: OperationType.createAccount; - source: string; + interface CreateAccount extends Operation { destination: string; - startingBalance: string | number; + startingBalance: string; } - interface CreateAccountOptions { + interface CreateAccountOptions extends OperationOptions { destination: string; startingBalance: string; - source?: string; } function createAccount(options: CreateAccountOptions): xdr.Operation; - interface CreatePassiveOffer extends Operation { - type: OperationType.createPassiveOffer; - selling: Asset; - buying: Asset; - amount: string | number; - price: string | number; - } - interface CreatePassiveOfferOptions { + interface CreatePassiveOffer extends Operation { selling: Asset; buying: Asset; amount: string; - price: number | string | object; - source?: string; + price: string; + } + interface CreatePassiveOfferOptions extends OperationOptions { + selling: Asset; + buying: Asset; + amount: string; + price: number | string | object /* bignumber.js */; } function createPassiveOffer(options: CreatePassiveOfferOptions): xdr.Operation; - interface Inflation extends Operation { - type: OperationType.inflation; + interface Inflation extends Operation { } - function inflation(options: { source?: string }): xdr.Operation; + interface InflationOptions extends OperationOptions { // tslint:disable-line + } + function inflation(options: InflationOptions): xdr.Operation; - interface ManageData extends Operation { - type: OperationType.manageData; + interface ManageData extends Operation { name: string; value: Buffer; } - interface ManageDataOptions { + interface ManageDataOptions extends OperationOptions { name: string; value: string | Buffer; - source?: string; } function manageData(options: ManageDataOptions): xdr.Operation; - interface ManageOffer extends Operation { - type: OperationType.manageOffer; + interface ManageOffer extends Operation { selling: Asset; buying: Asset; - amount: string | number; - price: string | number; + amount: string; + price: string; offerId: string; } interface ManageOfferOptions extends CreatePassiveOfferOptions { @@ -253,37 +244,33 @@ export namespace StellarBase { } function manageOffer(options: ManageOfferOptions): xdr.Operation; - interface PathPayment extends Operation { - type: OperationType.pathPayment; - sendAsset: Asset; - sendMax: string | number; - destination: string; - destAsset: Asset; - destAmount: string | number; - path: Asset[]; - } - interface PathPaymentOptions { + interface PathPayment extends Operation { sendAsset: Asset; sendMax: string; destination: string; destAsset: Asset; destAmount: string; path: Asset[]; - source?: string; + } + interface PathPaymentOptions extends OperationOptions { + sendAsset: Asset; + sendMax: string; + destination: string; + destAsset: Asset; + destAmount: string; + path?: Asset[]; } function pathPayment(options: PathPaymentOptions): xdr.Operation; - interface Payment extends Operation { - type: OperationType.payment; - destination: string; - asset: Asset; - amount: string | number; - } - interface PaymentOptions { - destination: string; - asset: Asset; + interface Payment extends Operation { amount: string; - source?: string; + asset: Asset; + destination: string; + } + interface PaymentOptions extends OperationOptions { + amount: string; + asset: Asset; + destination: string; } function payment(options: PaymentOptions): xdr.Operation; @@ -303,8 +290,7 @@ export namespace StellarBase { preAuthTx?: Buffer | string; weight?: number | string; } - interface SetOptions extends Operation { - type: OperationType.setOptions; + interface SetOptions extends Operation { inflationDest?: string; clearFlags?: AuthFlags; setFlags?: AuthFlags; @@ -315,7 +301,7 @@ export namespace StellarBase { homeDomain?: string; signer?: Signer; } - interface SetOptionsOptions { + interface SetOptionsOptions extends OperationOptions { inflationDest?: string; clearFlags?: AuthFlags; setFlags?: AuthFlags; @@ -325,17 +311,14 @@ export namespace StellarBase { highThreshold?: number | string; signer?: Signer; homeDomain?: string; - source?: string; } function setOptions(options: SetOptionsOptions): xdr.Operation; - interface BumpSequence extends Operation { - type: OperationType.bumpSequence; + interface BumpSequence extends Operation { bumpTo: string; } - interface BumpSequenceOptions { + interface BumpSequenceOptions extends OperationOptions { bumpTo: string; - source?: string; } function bumpSequence(options: BumpSequenceOptions): xdr.Operation; From f17d1c8ea67cbd8c30345d4a680af33103b9d41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 3 Jan 2019 12:00:57 +0200 Subject: [PATCH 053/646] feat(op): setOptions signer conditional type --- types/stellar-sdk/index.d.ts | 61 ++++++++++++++++++-------- types/stellar-sdk/stellar-sdk-tests.ts | 12 +++++ 2 files changed, 55 insertions(+), 18 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 9b2afa301e..9b7307d9c3 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -284,13 +284,49 @@ export namespace StellarBase { Revocable = 2, Immutable = 4, } - interface Signer { - ed25519PublicKey?: string; - sha256Hash?: Buffer | string; - preAuthTx?: Buffer | string; + interface SignerEd25519PublicKey { + ed25519PublicKey: string; + weight: number | undefined; + } + interface SignerSha256Hash { + sha256Hash: Buffer; + weight: number | undefined; + } + interface SignerPreAuthTx { + preAuthTx: Buffer; + weight: number | undefined; + } + type Signer = SignerEd25519PublicKey | SignerSha256Hash | SignerPreAuthTx; + interface SignerEd25519PublicKeyOptions { + ed25519PublicKey: string; weight?: number | string; } - interface SetOptions extends Operation { + interface SignerSha256HashOptions { + sha256Hash: Buffer | string; + weight?: number | string; + } + interface SignerPreAuthTxOptions { + preAuthTx: Buffer | string; + weight?: number | string; + } + type SignerOptions = SignerEd25519PublicKeyOptions | SignerSha256HashOptions | SignerPreAuthTxOptions; + type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; + interface SetOptions extends Operation { + inflationDest?: string; + clearFlags?: AuthFlags; + setFlags?: AuthFlags; + masterWeight?: number; + lowThreshold?: number; + medThreshold?: number; + highThreshold?: number; + homeDomain?: string; + signer: + T extends {ed25519PublicKey: any} ? SignerEd25519PublicKey : + T extends {sha256Hash: any} ? SignerSha256Hash : + T extends {preAuthTx: any} ? SignerPreAuthTx : + never; + } + interface SetOptionsOptions extends OperationOptions { inflationDest?: string; clearFlags?: AuthFlags; setFlags?: AuthFlags; @@ -299,20 +335,9 @@ export namespace StellarBase { medThreshold?: number | string; highThreshold?: number | string; homeDomain?: string; - signer?: Signer; + signer?: T; } - interface SetOptionsOptions extends OperationOptions { - inflationDest?: string; - clearFlags?: AuthFlags; - setFlags?: AuthFlags; - masterWeight?: number | string; - lowThreshold?: number | string; - medThreshold?: number | string; - highThreshold?: number | string; - signer?: Signer; - homeDomain?: string; - } - function setOptions(options: SetOptionsOptions): xdr.Operation; + function setOptions(options: SetOptionsOptions): xdr.Operation>; interface BumpSequence extends Operation { bumpTo: string; diff --git a/types/stellar-sdk/stellar-sdk-tests.ts b/types/stellar-sdk/stellar-sdk-tests.ts index bf991b4591..c4dcbda7c8 100644 --- a/types/stellar-sdk/stellar-sdk-tests.ts +++ b/types/stellar-sdk/stellar-sdk-tests.ts @@ -30,3 +30,15 @@ StellarSdk.Memo.hash('asdf').value; // $ExpectType Buffer // P.S. don't use Memo constructor (new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).value; // $ExpectType AnyValue (new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).type; // $ExpectType AnyType + +const noSignerXDR = StellarSdk.Operation.setOptions({lowThreshold: 1}); +StellarSdk.Operation.fromXDRObject(noSignerXDR).signer; // $ExpectType never + +const newSignerXDR1 = StellarSdk.Operation.setOptions({signer: {ed25519PublicKey: sourceKey.publicKey(), weight: '1'}}); +StellarSdk.Operation.fromXDRObject(newSignerXDR1).signer; // $ExpectType SignerEd25519PublicKey + +const newSignerXDR2 = StellarSdk.Operation.setOptions({signer: {sha256Hash: Buffer.from(''), weight: '1'}}); +StellarSdk.Operation.fromXDRObject(newSignerXDR2).signer; // $ExpectType SignerSha256Hash + +const newSignerXDR3 = StellarSdk.Operation.setOptions({signer: {preAuthTx: '', weight: 1}}); +StellarSdk.Operation.fromXDRObject(newSignerXDR3).signer; // $ExpectType SignerPreAuthTx From 1f4c27d940d3396ba7120a666de0f33b8f33a545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 3 Jan 2019 12:26:18 +0200 Subject: [PATCH 054/646] fix: Server.ServerOptions -> Server.Options --- types/stellar-sdk/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 9b7307d9c3..82ee2f583e 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -481,7 +481,7 @@ export namespace Config { } export class Server { - constructor(serverURL: string, options?: Server.ServerOptions) + constructor(serverURL: string, options?: Server.Options) accounts(): Server.AccountCallBuilder; assets(): Server.AssetsCallBuilder; effects(): Server.EffectCallBuilder; @@ -975,7 +975,7 @@ export namespace Server { forTransaction(transactionId: string): this; } - interface ServerOptions { + interface Options { allowHttp: boolean; } From 85b12f89297674c6a1768959da6a97c3486c808d Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 3 Jan 2019 15:27:26 +0100 Subject: [PATCH 055/646] d3-geo : added geoEqualEarth and geoEqualEarthRaw Updated version number to 1.11.3 --- types/d3-geo/d3-geo-tests.ts | 2 ++ types/d3-geo/index.d.ts | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index 6e824e8e69..36c4debbe3 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -371,6 +371,7 @@ const gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw(); const mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw(); const orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw(); const stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw(); +const equalEarthRaw: d3Geo.GeoRawProjection = d3Geo.geoEqualEarthRaw(); const transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw(); const naturalEarth1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw(); @@ -398,6 +399,7 @@ const gnomonic: d3Geo.GeoProjection = d3Geo.geoGnomonic(); const mercator: d3Geo.GeoProjection = d3Geo.geoMercator(); const orthographic: d3Geo.GeoProjection = d3Geo.geoOrthographic(); const stereographic: d3Geo.GeoProjection = d3Geo.geoStereographic(); +const equalEarth: d3Geo.GeoProjection = d3Geo.geoEqualEarth(); const transverseMercator: d3Geo.GeoProjection = d3Geo.geoTransverseMercator(); const naturalEarth1: d3Geo.GeoProjection = d3Geo.geoNaturalEarth1(); diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 8f22503d71..16c51dfae6 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-geo module 1.10 +// Type definitions for D3JS d3-geo module 1.11 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.10.0 +// Last module patch version validated against: 1.11.3 import * as GeoJSON from 'geojson'; @@ -1345,11 +1345,22 @@ export function geoOrthographicRaw(): GeoRawProjection; * The stereographic projection. */ export function geoStereographic(): GeoProjection; + /** * The raw stereographic projection. */ export function geoStereographicRaw(): GeoRawProjection; +/** + * The Equal Eartch projection, by Bojan Šavrič et al., 2018. + */ +export function geoEqualEarth(): GeoProjection; + +/** + * The raw Equal Earth projection, by Bojan Šavrič et al., 2018. + */ +export function geoEqualEarthRaw(): GeoRawProjection; + // Composite Projections --------------------------------------------------- /** From 7fac46a11656933abba29e4b7e7e7f54648d1abf Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 3 Jan 2019 15:38:59 +0100 Subject: [PATCH 056/646] d3 : Updated global bundle version --- types/d3/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/d3/index.d.ts b/types/d3/index.d.ts index 43c264f280..9b62c1e025 100644 --- a/types/d3/index.d.ts +++ b/types/d3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3 standard bundle 5.5 +// Type definitions for D3JS d3 standard bundle 5.7 // Project: https://github.com/d3/d3 // Definitions by: Tom Wanzek // Alex Ford @@ -7,7 +7,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 5.5.0 +// Last module patch version validated against: 5.7.0 // NOTE TO MAINTAINERS: Review D3 v4.x module dependencies (see v4 sub-folder) and update its path-mappings in tsconfig (v4 folder), // if new MAJOR version of D3 v4 modules are released!!! From 557311808b61a27857db6aa9a77859f33ccda84b Mon Sep 17 00:00:00 2001 From: Eric Chmielewski Date: Thu, 3 Jan 2019 14:13:08 -0500 Subject: [PATCH 057/646] [react-bootstrap-table] Correct TableHeaderColumnProps.autovalue to be TableHeaderColumnProps.autoValue --- types/react-bootstrap-table/index.d.ts | 2 +- types/react-bootstrap-table/react-bootstrap-table-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-bootstrap-table/index.d.ts b/types/react-bootstrap-table/index.d.ts index 1284162778..226bdf1606 100644 --- a/types/react-bootstrap-table/index.d.ts +++ b/types/react-bootstrap-table/index.d.ts @@ -1291,7 +1291,7 @@ export interface TableHeaderColumnProps extends Props { * generated automatically after a row insertion. If a function given, you can customize the value by yourself and * remember to return the value for the cell from the function. */ - autovalue?: boolean | (() => any); + autoValue?: boolean | (() => any); /** * False to disable search functionality on column, default is true. */ diff --git a/types/react-bootstrap-table/react-bootstrap-table-tests.tsx b/types/react-bootstrap-table/react-bootstrap-table-tests.tsx index 39422f2152..e742e41145 100644 --- a/types/react-bootstrap-table/react-bootstrap-table-tests.tsx +++ b/types/react-bootstrap-table/react-bootstrap-table-tests.tsx @@ -1222,7 +1222,7 @@ class HideOnInsertTable extends React.Component { }; return ( - Job ID + Job ID Job Name Job Type Active From 356e96410ff00b1bd25f742c2e765bc8c02039dd Mon Sep 17 00:00:00 2001 From: ryuuji3 Date: Fri, 4 Jan 2019 03:48:05 +0000 Subject: [PATCH 058/646] validation schemas use Schema and SchemaMap instead of ValidationObject and AnySchema --- types/hapi/index.d.ts | 6 +++--- types/hapi/test/route/validation.ts | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 65ce60be85..10741806c3 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -29,7 +29,7 @@ import * as zlib from 'zlib'; import { MimosOptions } from 'mimos'; import { SealOptions, SealOptionsSub } from 'iron'; -import { AnySchema, ValidationOptions } from 'joi'; +import { AnySchema, ValidationOptions, SchemaMap, Schema } from 'joi'; import Podium = require('podium'); import { PolicyOptionVariants, EnginePrototypeOrObject, PolicyOptions, EnginePrototype, Policy } from 'catbox'; @@ -1442,8 +1442,8 @@ export interface ValidationObject { export type RouteOptionsResponseSchema = boolean - | ValidationObject - | AnySchema + | SchemaMap + | Schema | ((value: object | Buffer | string, options: ValidationOptions) => Promise); /** diff --git a/types/hapi/test/route/validation.ts b/types/hapi/test/route/validation.ts index 6cc4ed186d..2151371c5f 100644 --- a/types/hapi/test/route/validation.ts +++ b/types/hapi/test/route/validation.ts @@ -8,12 +8,27 @@ const options: ServerOptions = { const routeOptions: RouteOptions = { validate: { + payload: { + id: Joi.string().uuid().required(), + name: Joi.object({ + firstName: Joi.string().required(), + lastName: Joi.string().allow(null) + }), + firstName: Joi.ref("name.firstName") + }, params: { - name: Joi.string().min(3).max(10) + name: Joi.string().min(3).max(10), + nameRef: Joi.ref("name") } }, response: { - schema: Joi.string() + schema: Joi.object({ + a: Joi.string(), + b: Joi.object({ + c: Joi.number() + }), + d: Joi.ref("b.c") + }) } }; From 305086b93b204c1dd5d751ebfdd7162c74da0fad Mon Sep 17 00:00:00 2001 From: ryuuji3 Date: Fri, 4 Jan 2019 03:52:08 +0000 Subject: [PATCH 059/646] ValidationObject reference updated to SchemaMap in order to avoid making breaking changes --- types/hapi/index.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 10741806c3..dec96e0c6c 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -1436,13 +1436,11 @@ export interface RouteOptionsPreObject { failAction?: Lifecycle.FailAction; } -export interface ValidationObject { - [key: string]: AnySchema; -} +export type ValidationObject = SchemaMap; export type RouteOptionsResponseSchema = boolean - | SchemaMap + | ValidationObject | Schema | ((value: object | Buffer | string, options: ValidationOptions) => Promise); From 5c8bc25ecaf949bbcc9c4ea4d99cdfd2d8a25824 Mon Sep 17 00:00:00 2001 From: Philip Peitsch Date: Fri, 4 Jan 2019 15:36:30 +1100 Subject: [PATCH 060/646] Update cordova-plugin-ble-central to 1.2.2 (latest) Types were found via direct code inspection of plugin. --- .../cordova-plugin-ble-central-tests.ts | 16 ++-- types/cordova-plugin-ble-central/index.d.ts | 89 +++++++++++++------ 2 files changed, 72 insertions(+), 33 deletions(-) diff --git a/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts b/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts index 6e4317ac9d..41bcf59865 100644 --- a/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts +++ b/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts @@ -62,10 +62,10 @@ var demoExtendedData : BLECentralPlugin.PeripheralDataExtended = { //get updates about the bluethooth states ble.startStateNotifications((state) => log(`BLE state ${state}`)); -ble.isEnabled(()=> log(`bluetooth is enabled`), ()=>log(`bluetooth is not enabled`)); +ble.isEnabled(()=> log(`bluetooth is enabled`), err =>log(`bluetooth is not enabled: ${err}`)); //here we try to enable bluetooth -ble.enable(() => log(`yes it worked, or it was already enabled `), () => log(`nope it didn't work, the user pressed cancel, or we are in iOS`)); +ble.enable(() => log(`yes it worked, or it was already enabled `), err => log(`nope it didn't work, the user pressed cancel, or we are in iOS: ${err}`)); ble.showBluetoothSettings(() => log(`yes it worked`), () => log(`nope it didn't work`)) @@ -73,13 +73,14 @@ ble.showBluetoothSettings(() => log(`yes it worked`), () => log(`nope it didn't ble.stopStateNotifications() //scan 5 seconds -ble.scan([], 5000, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ); +ble.scan([], 5000, (data) => { devices.push(data); }, () => log(`couldn't connect`) ); +ble.scan([], 5000, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) ); //scan continously ble.startScan([], (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ) ////scan continously -ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ) +ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) ) //stop scanning ble.stopScan(()=> log('all good'), ()=> log('couldn\'t stop scanning')); @@ -89,18 +90,19 @@ ble.isConnected(demoDevice.id, () => log(`already connected to this device`), () //connect to a specific device var extendedData : BLECentralPlugin.PeripheralDataExtended; -ble.connect(demoDevice.id, (data)=> extendedData = data, () => log(`couldn't connect to the device`) ); +ble.connect(demoDevice.id, (data)=> extendedData = data, err => log(`couldn't connect to the device: ${err}`) ); //read some data from a characteristic var charsOfOneOfItsServices = demoExtendedData.characteristics.filter((value) => value.service == demoExtendedData.services[0]); ble.read(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data) => log(`we've received some data`), ()=> log(`couldn't read any data`)); //read the rssi -ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`)); +ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`), err => log(`Unable to read RSSI: ${err}`)); var notificationsReceived : number = 0; //get notified of changes for that characteristic -ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data)=> notificationsReceived++, ()=> log(`darn`)); +ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, + (data)=> notificationsReceived++, err => log(`darn: ${err}`)); //write some data ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`), ()=> log(`could't write`)); diff --git a/types/cordova-plugin-ble-central/index.d.ts b/types/cordova-plugin-ble-central/index.d.ts index ccf2396833..0beb5d25e5 100644 --- a/types/cordova-plugin-ble-central/index.d.ts +++ b/types/cordova-plugin-ble-central/index.d.ts @@ -1,12 +1,13 @@ -// Type definitions for cordova-plugin-ble-central 1.1.2 +// Type definitions for cordova-plugin-ble-central 1.2.2 // Project: https://github.com/don/cordova-plugin-ble-central // Definitions by: Gidon Junge +// Philip Peitsch // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace BLECentralPlugin { - interface PeripheralCharacteristic { + interface PeripheralCharacteristic { service: string; characteristic: string; properties: string[]; @@ -26,7 +27,12 @@ declare namespace BLECentralPlugin { characteristics: PeripheralCharacteristic[] } - + + interface BLEError { + name: string; + id: string; + errorMessage: string; + } interface StartScanOptions { @@ -35,74 +41,105 @@ declare namespace BLECentralPlugin { export interface BLECentralPluginStatic { scan(services: string[], seconds: number, success : (data: PeripheralData) => any): void; - scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure : () => any): void; - + scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure : (error: string) => any): void; + startScan(services: string[], success: (data: PeripheralData) => any): void; - startScan(services: string[], success: (data: PeripheralData) => any, failure: () => any): void; + startScan(services: string[], success: (data: PeripheralData) => any, failure: (error: string|BLEError) => any): void; startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any): void; - startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure: () => any): void; + startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure: (error: string) => any): void; stopScan(): void; stopScan(success: () => any): void; stopScan(success: () => any, failure: () => any): void; - - connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: () => any): void; + + connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void; + + /* Automatically connect to a device when it is in range of the phone + [iOS] background notifications on ios must be enabled if you want to run in the background + [Android] this relies on the autoConnect argument of BluetoothDevice.connectGatt(). Not all Android devices implement this feature correctly. */ + autoConnect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void; disconnect(device_id:string): void; disconnect(device_id:string, success: () => any): void; - disconnect(device_id:string, success: () => any, failure: () => any): void; + disconnect(device_id:string, success: () => any, failure: (error: string|BLEError) => any): void; read(device_id: string, service_uuid:string, characteristic_uuid:string): void; read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void; - read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void; + read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: (error: string|BLEError) => any): void; write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void; write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void; - write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void; + write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: (error: string|BLEError) => any): void; - /* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack. + /* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack. The success callback is be called when the characteristic is written.*/ writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void; writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void; - writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void; + writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: (error: string) => any): void; /* Register to be notified when the value of a characteristic changes. */ startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void; - startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void; - + startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: (error: string|BLEError) => any): void; + stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string): void; stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any): void; - stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any, failure: () => any): void; + stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any, failure: (error: string|BLEError) => any): void; /* Reports if bluetooth is enabled. */ - isEnabled(success: () => any , failure: () => any): void; + isEnabled(success: () => any , failure: (error: string) => any): void; /* Calls the success callback when the peripheral is connected and the failure callback when not connected. */ isConnected(device_id: string, success: () => any): void; - isConnected(device_id: string, success: () => any, failure: () => any): void; + isConnected(device_id: string, success: () => any, failure: (error: string) => any): void; + + /* May be used to request (on Android) a larger MTU size to be able to send more data at once + [iOS] requestMtu is not supported on iOS. */ + requestMtu(device_id: string, mtu: number): void; + requestMtu(device_id: string, mtu: number, success: () => any): void; + requestMtu(device_id: string, mtu: number, success: () => any, failure: () => any): void; + + /* Clears cached services and characteristics info for some poorly behaved devices. Uses an undocumented API, + so it is not guaranteed to work. + [iOS] refreshDeviceCache is not supported on iOS. */ + refreshDeviceCache(device_id: string, timeout_millis: number): void; + refreshDeviceCache(device_id: string, timeout_millis: number, success: (data: PeripheralDataExtended) => any): void; + refreshDeviceCache(device_id: string, timeout_millis: number, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void; startStateNotifications(success: (state: string) => any): void; - startStateNotifications(success: (state: string) => any, failure: () => any): void; + startStateNotifications(success: (state: string) => any, failure: (error: string) => any): void; stopStateNotifications(): void; stopStateNotifications(success: () => any): void; stopStateNotifications(success: () => any, failure: () => any): void; - + /* Opens the Bluetooth settings for the operating systems. [iOS] showBluetoothSettings is not supported on iOS. */ showBluetoothSettings(): void; showBluetoothSettings(success: () => any): void; showBluetoothSettings(success: () => any, failure: () => any): void; - + /* Enable Bluetooth on the device. [iOS] enable is not supported on iOS. */ - enable(success: () => any, failure: () => any): void; - + enable(success: () => any, failure: (error: string) => any): void; readRSSI(device_id:string, success: (rssi: number) => any): void; - readRSSI(device_id:string, success: (rssi: number) => any, failure: () => any): void; + readRSSI(device_id:string, success: (rssi: number) => any, failure: (error: string) => any): void; + + /* Find connected peripherals offering the listed service UUIDs. + This function wraps CBCentralManager.retrieveConnectedPeripheralsWithServices. + [Android] peripheralsWithIdentifiers is not supported on Android. */ + connectedPeripheralsWithServices(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void; + + /* Find known (but not necessarily connected) peripherals offering the listed service UUIDs. + This function wraps CBCentralManager.retrievePeripheralsWithIdentifiers + [Android] peripheralsWithIdentifiers is not supported on Android. */ + peripheralsWithIdentifiers(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void; + + /* Find the bonded devices. + [iOS] bondedDevices is not supported on iOS. */ + bondedDevices(success: (data: PeripheralData[]) => any, failure: () => any): void; } } -declare var ble: BLECentralPlugin.BLECentralPluginStatic; \ No newline at end of file +declare var ble: BLECentralPlugin.BLECentralPluginStatic; From 8c9df8396857ca51ce87103b61a73540aaef368c Mon Sep 17 00:00:00 2001 From: Dmitri Trofimov Date: Fri, 4 Jan 2019 09:23:57 +0200 Subject: [PATCH 061/646] added 'remove' method to async/AsyncQueue --- types/async/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/async/index.d.ts b/types/async/index.d.ts index e6cfd3bcaa..4f5125f225 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -31,6 +31,10 @@ export type AsyncAutoTask, E> = AsyncAutoTaskFunct export interface AsyncAutoTaskFunctionWithoutDependencies { (cb: AsyncResultCallback | ErrorCallback): void; } export interface AsyncAutoTaskFunction, E = Error> { (results: R, cb: AsyncResultCallback | ErrorCallback): void; } +export interface DataContainer { + data: T; +} + export interface AsyncQueue { length(): number; started: boolean; @@ -39,6 +43,7 @@ export interface AsyncQueue { concurrency: number; push(task: T | T[], callback?: AsyncResultCallback): void; unshift(task: T | T[], callback?: ErrorCallback): void; + remove(filter: (node: DataContainer) => boolean): void; saturated: () => any; empty: () => any; drain: () => any; From 4b9fdb35a1eec08d8de4cdf2ffd7b471854a6e3f Mon Sep 17 00:00:00 2001 From: Dmitri Trofimov Date: Fri, 4 Jan 2019 11:01:40 +0200 Subject: [PATCH 062/646] Test attempt #1 --- types/async/test/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 574a5ed8b9..a9272fa67a 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -355,6 +355,10 @@ q2.unshift(['task3', 'task4', 'task5'], function (error) { console.log('Finished tasks'); }); +let q2Length = q2.length(); +q2.push('testRemovalTask'); +q2.remove(x => x.data === 'testTaskRemoval'); +console.log('how can I fail the test?'); var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { console.log('hello ' + level); From 823fc6008f125c37c001544c56dffb83e141e092 Mon Sep 17 00:00:00 2001 From: Dmitri Trofimov Date: Fri, 4 Jan 2019 12:23:59 +0200 Subject: [PATCH 063/646] Test attempt #2 --- types/async/test/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/async/test/index.ts b/types/async/test/index.ts index a9272fa67a..5aff9bb1b4 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -358,7 +358,7 @@ q2.unshift(['task3', 'task4', 'task5'], function (error) { let q2Length = q2.length(); q2.push('testRemovalTask'); q2.remove(x => x.data === 'testTaskRemoval'); -console.log('how can I fail the test?'); +throw new Error('how can I fail the test?'); var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { console.log('hello ' + level); From eb98ab858fb7d4c1a3e5eacd99494afdefeda5cd Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:50:54 +0300 Subject: [PATCH 064/646] [react-loadable] export everything in webpack.d.ts --- types/react-loadable/webpack.d.ts | 37 ++++++++++++------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts index 59e046a975..c9a95ec2f9 100644 --- a/types/react-loadable/webpack.d.ts +++ b/types/react-loadable/webpack.d.ts @@ -1,31 +1,22 @@ -import webpack = require("webpack"); +import webpack = require('webpack'); -declare namespace LoadableExport { - interface Options { - filename: string; - } - - class ReactLoadablePlugin extends webpack.Plugin { - constructor(opts?: Options); - } - - interface Bundle { +export interface Bundle { id: number; name: string; file: string; publicPath: string; - } - - interface Manifest { - [moduleId: string]: Bundle[]; - } - - function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; } -declare const exports: { - getBundles: typeof LoadableExport.getBundles; - ReactLoadablePlugin: typeof LoadableExport.ReactLoadablePlugin; -}; +export interface Manifest { + [moduleId: string]: Bundle[]; +} -export = exports; +export interface ReactLoadablePluginOptions { + filename: string; +} + +export class ReactLoadablePlugin extends webpack.Plugin { + constructor(opts?: ReactLoadablePluginOptions); +} + +export function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; From 1d66dc3d9e0fd8622e796dd0f1f09407dac533a2 Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:51:49 +0300 Subject: [PATCH 065/646] [react-loadable] change type for id in Bundle interface --- types/react-loadable/test/webpack.ts | 2 +- types/react-loadable/webpack.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts index c6c95f8af0..4ce672e49f 100644 --- a/types/react-loadable/test/webpack.ts +++ b/types/react-loadable/test/webpack.ts @@ -13,7 +13,7 @@ const config: webpack.Configuration = { const manifest = { react: [ { - id: 0, + id: './node_modules/react/index.js', name: './node_modules/react/index.js', file: 'main.js', publicPath: 'http://127.0.0.1/main.js' diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts index c9a95ec2f9..9146cdabac 100644 --- a/types/react-loadable/webpack.d.ts +++ b/types/react-loadable/webpack.d.ts @@ -1,7 +1,7 @@ import webpack = require('webpack'); export interface Bundle { - id: number; + id: string; name: string; file: string; publicPath: string; From 0d43f21cce47d2988410130db09284704ed39bc9 Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:52:18 +0300 Subject: [PATCH 066/646] [react-loadable] change type for name in Bundle interface --- types/react-loadable/webpack.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts index 9146cdabac..35c8e44aad 100644 --- a/types/react-loadable/webpack.d.ts +++ b/types/react-loadable/webpack.d.ts @@ -2,7 +2,7 @@ import webpack = require('webpack'); export interface Bundle { id: string; - name: string; + name: string | null; file: string; publicPath: string; } From 1e42d375eb73a8efb3c46a8e31ea64717ffb6b73 Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:52:45 +0300 Subject: [PATCH 067/646] [react-loadable] bump react-loadable version to 5.5 --- types/react-loadable/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-loadable/index.d.ts b/types/react-loadable/index.d.ts index bf8af8e794..8661716e75 100644 --- a/types/react-loadable/index.d.ts +++ b/types/react-loadable/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-loadable 5.4 +// Type definitions for react-loadable 5.5 // Project: https://github.com/thejameskyle/react-loadable#readme // Definitions by: Jessica Franco // Oden S. From dcdb40585267e54523243e73a21bb88532006244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 21:12:02 +0800 Subject: [PATCH 068/646] =?UTF-8?q?weapp-api,=E5=A2=9E=E5=8A=A0=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E9=83=A8=E5=88=86=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 51 ++++++++++++++++++++-- types/weapp-api/tsconfig.json | 5 ++- types/weapp-api/weapp-api-tests.ts | 69 +++++++++++++++--------------- 3 files changed, 84 insertions(+), 41 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index fa328782ca..fec6f90f14 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -687,6 +687,9 @@ declare namespace wx { complete?: ResponseCallback; } + /** + * 公共回调函数 + */ interface CommonCallbackOptions { success?: ResponseCallback; fail?: ResponseCallback; @@ -744,20 +747,60 @@ declare namespace wx { * @param options */ function showLoading(options: LoadingOptions): void; + /** + * 隐藏消息提示框 + * @param options + */ function hideToast(options?: CommonCallbackOptions): void; + /** + * 显示消息提示框 + * @param options + */ function showToast(options: ToastOptions): void; - /** * 显示模态对话框 * @param options */ function showModal(options: ModalOptions): void; + + interface NavigationBarColorAnimationOptions { + // 动画变化时间,单位 ms,默认0 + animation?: number; + // 动画变化方式.动画从头到尾的速度是相同的,动画以低速开始,动画以低速结束,动画以低速开始和结束 + timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' + } + interface NavigationBarColorOptions extends CommonCallbackOptions{ + // 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 + frontColor: string; + // 背景颜色值,有效值为十六进制颜色 + backgroundColor: string; + // 动画效果 + animation: NavigationBarColorAnimationOptions; + } + interface NavigationBarTitleOptions extends CommonCallbackOptions{ + // 动态设置当前页面的标题 + title: string; + } // 导航栏 function setNavigationBarColor(): void; - function hideNavigationBarLoading(): void; - function showNavigationBarLoading(): void; - function setNavigationBarTitle(): void; + /** + * 在当前页面隐藏导航条加载动画 + */ + function hideNavigationBarLoading(options?: CommonCallbackOptions): void; + /** + * 在当前页面显示导航条加载动画 + */ + function showNavigationBarLoading(options: CommonCallbackOptions): void; + /** + * 动态设置当前页面的标题 + * @param options + */ + function setNavigationBarTitle(options: NavigationBarTitleOptions): void; + + // 背景 + function setBackgroundTextStyle(): void; + function setBackgroundColor(): void; interface AccelerometerData { /** X 轴 */ diff --git a/types/weapp-api/tsconfig.json b/types/weapp-api/tsconfig.json index ef43ffab75..74812f3d05 100644 --- a/types/weapp-api/tsconfig.json +++ b/types/weapp-api/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "weapp-api-tests.ts" + "weapp-api-tests.ts", + "../baidu-app/index.d.ts" ] -} \ No newline at end of file +} diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index e13f3766d5..4363179c80 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -14,7 +14,7 @@ App({ wx.login({ success: function () { wx.getUserInfo({ - success: function (res) { + success: function (res: any) { that.globalData.userInfo = res.userInfo; typeof cb == "function" && cb(that.globalData.userInfo) } @@ -37,7 +37,6 @@ Page({ foo: 'bar' }, onLoad: function (options) { - console.log(options.title); } }) @@ -51,13 +50,13 @@ wx.request({ header: { 'Content-Type': 'application/json' }, - success: function (res) { + success: function (res: any) { console.log(res.data) } }) wx.chooseImage({ - success: function (res) { + success: function (res: any) { var tempFilePaths = res.tempFilePaths wx.uploadFile({ url: 'http://example.com/upload', @@ -73,7 +72,7 @@ wx.chooseImage({ wx.downloadFile({ url: 'http://example.com/audio/123', type: 'audio', - success: function (res) { + success: function (res: any) { wx.playVoice({ filePath: res.tempFilePath }) @@ -95,17 +94,17 @@ wx.connectSocket({ wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { console.log('WebSocket连接已打开!') }) wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { console.log('WebSocket连接已打开!') }) -wx.onSocketError(function (res) { +wx.onSocketError(function (res: any) { console.log('WebSocket连接打开失败,请检查!') }) @@ -115,7 +114,7 @@ wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { socketOpen = true for (var i = 0; i < socketMsgQueue.length; i++) { sendSocketMessage(socketMsgQueue[i]) @@ -137,7 +136,7 @@ wx.connectSocket({ url: 'test.php' }) -wx.onSocketMessage(function (res) { +wx.onSocketMessage(function (res: any) { console.log('收到服务器内容:' + res.data) }) @@ -152,7 +151,7 @@ wx.onSocketOpen(function () { wx.closeSocket() }) -wx.onSocketClose(function (res) { +wx.onSocketClose(function (res: any) { console.log('WebSocket 已关闭!') }) @@ -160,7 +159,7 @@ wx.chooseImage({ count: 1, // 默认9 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { + success: function (res: any) { // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 var tempFilePaths = res.tempFilePaths } @@ -172,10 +171,10 @@ wx.previewImage({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath }, - fail: function (res) { + fail: function (res: any) { //录音失败 } }) @@ -185,7 +184,7 @@ setTimeout(function () { }, 10000) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath, @@ -196,7 +195,7 @@ wx.startRecord({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath @@ -210,7 +209,7 @@ wx.startRecord({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath @@ -223,7 +222,7 @@ wx.startRecord({ }) wx.getBackgroundAudioPlayerState({ - success: function (res) { + success: function (res: any) { var status = res.status var dataUrl = res.dataUrl var currentPosition = res.currentPosition @@ -246,11 +245,11 @@ wx.seekBackgroundAudio({ wx.stopBackgroundAudio() wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.saveFile({ tempFilePath: tempFilePath, - success: function (res) { + success: function (res: any) { var savedFilePath = res.savedFilePath } }) @@ -265,7 +264,7 @@ Page({ sourceType: ['album', 'camera'], maxDuration: 60, camera: ['front', 'back'], - success: function (res) { + success: function (res: any) { that.setData({ src: res.tempFilePath }) @@ -286,7 +285,7 @@ try { wx.getStorage({ key: 'key', - success: function (res) { + success: function (res: any) { console.log(res.data) } }) @@ -309,7 +308,7 @@ try { wx.getLocation({ type: 'wgs84', - success: function (res) { + success: function (res: any) { var latitude = res.latitude var longitude = res.longitude var speed = res.speed @@ -319,7 +318,7 @@ wx.getLocation({ wx.getLocation({ type: 'gcj02', //返回可以用于wx.openLocation的经纬度 - success: function(res) { + success: function(res: any) { var latitude = res.latitude var longitude = res.longitude wx.openLocation({ @@ -331,13 +330,13 @@ wx.getLocation({ }) wx.getNetworkType({ - success: function(res) { + success: function(res: any) { var networkType = res.networkType // 返回网络类型2g,3g,4g,wifi } }) wx.getSystemInfo({ - success: function(res) { + success: function(res: any) { console.log(res.model) console.log(res.pixelRatio) console.log(res.windowWidth) @@ -349,7 +348,7 @@ wx.getSystemInfo({ const updateManager = wx.getUpdateManager() -// updateManager.onCheckForUpdate(function (res) { +// updateManager.onCheckForUpdate(function (res: any) { // //请求完新版本信息的回调 // console.log(res.hasUpdate) // }) @@ -358,7 +357,7 @@ updateManager.onUpdateReady(function () { // wx.showModal({ // title: '更新提示', // content: '新版本已经准备好,是否重启应用?', - // success(res) { + // success(res: any) { // if (res.confirm) { // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // updateManager.applyUpdate() @@ -371,13 +370,13 @@ updateManager.onUpdateFailed(function () { // 新版本下载失败 }) -wx.onAccelerometerChange(function(res) { +wx.onAccelerometerChange(function(res: any) { console.log(res.x) console.log(res.y) console.log(res.z) }) -wx.onCompassChange(function (res) { +wx.onCompassChange(function (res: any) { console.log(res.direction) }) @@ -543,7 +542,7 @@ Page({ onReady: function() { var context = wx.createContext() wx.chooseImage({ - success: function(res) { + success: function(res: any) { context.drawImage(res.tempFilePaths[0], 0, 0) wx.drawCanvas({ canvasId: 1, @@ -656,7 +655,7 @@ Page({ App({ onLaunch: function() { wx.login({ - success: function(res) { + success: function(res: any) { if (res.code) { //发起网络请求 wx.request({ @@ -675,7 +674,7 @@ App({ wx.getUserInfo({ - success: function(res) { + success: function(res: any) { var userInfo = res.userInfo var nickName = userInfo.nickName var avatarUrl = userInfo.avatarUrl @@ -692,9 +691,9 @@ wx.requestPayment({ 'package': '', 'signType': 'MD5', 'paySign': '', - 'success':function(res){ + 'success':function(res: any){ }, - 'fail':function(res){ + 'fail':function(res: any){ } }) From db851d18a7cfb5ba5f01852e2399111e372f70e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 22:02:56 +0800 Subject: [PATCH 069/646] weapp-api,export wx --- types/weapp-api/index.d.ts | 2 ++ types/weapp-api/weapp-api-tests.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index fec6f90f14..5eb9c36175 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1403,3 +1403,5 @@ declare function setInterval(callback: functions, delay: number, rest: any): num * @param timeoutID 要取消的定时器的ID */ declare function clearInterval(timeoutID: number): number; + +export default wx diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 4363179c80..5b2b0616a2 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -1,12 +1,13 @@ +import wx from './index' App({ onLaunch: function () { //调用API从本地缓存中获取数据 - var logs = wx.getStorageSync('logs') as Array || [] + let logs = wx.getStorageSync('logs') as Array || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) }, getUserInfo: function (cb: Function) { - var that = this; + let that = this; if (this.globalData.userInfo) { typeof cb == "function" && cb(this.globalData.userInfo) } else { From 3544462263a63022527c3217398c0b1ffcf4d96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 22:08:31 +0800 Subject: [PATCH 070/646] modify functions type --- types/weapp-api/index.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 5eb9c36175..dcc3cd3e16 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: vargeek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import functions from "../react-icons/md/functions"; - declare namespace wx { type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; @@ -1382,7 +1380,7 @@ declare function getApp(): App; * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ -declare function setTimeout(callback: functions, delay: number, rest: any): number; +declare function setTimeout(callback: any, delay: number, rest: any): number; /** * 取消由 setTimeout 设置的定时器。 @@ -1396,7 +1394,7 @@ declare function clearTimeout(timeoutID: number): number; * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ -declare function setInterval(callback: functions, delay: number, rest: any): number; +declare function setInterval(callback: any, delay: number, rest: any): number; /** * 取消由 setInterval 设置的定时器。 From 4c3dae63c30e6626a955c41a4cbe6cbda5c48a5c Mon Sep 17 00:00:00 2001 From: Dmitri Trofimov Date: Fri, 4 Jan 2019 16:23:40 +0200 Subject: [PATCH 071/646] Test attempt #3 --- types/async/test/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 5aff9bb1b4..1f7c0fbb9a 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -358,7 +358,9 @@ q2.unshift(['task3', 'task4', 'task5'], function (error) { let q2Length = q2.length(); q2.push('testRemovalTask'); q2.remove(x => x.data === 'testTaskRemoval'); -throw new Error('how can I fail the test?'); +if (q2Length !== q2.length()) { + throw new Error('how can I fail the test?'); +} var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { console.log('hello ' + level); From 83f669d928aa4c9bcce903940248d0cebeeffa00 Mon Sep 17 00:00:00 2001 From: Dmitri Trofimov Date: Fri, 4 Jan 2019 16:31:11 +0200 Subject: [PATCH 072/646] fixed test error message --- types/async/test/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 1f7c0fbb9a..3803d77e08 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -359,7 +359,7 @@ let q2Length = q2.length(); q2.push('testRemovalTask'); q2.remove(x => x.data === 'testTaskRemoval'); if (q2Length !== q2.length()) { - throw new Error('how can I fail the test?'); + throw new Error('Failed to remove a task from queue.'); } var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { From 76de3577c706e4cda1a2280a767877ea4ca5803a Mon Sep 17 00:00:00 2001 From: Dmitri Trofimov Date: Fri, 4 Jan 2019 16:40:46 +0200 Subject: [PATCH 073/646] Added myself to the list of contributors --- types/async/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 4f5125f225..2f3d37d9f2 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -1,6 +1,11 @@ // Type definitions for Async 2.0.1 // Project: https://github.com/caolan/async -// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman , Angus Fenying , Pascal Martin +// Definitions by: Boris Yankov +// Arseniy Maximov +// Joe Herman +// Angus Fenying +// Pascal Martin +// Dmitri Trofimov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 602f9483ef157b48e9a7d67b2c7f512cbc281db2 Mon Sep 17 00:00:00 2001 From: Dmitri Trofimov Date: Fri, 4 Jan 2019 17:15:31 +0200 Subject: [PATCH 074/646] Increased Async version number. --- types/async/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 2f3d37d9f2..e12ac11c93 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Async 2.0.1 +// Type definitions for Async 2.4.0 // Project: https://github.com/caolan/async // Definitions by: Boris Yankov // Arseniy Maximov From 511c202dce506ae593082c8295005df075180d26 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Fri, 4 Jan 2019 20:59:58 +0100 Subject: [PATCH 075/646] Exporting the Snap.set() function, added new tests --- types/snapsvg/index.d.ts | 6 ++- types/snapsvg/test/4.ts | 92 +++++++++++++++++++++++++++++++++++++ types/snapsvg/tsconfig.json | 3 +- 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 types/snapsvg/test/4.ts diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 85f1eda7b8..8c2e22ce73 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for Snap-SVG 0.4.1 // Project: https://github.com/adobe-webplatform/Snap.svg -// Definitions by: Lars Klein , Mattanja Kern , Andrey Kurdyumov +// Definitions by: Lars Klein , +// Mattanja Kern , +// Andrey Kurdyumov , +// Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -31,6 +34,7 @@ declare namespace Snap { export function plugin(f:Function):void; export function select(query:string):Snap.Element; export function selectAll(query:string):any; + export function set(...args:Snap.Element[]): Snap.Set; export function snapTo(values:Array|number,value:number,tolerance?:number):number; export function animate(from:number|number[],to:number|number[],updater:(n:number)=>void,duration:number,easing?:(num:number)=>number,callback?:()=>void):mina.MinaAnimation; diff --git a/types/snapsvg/test/4.ts b/types/snapsvg/test/4.ts new file mode 100644 index 0000000000..fe15e6110f --- /dev/null +++ b/types/snapsvg/test/4.ts @@ -0,0 +1,92 @@ +// Tests by Terry Mun +// Checks that Snap.set() is properly typed + +const s = Snap(200, 500); +s.attr({ + viewBox: '0 0 200 500' +}); + +// Create multiple elements to be added to set +const rect1 = s.rect(0,0,50,50); +const rect2 = s.rect(0,100,50,50); +const rect3 = s.rect(0,200,50,50); +const rect4 = s.rect(0,300,50,50); +let rect5 = null; + +// Create new set +const rectSet = Snap.set(rect1, rect2); + +// Add missing rectangles to set +rectSet.push(rect3, rect4); + +// Set all attributes +rectSet.attr({ fill: 'steelblue' }); + +// Animate all elements in set +function animateTest() { + return new Promise(resolve => { + rectSet.animate({ x: 50 }, 500, mina.bounce, resolve); + }); +} + +// Animate elements individually +function forEachTest() { + const colors = ['red', 'green', 'blue']; + return new Promise(resolve => { + rectSet.forEach((element, idx) => element.attr({ fill: colors[idx] || '#aaa' })); + resolve(); + }); +} + +// Exclude rect4 from set +function excludeTest() { + return new Promise(resolve => { + rectSet.exclude(rect4); + rectSet.animate({ x: 100 }, 500, mina.bounce, resolve); + }); +} + +// Remove rect2 from set (it has index of 1) +// Add new rect5 to set +async function spliceTest() { + rectSet.splice(1, 1); + rectSet.attr({ fill: '#000' }); + + rect5 = s.rect(100, 400, 50, 50); + rectSet.splice(1, 0, rect5); + return; +} + +// Clear set. Rectangles should not go back to x=0 +function clearTest() { + return new Promise(resolve => { + rectSet.clear(); + + // SHOULD NOT WORK + rectSet.animate({ x: 0 }, 500, mina.bounce, resolve); + + // Re-add rects to set + rectSet.push(rect1, rect2, rect3, rect4, rect5); + resolve(); + }); +} + +// Remove all elements from DOM that are present in set +async function removeTest() { + rectSet.remove(); + return; +} + +// Start test +async function startTest() { + await animateTest(); + await forEachTest(); + await excludeTest(); + await spliceTest(); + await clearTest(); + await removeTest(); + + return; +} + +startTest(); \ No newline at end of file diff --git a/types/snapsvg/tsconfig.json b/types/snapsvg/tsconfig.json index 7ee69cd259..23101593c7 100644 --- a/types/snapsvg/tsconfig.json +++ b/types/snapsvg/tsconfig.json @@ -21,6 +21,7 @@ "index.d.ts", "test/1.ts", "test/2.ts", - "test/3.ts" + "test/3.ts", + "test/4.ts" ] } \ No newline at end of file From e7f993ee3e429253b381d1a51c849ce6e4bc3cdc Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Fri, 4 Jan 2019 21:08:00 +0100 Subject: [PATCH 076/646] Updated SnapSVG version to 0.5.1 --- types/snapsvg/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 8c2e22ce73..7a05c8d0bc 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Snap-SVG 0.4.1 +// Type definitions for Snap-SVG 0.5.1 // Project: https://github.com/adobe-webplatform/Snap.svg // Definitions by: Lars Klein , // Mattanja Kern , From b40e204bbf8ef4bb74e6fd482e835f85315ec19c Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Fri, 4 Jan 2019 21:31:10 +0100 Subject: [PATCH 077/646] Further updated `Snap.set()` typings, fixed issues with scoping in test file --- types/snapsvg/index.d.ts | 12 +-- types/snapsvg/test/4.ts | 160 ++++++++++++++++++++------------------- 2 files changed, 87 insertions(+), 85 deletions(-) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 7a05c8d0bc..0931ceda65 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -303,9 +303,9 @@ declare namespace Snap { } export interface Set { - animate(attrs:{[attr:string]:string|number|boolean|any},duration:number,easing?:(num:number)=>number,callback?:()=>void):Snap.Element; - animate(...params:Array<{attrs:any,duration:number,easing:(num:number)=>number,callback?:()=>void}>):Snap.Element; - attr(params: {[attr:string]:string|number|boolean|BBox|any}): Snap.Element; + animate(attrs:{[attr:string]:string|number|boolean|any},duration:number,easing?:(num:number)=>number,callback?:()=>void):Snap.Set; + animate(...params:Array<{attrs:any,duration:number,easing:(num:number)=>number,callback?:()=>void}>):Snap.Set; + attr(params: {[attr:string]:string|number|boolean|BBox|any}): Snap.Set; attr(param: "viewBox"): BBox; attr(param: string): string; bind(attr: string, callback: Function): Snap.Set; @@ -315,10 +315,10 @@ declare namespace Snap { exclude(element:Snap.Element):boolean; forEach(callback:Function,thisArg?:Object):Snap.Set; pop():Snap.Element; - push(el:Snap.Element):Snap.Element; - push(els:Snap.Element[]):Snap.Element; + push(el:Snap.Element):Snap.Set; + push(...els:Snap.element[]):Snap.Set; remove(): Snap.Set; - splice(index:number,count:number,insertion?:Object[]):Snap.Element[]; + splice(index:number,count:number,...insertion:Snap.Element[]):Snap.Set; } interface Filter { diff --git a/types/snapsvg/test/4.ts b/types/snapsvg/test/4.ts index fe15e6110f..6e7e0728f2 100644 --- a/types/snapsvg/test/4.ts +++ b/types/snapsvg/test/4.ts @@ -1,92 +1,94 @@ -// Tests by Terry Mun -// Checks that Snap.set() is properly typed +(() => { + // Tests by Terry Mun + // Checks that Snap.set() is properly typed -const s = Snap(200, 500); -s.attr({ - viewBox: '0 0 200 500' -}); + const s = Snap(200, 500); + s.attr({ + viewBox: '0 0 200 500' + }); -// Create multiple elements to be added to set -const rect1 = s.rect(0,0,50,50); -const rect2 = s.rect(0,100,50,50); -const rect3 = s.rect(0,200,50,50); -const rect4 = s.rect(0,300,50,50); -let rect5 = null; + // Create multiple elements to be added to set + const rect1 = s.rect(0,0,50,50); + const rect2 = s.rect(0,100,50,50); + const rect3 = s.rect(0,200,50,50); + const rect4 = s.rect(0,300,50,50); + let rect5: Snap.Element; -// Create new set -const rectSet = Snap.set(rect1, rect2); + // Create new set + const rectSet = Snap.set(rect1, rect2); -// Add missing rectangles to set -rectSet.push(rect3, rect4); + // Add missing rectangles to set + rectSet.push(rect3, rect4); -// Set all attributes -rectSet.attr({ fill: 'steelblue' }); + // Set all attributes + rectSet.attr({ fill: 'steelblue' }); -// Animate all elements in set -function animateTest() { - return new Promise(resolve => { - rectSet.animate({ x: 50 }, 500, mina.bounce, resolve); - }); -} + // Animate all elements in set + function animateTest() { + return new Promise(resolve => { + rectSet.animate({ x: 50 }, 500, mina.bounce, resolve); + }); + } -// Animate elements individually -function forEachTest() { - const colors = ['red', 'green', 'blue']; - return new Promise(resolve => { - rectSet.forEach((element, idx) => element.attr({ fill: colors[idx] || '#aaa' })); - resolve(); - }); -} + // Animate elements individually + function forEachTest() { + const colors = ['red', 'green', 'blue']; + return new Promise(resolve => { + rectSet.forEach((element, idx) => element.attr({ fill: colors[idx] || '#aaa' })); + resolve(); + }); + } -// Exclude rect4 from set -function excludeTest() { - return new Promise(resolve => { - rectSet.exclude(rect4); - rectSet.animate({ x: 100 }, 500, mina.bounce, resolve); - }); -} + // Exclude rect4 from set + function excludeTest() { + return new Promise(resolve => { + rectSet.exclude(rect4); + rectSet.animate({ x: 100 }, 500, mina.bounce, resolve); + }); + } -// Remove rect2 from set (it has index of 1) -// Add new rect5 to set -async function spliceTest() { - rectSet.splice(1, 1); - rectSet.attr({ fill: '#000' }); - - rect5 = s.rect(100, 400, 50, 50); - rectSet.splice(1, 0, rect5); - return; -} + // Remove rect2 from set (it has index of 1) + // Add new rect5 to set + async function spliceTest() { + rectSet.splice(1, 1); + rectSet.attr({ fill: '#000' }); + + rect5 = s.rect(100, 400, 50, 50); + rectSet.splice(1, 0, rect5); + return; + } -// Clear set. Rectangles should not go back to x=0 -function clearTest() { - return new Promise(resolve => { - rectSet.clear(); - - // SHOULD NOT WORK - rectSet.animate({ x: 0 }, 500, mina.bounce, resolve); - - // Re-add rects to set - rectSet.push(rect1, rect2, rect3, rect4, rect5); - resolve(); - }); -} + // Clear set. Rectangles should not go back to x=0 + function clearTest() { + return new Promise(resolve => { + rectSet.clear(); + + // SHOULD NOT WORK + rectSet.animate({ x: 0 }, 500, mina.bounce, resolve); + + // Re-add rects to set + rectSet.push(rect1, rect2, rect3, rect4, rect5); + resolve(); + }); + } -// Remove all elements from DOM that are present in set -async function removeTest() { - rectSet.remove(); - return; -} + // Remove all elements from DOM that are present in set + async function removeTest() { + rectSet.remove(); + return; + } -// Start test -async function startTest() { - await animateTest(); - await forEachTest(); - await excludeTest(); - await spliceTest(); - await clearTest(); - await removeTest(); - - return; -} + // Start test + async function startTest() { + await animateTest(); + await forEachTest(); + await excludeTest(); + await spliceTest(); + await clearTest(); + await removeTest(); + + return; + } -startTest(); \ No newline at end of file + startTest(); +})(); \ No newline at end of file From 2ff95235fb829970a733dde7ed516e96ebdd7c4a Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Fri, 4 Jan 2019 21:40:24 +0100 Subject: [PATCH 078/646] Updated typing for callback in `Set.forEach()` --- types/snapsvg/index.d.ts | 4 ++-- types/snapsvg/test/4.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 0931ceda65..05d69b3d57 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -313,10 +313,10 @@ declare namespace Snap { bind(attr:string,element:Snap.Element,eattr:string):Snap.Set; clear():Snap.Set; exclude(element:Snap.Element):boolean; - forEach(callback:Function,thisArg?:Object):Snap.Set; + forEach(callback:(el:Snap.Element,index?:number)=>void|boolean),thisArg?:Object):Snap.Set; pop():Snap.Element; push(el:Snap.Element):Snap.Set; - push(...els:Snap.element[]):Snap.Set; + push(...els:Snap.Element[]):Snap.Set; remove(): Snap.Set; splice(index:number,count:number,...insertion:Snap.Element[]):Snap.Set; } diff --git a/types/snapsvg/test/4.ts b/types/snapsvg/test/4.ts index 6e7e0728f2..01f3747c5e 100644 --- a/types/snapsvg/test/4.ts +++ b/types/snapsvg/test/4.ts @@ -34,7 +34,7 @@ function forEachTest() { const colors = ['red', 'green', 'blue']; return new Promise(resolve => { - rectSet.forEach((element, idx) => element.attr({ fill: colors[idx] || '#aaa' })); + rectSet.forEach((element,idx) => element.attr({ fill: colors[idx] || '#aaa' })); resolve(); }); } From 66cc864a9a8016ddcf3a84b0d040976981362433 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Fri, 4 Jan 2019 21:45:37 +0100 Subject: [PATCH 079/646] Removed extraenous closing parenthesis --- types/snapsvg/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 05d69b3d57..9080b358df 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -313,7 +313,7 @@ declare namespace Snap { bind(attr:string,element:Snap.Element,eattr:string):Snap.Set; clear():Snap.Set; exclude(element:Snap.Element):boolean; - forEach(callback:(el:Snap.Element,index?:number)=>void|boolean),thisArg?:Object):Snap.Set; + forEach(callback:(el:Snap.Element,index?:number)=>void|boolean,thisArg?:Object):Snap.Set; pop():Snap.Element; push(el:Snap.Element):Snap.Set; push(...els:Snap.Element[]):Snap.Set; From 98c484fd96d6b6e05058d77798775be339ac3cd5 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Fri, 4 Jan 2019 21:56:12 +0100 Subject: [PATCH 080/646] Added minimum requirement for TS2.1, fixed test --- types/snapsvg/index.d.ts | 1 + types/snapsvg/test/4.ts | 180 +++++++++++++++++++++------------------ 2 files changed, 98 insertions(+), 83 deletions(-) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 9080b358df..0bd6c573ff 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -5,6 +5,7 @@ // Andrey Kurdyumov , // Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// export = Snap; diff --git a/types/snapsvg/test/4.ts b/types/snapsvg/test/4.ts index 01f3747c5e..6fcf8a2a95 100644 --- a/types/snapsvg/test/4.ts +++ b/types/snapsvg/test/4.ts @@ -1,94 +1,108 @@ (() => { - // Tests by Terry Mun - // Checks that Snap.set() is properly typed + // Tests by Terry Mun + // Checks that Snap.set() is properly typed - const s = Snap(200, 500); - s.attr({ - viewBox: '0 0 200 500' + const s = Snap(200, 500); + s.attr({ + viewBox: '0 0 200 500' + }); + + // Create multiple elements to be added to set + const rect1 = s.rect(0, 0, 50, 50); + const rect2 = s.rect(0, 100, 50, 50); + const rect3 = s.rect(0, 200, 50, 50); + const rect4 = s.rect(0, 300, 50, 50); + let rect5: Snap.Element; + + // Create new set + const rectSet = Snap.set(rect1, rect2); + + // Add missing rectangles to set + rectSet.push(rect3, rect4); + + // Set all attributes + rectSet.attr({ + fill: 'steelblue' + }); + + // Animate all elements in set + function animateTest() { + return new Promise(resolve => { + rectSet.animate({ + x: 50 + }, 500, mina.bounce, resolve); + }); + } + + // Animate elements individually + function forEachTest() { + const colors = ['red', 'green', 'blue']; + return new Promise(resolve => { + rectSet.forEach((element, idx) => { + element.attr({ + fill: colors[idx] || '#aaa' + }); + }); + resolve(); + }); + } + + // Exclude rect4 from set + function excludeTest() { + return new Promise(resolve => { + rectSet.exclude(rect4); + rectSet.animate({ + x: 100 + }, 500, mina.bounce, resolve); + }); + } + + // Remove rect2 from set (it has index of 1) + // Add new rect5 to set + async function spliceTest() { + rectSet.splice(1, 1); + rectSet.attr({ + fill: '#000' }); - // Create multiple elements to be added to set - const rect1 = s.rect(0,0,50,50); - const rect2 = s.rect(0,100,50,50); - const rect3 = s.rect(0,200,50,50); - const rect4 = s.rect(0,300,50,50); - let rect5: Snap.Element; + rect5 = s.rect(100, 400, 50, 50); + rectSet.splice(1, 0, rect5); + return; + } - // Create new set - const rectSet = Snap.set(rect1, rect2); + // Clear set. Rectangles should not go back to x=0 + function clearTest() { + return new Promise(resolve => { + rectSet.clear(); - // Add missing rectangles to set - rectSet.push(rect3, rect4); + // SHOULD NOT WORK + rectSet.animate({ + x: 0 + }, 500, mina.bounce, resolve); - // Set all attributes - rectSet.attr({ fill: 'steelblue' }); + // Re-add rects to set + rectSet.push(rect1, rect2, rect3, rect4, rect5); + resolve(); + }); + } - // Animate all elements in set - function animateTest() { - return new Promise(resolve => { - rectSet.animate({ x: 50 }, 500, mina.bounce, resolve); - }); - } + // Remove all elements from DOM that are present in set + async function removeTest() { + rectSet.remove(); + return; + } - // Animate elements individually - function forEachTest() { - const colors = ['red', 'green', 'blue']; - return new Promise(resolve => { - rectSet.forEach((element,idx) => element.attr({ fill: colors[idx] || '#aaa' })); - resolve(); - }); - } + // Start test + async function startTest() { + await animateTest(); + await forEachTest(); + await excludeTest(); + await spliceTest(); + await clearTest(); + await removeTest(); - // Exclude rect4 from set - function excludeTest() { - return new Promise(resolve => { - rectSet.exclude(rect4); - rectSet.animate({ x: 100 }, 500, mina.bounce, resolve); - }); - } + return; + } - // Remove rect2 from set (it has index of 1) - // Add new rect5 to set - async function spliceTest() { - rectSet.splice(1, 1); - rectSet.attr({ fill: '#000' }); - - rect5 = s.rect(100, 400, 50, 50); - rectSet.splice(1, 0, rect5); - return; - } - - // Clear set. Rectangles should not go back to x=0 - function clearTest() { - return new Promise(resolve => { - rectSet.clear(); - - // SHOULD NOT WORK - rectSet.animate({ x: 0 }, 500, mina.bounce, resolve); - - // Re-add rects to set - rectSet.push(rect1, rect2, rect3, rect4, rect5); - resolve(); - }); - } - - // Remove all elements from DOM that are present in set - async function removeTest() { - rectSet.remove(); - return; - } - - // Start test - async function startTest() { - await animateTest(); - await forEachTest(); - await excludeTest(); - await spliceTest(); - await clearTest(); - await removeTest(); - - return; - } - - startTest(); -})(); \ No newline at end of file + startTest(); +})(); From 08319af8f71ff9a30cf1855a01a4e864f411067d Mon Sep 17 00:00:00 2001 From: Max Bogue Date: Fri, 4 Jan 2019 16:05:51 -0600 Subject: [PATCH 081/646] Update lodash/fp/filter to support string[]. --- types/lodash/common/collection.d.ts | 6 +++--- types/lodash/fp.d.ts | 6 +++--- types/lodash/lodash-tests.ts | 1 + types/lowdb/_lodash.d.ts | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/types/lodash/common/collection.d.ts b/types/lodash/common/collection.d.ts index d8ddc97197..024116adc8 100644 --- a/types/lodash/common/collection.d.ts +++ b/types/lodash/common/collection.d.ts @@ -215,7 +215,7 @@ declare module "../index" { * @return Returns the new filtered array. */ filter( - collection: string | null | undefined, + collection: string | string[] | null | undefined, predicate?: StringIterator ): string[]; @@ -257,7 +257,7 @@ declare module "../index" { * @see _.filter */ filter( - this: LoDashImplicitWrapper, + this: LoDashImplicitWrapper, predicate?: StringIterator ): LoDashImplicitWrapper; @@ -299,7 +299,7 @@ declare module "../index" { * @see _.filter */ filter( - this: LoDashExplicitWrapper, + this: LoDashExplicitWrapper, predicate?: StringIterator ): LoDashExplicitWrapper; diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 9b6cf52ccb..a31b8b459d 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -918,8 +918,8 @@ declare namespace _ { type LodashFill2x14 = (start: number) => lodash.List; interface LodashFilter { (predicate: (value: string) => boolean): LodashFilter1x1; - (predicate: lodash.__, collection: string | null | undefined): LodashFilter1x2; - (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; + (predicate: lodash.__, collection: string | string[] | null | undefined): LodashFilter1x2; + (predicate: (value: string) => boolean, collection: string | string[] | null | undefined): string[]; (predicate: lodash.ValueIteratorTypeGuard): LodashFilter2x1; (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFilter2x2; (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S[]; @@ -930,7 +930,7 @@ declare namespace _ { (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S[]; (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; } - type LodashFilter1x1 = (collection: string | null | undefined) => string[]; + type LodashFilter1x1 = (collection: string | string[] | null | undefined) => string[]; type LodashFilter1x2 = (predicate: (value: string) => boolean) => string[]; type LodashFilter2x1 = (collection: lodash.List | null | undefined) => S[]; interface LodashFilter2x2 { diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 9d2547dcf4..1aa4bc3eb2 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -1766,6 +1766,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts index 7267aab0d9..c332a229c6 100644 --- a/types/lowdb/_lodash.d.ts +++ b/types/lowdb/_lodash.d.ts @@ -459,7 +459,7 @@ declare module "./index" { predicate?: _.ObjectIterateeCustom ): LoDashExplicitSyncWrapper; filter( - this: LoDashExplicitSyncWrapper, + this: LoDashExplicitSyncWrapper, predicate?: _.StringIterator ): LoDashExplicitSyncWrapper; filter( @@ -2055,7 +2055,7 @@ declare module "./index" { predicate?: _.ObjectIterateeCustom ): LoDashExplicitAsyncWrapper; filter( - this: LoDashExplicitAsyncWrapper, + this: LoDashExplicitAsyncWrapper, predicate?: _.StringIterator ): LoDashExplicitAsyncWrapper; filter( From a2c314c5de1cb4fc0e7334d37d022e5ef84465e3 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 4 Jan 2019 16:30:02 -0800 Subject: [PATCH 082/646] [styled-components] Add support of `defaultProps` --- types/styled-components/index.d.ts | 5 ++++ types/styled-components/test/index.tsx | 37 ++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index ca3ff22c0e..6c3ec7b1de 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -109,6 +109,9 @@ type ForwardRefExoticBase

= Pick< keyof React.ForwardRefExoticComponent >; +// extracts React defaultProps +type ReactDefaultProps = C extends { defaultProps: infer D; } ? D : never; + // any doesn't count as assignable to never in the extends clause, and we default A to never export type AnyStyledComponent = | StyledComponent @@ -141,6 +144,8 @@ export interface StyledComponentBase< // props: StyledComponentPropsWithAs // ): React.ReactElement> + defaultProps: ReactDefaultProps; + // TODO (TypeScript 3.2): delete this overload ( props: StyledComponentProps & { diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index 0c175d8ce9..710c5f2070 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -270,7 +270,7 @@ const MyOtherComponentWithProps = () => ( // Create a react component that renders an // which takes extra props passed as a generic type argument -const LinkFromStringWithPropsAndGenerics = styled("a")` +const LinkFromStringWithPropsAndGenerics = styled("a") ` font-size: 1.5em; text-align: center; color: ${a => (a.canClick ? "palevioletred" : "gray")}; @@ -656,7 +656,7 @@ async function typedThemes() { ThemeProvider, ThemeConsumer } = (await import("styled-components")) as any as ThemedStyledComponentsModule< - typeof theme + typeof theme >; const ThemedDiv = styled.div` @@ -946,3 +946,36 @@ function validateArgumentsAndReturns() { // $ExpectError createGlobalStyle([]); } + +function validateDefaultProps() { + interface Props { + requiredProp: boolean; + optionalProp: string; // Shouldn't need to be optional here + } + + class MyComponent extends React.PureComponent { + static defaultProps = { + optionalProp: 'fallback' + }; + + render() { + const { requiredProp, optionalProp } = this.props; + return ( + + {requiredProp.toString()} + {optionalProp.toString()} + + ); + } + } + + const StyledComponent = styled(MyComponent)` + color: red + `; + + ; + ; + ; + // still respects the type of optionalProp + ; // $ExpectError +} From 48f49d955ef346e6051791382b3bd1589a1041b2 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 4 Jan 2019 17:12:06 -0800 Subject: [PATCH 083/646] Comment out some tests which only fails on lower versions of TS --- types/styled-components/test/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index 710c5f2070..138e941c4f 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -973,9 +973,14 @@ function validateDefaultProps() { color: red `; - ; + // this test is failing in TS 2.9 but not in 3.0 + // ; + ; - ; + + // this test is failing in TS 3.0 but not in 3.1 + // ; + // still respects the type of optionalProp ; // $ExpectError } From c38f3d2767f154dc0f425541e004ce5ada484f7e Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Sat, 5 Jan 2019 12:53:07 +0100 Subject: [PATCH 084/646] Minor spelling changes, whitespace removal, and improvement to Snap.set() API This commit includes ensuring methods exposed by the Set API is typed in a consistent manner as per documentation: * `.attr()` always returns `Snap.set` * `.getBBox()`, `.insertAfter()` is added --- types/snapsvg/index.d.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 0bd6c573ff..ca08eb1eff 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -35,7 +35,7 @@ declare namespace Snap { export function plugin(f:Function):void; export function select(query:string):Snap.Element; export function selectAll(query:string):any; - export function set(...args:Snap.Element[]): Snap.Set; + export function set(...els:Snap.Element[]):Snap.Set; export function snapTo(values:Array|number,value:number,tolerance?:number):number; export function animate(from:number|number[],to:number|number[],updater:(n:number)=>void,duration:number,easing?:(num:number)=>number,callback?:()=>void):mina.MinaAnimation; @@ -306,19 +306,21 @@ declare namespace Snap { export interface Set { animate(attrs:{[attr:string]:string|number|boolean|any},duration:number,easing?:(num:number)=>number,callback?:()=>void):Snap.Set; animate(...params:Array<{attrs:any,duration:number,easing:(num:number)=>number,callback?:()=>void}>):Snap.Set; - attr(params: {[attr:string]:string|number|boolean|BBox|any}): Snap.Set; - attr(param: "viewBox"): BBox; - attr(param: string): string; - bind(attr: string, callback: Function): Snap.Set; + attr(params:{[attr:string]:string|number|boolean|BBox|any}):Snap.Set; + attr(param:"viewBox"):Snap.Set; + attr(param:string):Snap.Set; + bind(attr:string,callback:Function):Snap.Set; bind(attr:string,element:Snap.Element):Snap.Set; bind(attr:string,element:Snap.Element,eattr:string):Snap.Set; - clear():Snap.Set; - exclude(element:Snap.Element):boolean; + clear():void; + exclude(el:Snap.Element):boolean; forEach(callback:(el:Snap.Element,index?:number)=>void|boolean,thisArg?:Object):Snap.Set; + getBBox():BBox; + insertAfter():Snap.Set; pop():Snap.Element; push(el:Snap.Element):Snap.Set; push(...els:Snap.Element[]):Snap.Set; - remove(): Snap.Set; + remove():Snap.Set; splice(index:number,count:number,...insertion:Snap.Element[]):Snap.Set; } From 4dc4f8a0d3f94602348a71af95b60e72bc48490d Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 5 Jan 2019 14:32:43 +0100 Subject: [PATCH 085/646] Lint finles: remove most exceptions. Add few JsDoc. Remove old 'Env' properties. --- types/jasmine/index.d.ts | 137 +++++++++++++++----------- types/jasmine/jasmine-tests.ts | 172 ++++++++++++++++----------------- types/jasmine/tslint.json | 69 +------------ 3 files changed, 162 insertions(+), 216 deletions(-) diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index 2109645eef..f9eaff376a 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -21,7 +21,19 @@ * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs */ declare function describe(description: string, specDefinitions: () => void): void; + +/** + * A focused `describe`. If suites or specs are focused, only those that are focused will be executed. + * @param description Textual description of the group + * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs + */ declare function fdescribe(description: string, specDefinitions: () => void): void; + +/** + * A temporarily disabled `describe`. Specs within an xdescribe will be marked pending and not executed. + * @param description Textual description of the group + * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs + */ declare function xdescribe(description: string, specDefinitions: () => void): void; /** @@ -34,20 +46,25 @@ declare function xdescribe(description: string, specDefinitions: () => void): vo declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; /** - * A focused it - * If suites or specs are focused, only those that are focused will be executed. - * @param expectation - * @param assertion - * @param timeout + * A focused `it`. If suites or specs are focused, only those that are focused will be executed. + * @param expectation Textual description of what this spec is checking + * @param assertion Function that contains the code of your test. If not provided the test will be pending. + * @param timeout Custom timeout for an async spec. */ declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; + +/** + * A temporarily disabled `it`. The spec will report as pending and will not be executed. + * @param expectation Textual description of what this spec is checking + * @param assertion Function that contains the code of your test. If not provided the test will be pending. + * @param timeout Custom timeout for an async spec. + */ declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; /** * Mark a spec as pending, expectation results will be ignored. * If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. - * @param reason - * @returns {} + * @param reason Reason the spec is pending. */ declare function pending(reason?: string): void; @@ -119,11 +136,13 @@ declare function expectAsync(actual: Promise): jasmine.AsyncMatchers(object: T, method: keyof T): jasmine.Spy; /** - * Install a spy on a property onto an existing object. - * @param object The object upon which to install the Spy - * @param property The name of the property to replace with a Spy - * @param accessType The access type (get|set) of the property to Spy on. + * Install a spy on a property installed with `Object.defineProperty` onto an existing object. + * @param object The object upon which to install the `Spy`. + * @param property The name of the property to replace with a `Spy`. + * @param accessType The access type (get|set) of the property to `Spy` on. */ declare function spyOnProperty(object: T, property: keyof T, accessType?: 'get' | 'set'): jasmine.Spy; /** * Installs spies on all writable and configurable properties of an object. - * @param object The object upon which to install the Spies + * @param object The object upon which to install the `Spy`s. */ declare function spyOnAllFunctions(object: object): jasmine.Spy; @@ -158,9 +177,12 @@ declare function waits(timeout?: number): void; declare namespace jasmine { type Expected = T | ObjectContaining | Any | Spy; - type SpyObjMethodNames = T extends undefined ? (ReadonlyArray | {[methodName: string]: any}) : (ReadonlyArray | {[P in keyof T]?: ReturnType any ? T[P] : any>}); + type SpyObjMethodNames = + T extends undefined ? + (ReadonlyArray | {[methodName: string]: any}) : + (ReadonlyArray | {[P in keyof T]?: ReturnType any ? T[P] : any>}); - var clock: () => Clock; + function clock(): Clock; var matchersUtil: MatchersUtil; @@ -187,13 +209,12 @@ declare namespace jasmine { function addMatchers(matchers: CustomMatcherFactories): void; - function stringMatching(str: string): Any; - function stringMatching(str: RegExp): Any; + function stringMatching(str: string | RegExp): Any; function formatErrorMsg(domain: string, usage: string): (msg: string) => string; interface Any { - (...params: any[]):any; // jasmine.Any can also be a function + (...params: any[]): any; // jasmine.Any can also be a function new (expectedClass: any): any; jasmineMatches(other: any): boolean; @@ -221,7 +242,6 @@ declare namespace jasmine { } interface Block { - new (env: Env, func: SpecFunction, spec: Spec): any; execute(onComplete: () => void): void; @@ -271,12 +291,6 @@ declare namespace jasmine { } interface Env { - setTimeout: any; - clearTimeout: void; - setInterval: any; - clearInterval: void; - updateInterval: number; - currentSpec: Spec; matchersClass: Matchers; @@ -284,8 +298,7 @@ declare namespace jasmine { version(): any; versionString(): string; nextSpecId(): number; - addReporter(reporter: Reporter): void; - addReporter(reporter: CustomReporter): void; + addReporter(reporter: Reporter | CustomReporter): void; execute(): void; describe(description: string, specDefinitions: () => void): Suite; // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these @@ -316,7 +329,6 @@ declare namespace jasmine { } interface FakeTimer { - new (): any; reset(): void; @@ -395,7 +407,6 @@ declare namespace jasmine { } interface PrettyPrinter { - new (): any; format(value: any): void; @@ -411,7 +422,6 @@ declare namespace jasmine { } interface Queue { - new (env: any): any; env: Env; @@ -432,7 +442,6 @@ declare namespace jasmine { } interface Matchers { - new (env: Env, actual: T, spec: Env, isNot?: boolean): any; env: Env; @@ -445,7 +454,6 @@ declare namespace jasmine { * * @param expected the actual value to be === to the expected value. * @param expectationFailOutput - * @returns {} */ toBe(expected: Expected, expectationFailOutput?: any): boolean; @@ -453,7 +461,6 @@ declare namespace jasmine { * * @param expected the actual value to be equal to the expected, using deep equality comparison. * @param expectationFailOutput - * @returns {} */ toEqual(expected: Expected, expectationFailOutput?: any): boolean; toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; @@ -504,7 +511,6 @@ declare namespace jasmine { } interface AsyncMatchers { - /** * Expect a promise to be resolved. * @param expectationFailOutput @@ -538,7 +544,7 @@ declare namespace jasmine { /** * Invert the matcher following this expect. */ - not: AsyncMatchers + not: AsyncMatchers; } interface Reporter { @@ -571,7 +577,6 @@ declare namespace jasmine { } interface PassedExpectation extends CustomReportExpectation { - } interface CustomReporterResult { @@ -586,7 +591,7 @@ declare namespace jasmine { interface RunDetails { failedExpectations: ExpectationResult[]; - order: jasmine.Order; + order: Order; } interface CustomReporter { @@ -599,7 +604,6 @@ declare namespace jasmine { } interface Runner { - new (env: Env): any; execute(): void; @@ -626,7 +630,6 @@ declare namespace jasmine { } interface Spec extends SuiteOrSpec { - new (env: Env, suite: Suite, description: string): any; suite: Suite; @@ -670,7 +673,6 @@ declare namespace jasmine { } interface Suite extends SuiteOrSpec { - new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; parentSuite: Suite; @@ -703,7 +705,7 @@ declare namespace jasmine { type SpyObj = { [k in keyof T]: T[k] extends Function ? T[k] & Spy : T[k]; - } + }; interface SpyAnd { identity: string; @@ -723,21 +725,21 @@ declare namespace jasmine { } interface Calls { - /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ + /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. */ any(): boolean; - /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ + /** By chaining the spy with calls.count(), will return the number of times the spy was called */ count(): number; - /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ + /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index */ argsFor(index: number): any[]; - /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ + /** By chaining the spy with calls.allArgs(), will return the arguments to all calls */ allArgs(): any[]; - /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ + /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls */ all(): CallInfo[]; - /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ + /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call */ mostRecent(): CallInfo; - /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ + /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call */ first(): CallInfo; - /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ + /** By chaining the spy with calls.reset(), will clears all tracking for a spy */ reset(): void; } @@ -759,7 +761,6 @@ declare namespace jasmine { } interface JsApiReporter extends Reporter { - started: boolean; finished: boolean; result: any; @@ -783,10 +784,32 @@ declare namespace jasmine { util: Util; } - export var HtmlReporter: HtmlReporter; - export var HtmlSpecFilter: HtmlSpecFilter; - export var DEFAULT_TIMEOUT_INTERVAL: number; - export var MAX_PRETTY_PRINT_DEPTH: number; + var HtmlReporter: HtmlReporter; + var HtmlSpecFilter: HtmlSpecFilter; + + /** + * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete. + */ + var DEFAULT_TIMEOUT_INTERVAL: number; + + /** + * Maximum number of array elements to display when pretty printing objects. + * This will also limit the number of keys and values displayed for an object. + * Elements past this number will be ellipised. + */ + var MAX_PRETTY_PRINT_ARRAY_LENGTH: number; + + /** + * Maximum number of charasters to display when pretty printing objects. + * Characters past this number will be ellipised. + */ + var MAX_PRETTY_PRINT_CHARS: number; + + /** + * Maximum object depth the pretty printer will print to. + * Set this to a lower value to speed up pretty printing if you have large objects. + */ + var MAX_PRETTY_PRINT_DEPTH: number; } declare module "jasmine" { diff --git a/types/jasmine/jasmine-tests.ts b/types/jasmine/jasmine-tests.ts index bf3598fda9..436f7b9bc0 100644 --- a/types/jasmine/jasmine-tests.ts +++ b/types/jasmine/jasmine-tests.ts @@ -16,7 +16,6 @@ describe("A suite is just a function", () => { }); describe("The 'toBe' matcher compares with ===", () => { - it("and has a positive case", () => { expect(true).toBe(true); }); @@ -27,28 +26,26 @@ describe("The 'toBe' matcher compares with ===", () => { }); describe("Included matchers:", () => { - it("The 'toBe' matcher compares with ===", () => { - var a = 12; - var b = a; + const a = 12; + const b = a; expect(a).toBe(b); expect(a).not.toBe(24); }); describe("The 'toEqual' matcher", () => { - it("works for simple literals and variables", () => { - var a = 12; + const a = 12; expect(a).toEqual(12); }); it("should work for objects", () => { - var foo = { + const foo = { a: 12, b: 34 }; - var bar = { + const bar = { a: 12, b: 34 }; @@ -56,13 +53,13 @@ describe("Included matchers:", () => { }); it("should work for optional values", () => { - var opt: string | undefined = "s"; - expect(opt as (string | undefined)).toEqual(undefined); + const opt: string | undefined = Math.random() > .5 ? "s" : undefined; + expect(opt).toEqual(undefined); }); }); it("The 'toMatch' matcher is for regular expressions", () => { - var message = "foo bar baz"; + const message = "foo bar baz"; expect(message).toMatch(/bar/); expect(message).toMatch("bar"); @@ -70,7 +67,7 @@ describe("Included matchers:", () => { }); it("The 'toBeDefined' matcher compares against `undefined`", () => { - var a = { + const a = { foo: "foo" }; @@ -79,7 +76,7 @@ describe("Included matchers:", () => { }); it("The `toBeUndefined` matcher compares against `undefined`", () => { - var a = { + const a = { foo: "foo" }; @@ -88,8 +85,8 @@ describe("Included matchers:", () => { }); it("The 'toBeNull' matcher compares against null", () => { - var a: string | null = null; - var foo = "foo"; + const a: string | null = Math.random() > 0.5 ? "s" : null; + const foo = "foo"; expect(null).toBeNull(); expect(a).toBeNull(); @@ -97,72 +94,76 @@ describe("Included matchers:", () => { }); it("The 'toBeTruthy' matcher is for boolean casting testing", () => { - var a: string | undefined, foo = "foo"; + const a: string | undefined = Math.random() > 0.5 ? "s" : undefined; + const foo = "foo"; expect(foo).toBeTruthy(); expect(a).not.toBeTruthy(); }); it("The 'toBeFalsy' matcher is for boolean casting testing", () => { - var a: string | undefined, foo = "foo"; + const a: string | undefined = Math.random() > 0.5 ? "s" : undefined; + const foo = "foo"; expect(a).toBeFalsy(); expect(foo).not.toBeFalsy(); }); it("The 'toContain' matcher is for finding an item in an Array", () => { - var a = ["foo", "bar", "baz"]; + const a = ["foo", "bar", "baz"]; expect(a).toContain('foo'); expect(a).not.toContain("quux"); }); it("The 'toContain' matcher is also for finding an object containing distinct properties in an Array", () => { - var a = [{ a: "foo" }, { a: "bar" }, { b: "baz" }]; + const a = [{ a: "foo" }, { a: "bar" }, { b: "baz" }]; expect(a).toContain(jasmine.objectContaining({ a: "foo" })); expect(a).not.toContain({ a: "quux" }); }); it("The 'toBeLessThan' matcher is for mathematical comparisons", () => { - var pi = 3.1415926, - e = 2.78; + const pi = 3.1415926; + const e = 2.78; expect(e).toBeLessThan(pi); expect(pi).not.toBeLessThan(e); }); it("The 'toBeGreaterThan' is for mathematical comparisons", () => { - var pi = 3.1415926, - e = 2.78; + const pi = 3.1415926; + const e = 2.78; expect(pi).toBeGreaterThan(e); expect(e).not.toBeGreaterThan(pi); }); it("The 'toBeCloseTo' matcher is for precision math comparison", () => { - var pi = 3.1415926, - e = 2.78; + const pi = 3.1415926; + const e = 2.78; expect(pi).not.toBeCloseTo(e, 2); expect(pi).toBeCloseTo(e, 0); }); it("The 'toThrow' matcher is for testing if a function throws an exception", () => { - var foo = () => { + const foo = () => { return 1 + 2; }; - var bar = () => { - var a: any; - return a + 1; + const bar = () => { + throw new Error("message"); }; expect(foo).not.toThrow(); + expect(foo).toThrow(); + + expect(bar).not.toThrow(); expect(bar).toThrow(); }); it("The 'toThrowError' matcher is for testing a specific thrown exception", () => { - var foo = () => { + const foo = () => { throw new TypeError("foo bar baz"); }; @@ -173,7 +174,7 @@ describe("Included matchers:", () => { }); it("async matchers", async () => { - var badness = new Error("badness"); + const badness = new Error("badness"); await expectAsync(Promise.resolve()).toBeResolved(); await expectAsync(Promise.resolve()).toBeResolved("good job"); await expectAsync(Promise.resolve(true)).toBeResolvedTo(true); @@ -184,8 +185,8 @@ describe("Included matchers:", () => { }); it("async matchers - not", async () => { - var badness = new Error("badness"); - var malady = new Error("malady"); + const badness = new Error("badness"); + const malady = new Error("malady"); await expectAsync(Promise.reject(badness)).not.toBeResolved(); await expectAsync(Promise.resolve(true)).not.toBeResolvedTo(false); await expectAsync(Promise.resolve()).not.toBeRejected(); @@ -198,7 +199,7 @@ describe("Included matchers:", () => { describe("toThrowMatching", () => { expect(() => { ({} as any).doSomething(); - }).toThrowMatching(error => error != undefined); + }).toThrowMatching(error => error !== undefined); }); describe("toBeNegativeInfinity", () => { @@ -306,7 +307,6 @@ xdescribe("A spec", () => { }); describe("Pending specs", () => { - xit("can be declared 'xit'", () => { expect(true).toBe(false); }); @@ -358,7 +358,7 @@ describe("A spy", () => { expect(bar).toBeNull(); }); - it("tracks if it was called at all", function () { + it("tracks if it was called at all", function() { foo.setBar(); expect(foo.setBar.calls.any()).toEqual(true); @@ -767,17 +767,15 @@ describe("Multiple spies, when created manually", () => { it("read isPlaying property", () => { expect(tape.isPlaying).toBe(false); - }) + }); }); describe("multiple spies, when created with spyOnAllFunctions", () => { - it("spies on all functions", () => { - const obj = { x: (a: number) => a, y: (a: number) => a, - } + }; spyOnAllFunctions(obj); @@ -809,7 +807,7 @@ describe("jasmine.any", () => { const a: Test = { fn1: () => { }, - fn2: (param1: number) => { return param1; }, + fn2: (param1: number) => param1, }; const expected: Test = { @@ -822,7 +820,7 @@ describe("jasmine.any", () => { describe("when used with a spy", () => { it("is useful for comparing arguments", () => { - var foo = jasmine.createSpy('foo'); + const foo = jasmine.createSpy('foo'); foo(12, () => { return true; }); @@ -867,7 +865,7 @@ describe("jasmine.objectContaining", () => { describe("when used with a spy", () => { it("is useful for comparing arguments", () => { - var callback = jasmine.createSpy('callback'); + const callback = jasmine.createSpy('callback'); callback({ bar: "baz" @@ -884,7 +882,7 @@ describe("jasmine.objectContaining", () => { }); describe("jasmine.arrayContaining", () => { - var foo: Array; + var foo: number[]; beforeEach(() => { foo = [1, 2, 3, 4]; @@ -900,7 +898,7 @@ describe("jasmine.arrayContaining", () => { describe("when used with a spy", () => { it("is useful when comparing arguments", () => { - var callback = jasmine.createSpy('callback'); + const callback = jasmine.createSpy('callback'); callback([1, 2, 3, 4]); @@ -911,7 +909,7 @@ describe("jasmine.arrayContaining", () => { }); describe("jasmine.arrayWithExactContents", () => { - var foo: Array; + var foo: number[]; beforeEach(() => { foo = [1, 2, 3, 4]; @@ -927,7 +925,7 @@ describe("jasmine.arrayWithExactContents", () => { describe("when used with a spy", () => { it("is useful when comparing arguments", () => { - var callback = jasmine.createSpy('callback'); + const callback = jasmine.createSpy('callback'); callback([1, 2, 3, 4]); @@ -980,7 +978,7 @@ describe("Manually ticking the Jasmine Clock", () => { describe("Mocking the Date object", () => { it("mocks the Date object and sets it to a given time", () => { - var baseTime = new Date(2013, 9, 23); + const baseTime = new Date(2013, 9, 23); jasmine.clock().mockDate(baseTime); @@ -1020,11 +1018,9 @@ describe("Asynchronous specs", () => { done(); }, 1000); }); - }); describe("Fail", () => { - it("should fail test when called without arguments", () => { fail(); }); @@ -1036,12 +1032,11 @@ describe("Fail", () => { it("should fail test when called an error", () => { fail(new Error("The test failed with this error")); }); - }); // test based on http://jasmine.github.io/2.2/custom_equality.html describe("custom equality", () => { - var myCustomEquality: jasmine.CustomEqualityTester = function (first: any, second: any): boolean | void { + const myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean | void { if (typeof first === "string" && typeof second === "string") { return first[0] === second[1]; } @@ -1051,7 +1046,6 @@ describe("custom equality", () => { jasmine.addCustomEqualityTester(myCustomEquality); }); - it("should be custom equal", () => { expect("abc").toEqual("aaa"); }); @@ -1069,15 +1063,13 @@ var customMatchers: jasmine.CustomMatcherFactories = { if (expected === undefined) { expected = ''; } - var result: jasmine.CustomMatcherResult = { pass: false }; + const result: jasmine.CustomMatcherResult = { pass: false }; result.pass = util.equals(actual.hyuk, "gawrsh" + expected, customEqualityTesters); - if (result.pass) { - result.message = "Expected " + actual + " not to be quite so goofy"; - } else { - result.message = "Expected " + actual + " to be goofy, but it was not very goofy"; - } + result.message = result.pass ? + `Expected ${actual} not to be quite so goofy` : + `Expected ${actual} to be goofy, but it was not very goofy`; return result; } @@ -1110,8 +1102,8 @@ var customMatchers: jasmine.CustomMatcherFactories = { // } declare namespace jasmine { interface Matchers { - toBeGoofy(expected?: jasmine.Expected): boolean; - toBeWithinRange(expected?: jasmine.Expected, floor?: number, ceiling?: number): boolean; + toBeGoofy(expected?: Expected): boolean; + toBeWithinRange(expected?: Expected, floor?: number, ceiling?: number): boolean; } } @@ -1157,7 +1149,7 @@ describe("Custom matcher: 'toBeGoofy'", () => { const result = matcher.compare(actual, null); expect(result.pass).toBe(false); - expect(result.message).toBe("Expected " + actual + " to be goofy, but it was not very goofy"); + expect(result.message).toBe(`Expected ${actual} to be goofy, but it was not very goofy`); }); }); @@ -1168,16 +1160,16 @@ var myReporter: jasmine.CustomReporter = { }, suiteStarted: (result: jasmine.CustomReporterResult) => { - console.log("Suite started: " + result.description + " whose full description is: " + result.fullName); + console.log(`Suite started: ${result.description} whose full description is: ${result.fullName}`); }, specStarted: (result: jasmine.CustomReporterResult) => { - console.log("Spec started: " + result.description + " whose full description is: " + result.fullName); + console.log(`Spec started: ${result.description} whose full description is: ${result.fullName}`); }, specDone: (result: jasmine.CustomReporterResult) => { - console.log("Spec: " + result.description + " was " + result.status); - //tslint:disable-next-line:prefer-for-of + console.log(`Spec: ${result.description} was ${result.status}`); + // tslint:disable-next-line:prefer-for-of for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i += 1) { console.log("Failure: " + result.failedExpectations[i].message); console.log("Actual: " + result.failedExpectations[i].actual); @@ -1188,8 +1180,8 @@ var myReporter: jasmine.CustomReporter = { }, suiteDone: (result: jasmine.CustomReporterResult) => { - console.log('Suite: ' + result.description + ' was ' + result.status); - //tslint:disable-next-line:prefer-for-of + console.log(`Suite: ${result.description} was ${result.status}`); + // tslint:disable-next-line:prefer-for-of for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i += 1) { console.log('AfterAll ' + result.failedExpectations[i].message); console.log(result.failedExpectations[i].stack); @@ -1207,24 +1199,24 @@ jasmine.getEnv().addReporter(myReporter); describe("Randomize Tests", () => { it("should allow randomization of the order of tests", () => { expect(() => { - var env = jasmine.getEnv(); - return env.randomizeTests(true); + const env = jasmine.getEnv(); + env.randomizeTests(true); }).not.toThrow(); }); it("should allow a seed to be passed in for randomization", () => { expect(() => { - var env = jasmine.getEnv(); + const env = jasmine.getEnv(); env.randomizeTests(true); return env.seed(1234); }).not.toThrow(); }); }); -//dest spces copied from jasmine project (https://github.com/jasmine/jasmine/blob/master/spec/core/SpecSpec.js) -describe("createSpyObj", function () { - it("should create an object with spy methods and corresponding return values when you call jasmine.createSpyObj() with an object", function () { - var spyObj = jasmine.createSpyObj('BaseName', { 'method1': 42, 'method2': 'special sauce' }); +// Dest spces copied from jasmine project (https://github.com/jasmine/jasmine/blob/master/spec/core/SpecSpec.js) +describe("createSpyObj", function() { + it("should create an object with spy methods and corresponding return values when you call jasmine.createSpyObj() with an object", function() { + const spyObj = jasmine.createSpyObj('BaseName', {method1: 42, method2: 'special sauce'}); expect(spyObj.method1()).toEqual(42); expect(spyObj.method1.and.identity()).toEqual('BaseName.method1'); @@ -1233,17 +1225,16 @@ describe("createSpyObj", function () { expect(spyObj.method2.and.identity()).toEqual('BaseName.method2'); }); - - it("should create an object with a bunch of spy methods when you call jasmine.createSpyObj()", function () { - var spyObj = jasmine.createSpyObj('BaseName', ['method1', 'method2']); + it("should create an object with a bunch of spy methods when you call jasmine.createSpyObj()", function() { + const spyObj = jasmine.createSpyObj('BaseName', ['method1', 'method2']); expect(spyObj).toEqual({ method1: jasmine.any(Function), method2: jasmine.any(Function) }); expect(spyObj.method1.and.identity()).toEqual('BaseName.method1'); expect(spyObj.method2.and.identity()).toEqual('BaseName.method2'); }); - it("should allow you to omit the baseName and takes only an object", function () { - var spyObj = jasmine.createSpyObj({ 'method1': 42, 'method2': 'special sauce' }); + it("should allow you to omit the baseName and takes only an object", function() { + const spyObj = jasmine.createSpyObj({method1: 42, method2: 'special sauce'}); expect(spyObj.method1()).toEqual(42); expect(spyObj.method1.and.identity()).toEqual('unknown.method1'); @@ -1252,22 +1243,22 @@ describe("createSpyObj", function () { expect(spyObj.method2.and.identity()).toEqual('unknown.method2'); }); - it("should allow you to omit the baseName and takes only a list of methods", function () { - var spyObj = jasmine.createSpyObj(['method1', 'method2']); + it("should allow you to omit the baseName and takes only a list of methods", function() { + const spyObj = jasmine.createSpyObj(['method1', 'method2']); expect(spyObj).toEqual({ method1: jasmine.any(Function), method2: jasmine.any(Function) }); expect(spyObj.method1.and.identity()).toEqual('unknown.method1'); expect(spyObj.method2.and.identity()).toEqual('unknown.method2'); }); - it("should throw if you pass an empty array argument", function () { - expect(function () { + it("should throw if you pass an empty array argument", function() { + expect(function() { jasmine.createSpyObj('BaseName', []); }).toThrow("createSpyObj requires a non-empty array or object of method names to create spies for"); }); - it("should throw if you pass an empty object argument", function () { - expect(function () { + it("should throw if you pass an empty object argument", function() { + expect(function() { jasmine.createSpyObj('BaseName', {}); }).toThrow("createSpyObj requires a non-empty array or object of method names to create spies for"); }); @@ -1275,17 +1266,17 @@ describe("createSpyObj", function () { (() => { // from boot.js - var env = jasmine.getEnv(); + const env = jasmine.getEnv(); - var htmlReporter = new jasmine.HtmlReporter(); + const htmlReporter = new jasmine.HtmlReporter(); env.addReporter(htmlReporter); - var specFilter = new jasmine.HtmlSpecFilter(); + const specFilter = new jasmine.HtmlSpecFilter(); env.specFilter = (spec) => { return specFilter.matches(spec.getFullName()); }; - var currentWindowOnload = window.onload; + const currentWindowOnload = window.onload; window.onload = () => { if (currentWindowOnload) { (currentWindowOnload as any)(null); @@ -1293,7 +1284,6 @@ describe("createSpyObj", function () { htmlReporter.initialize(); env.execute(); }; - })(); jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; diff --git a/types/jasmine/tslint.json b/types/jasmine/tslint.json index 2daeb51ad8..c540ba0129 100644 --- a/types/jasmine/tslint.json +++ b/types/jasmine/tslint.json @@ -1,80 +1,13 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": true, - "eofline": false, - "export-just-namespace": false, - "file-name-casing": [true, "kebab-case"], - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "only-arrow-functions": false } } From 76eda5dc1b4792450ae1a0f5e53e810cf4d1a0d3 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 5 Jan 2019 11:40:02 -0500 Subject: [PATCH 086/646] Refactor GeoJSON to make Geometry = GeometryObject --- types/geojson/geojson-tests.ts | 28 +++++++++++++++++++++--- types/geojson/index.d.ts | 39 ++++++++++++++++------------------ 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index 4ea0f57a6f..2cb9fce33f 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -1,10 +1,11 @@ import { BBox, - Feature, FeatureCollection, GeometryCollection, LineString, - MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeometryObject + Feature, FeatureCollection, Geometry, GeometryCollection, LineString, + MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeoJsonGeometryTypes, + GeometryObject, GeoJsonProperties } from "geojson"; -let featureCollection: FeatureCollection = { +let featureCollection: FeatureCollection = { type: "FeatureCollection", features: [ { @@ -53,6 +54,11 @@ let featureCollection: FeatureCollection = { type: "Feature", bbox: [-180.0, -90.0, 180.0, 90.0], @@ -65,6 +71,11 @@ const featureWithPolygon: Feature = { properties: null }; +featureWithPolygon.type; // $ExpectType "Feature" +featureWithPolygon.geometry; // $ExpectType Polygon +featureWithPolygon.geometry.type; // $ExpectType "Polygon" +featureWithPolygon.geometry.coordinates; // $ExpectType number[][][] + const point: Point = { type: "Point", coordinates: [100.0, 0.0] @@ -135,6 +146,8 @@ let feature: Feature = { properties: null }; +feature.properties; // $ExpectType GeoJsonProperties + feature = { type: "Feature", geometry: polygon, @@ -275,12 +288,16 @@ const featureGeometryNull: Feature = { geometry: null }; +featureGeometryNull.properties.foo; // $ExpectType "bar" | "baz" + const featureNoNull: Feature = { type: "Feature", properties: testProps, geometry: point }; +featureNoNull.geometry.type; // $ExpectType "Point" + const collectionAllNull: FeatureCollection = { type: "FeatureCollection", features: [featureAllNull], @@ -301,6 +318,8 @@ const collectionGeometryMaybeNull: FeatureCollection features: [featureGeometryNull, featureNoNull], }; +collectionGeometryMaybeNull.features[0].geometry; // $ExpectType Point | null + const collectionNoNull: FeatureCollection = { type: "FeatureCollection", features: [featureNoNull], @@ -311,6 +330,9 @@ const collectionDefault: FeatureCollection = { features: [] }; +collectionDefault.features[0].geometry; // $ExpectType Geometry +collectionDefault.features[0].properties!.foo; // $ExpectType any + isNull = featureAllNull.geometry; isPoint = featurePropertyNull.geometry; isNull = featureAllNull.properties; diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index 93f66d3f27..db8074e242 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -4,6 +4,7 @@ // Arne Schubert // Jeff Jacobson // Ilia Choly +// Dan Vanderkam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -16,14 +17,13 @@ export as namespace GeoJSON; * The valid values for the "type" property of GeoJSON geometry objects. * https://tools.ietf.org/html/rfc7946#section-1.4 */ -export type GeoJsonGeometryTypes = "Point" | "LineString" | "MultiPoint" | "Polygon" | "MultiLineString" | - "MultiPolygon" | "GeometryCollection"; +export type GeoJsonGeometryTypes = Geometry['type']; /** * The value values for the "type" property of GeoJSON Objects. * https://tools.ietf.org/html/rfc7946#section-1.4 */ -export type GeoJsonTypes = "FeatureCollection" | "Feature" | GeoJsonGeometryTypes; +export type GeoJsonTypes = GeoJSON['type']; /** * Bounding box @@ -58,6 +58,10 @@ export interface GeoJsonObject { type: GeoJsonTypes; /** * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. + * The value of the bbox member is an array of length 2*n where n is the number of dimensions + * represented in the contained geometries, with all axes of the most southwesterly point + * followed by all axes of the more northeasterly point. + * The axes order of a bbox follows the axes order of geometries. * https://tools.ietf.org/html/rfc7946#section-5 */ bbox?: BBox; @@ -69,24 +73,17 @@ export interface GeoJsonObject { export type GeoJSON = Geometry | Feature | FeatureCollection; /** - * A geometry object. - * https://tools.ietf.org/html/rfc7946#section-3 - */ -export interface GeometryObject extends GeoJsonObject { - type: GeoJsonGeometryTypes; -} - -/** - * Union of geometry objects. + * Geometry object. * https://tools.ietf.org/html/rfc7946#section-3 */ export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection; +export type GeometryObject = Geometry; /** * Point geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.2 */ -export interface Point extends GeometryObject { +export interface Point extends GeoJsonObject { type: "Point"; coordinates: Position; } @@ -95,7 +92,7 @@ export interface Point extends GeometryObject { * MultiPoint geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.3 */ -export interface MultiPoint extends GeometryObject { +export interface MultiPoint extends GeoJsonObject { type: "MultiPoint"; coordinates: Position[]; } @@ -104,7 +101,7 @@ export interface MultiPoint extends GeometryObject { * LineString geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.4 */ -export interface LineString extends GeometryObject { +export interface LineString extends GeoJsonObject { type: "LineString"; coordinates: Position[]; } @@ -113,7 +110,7 @@ export interface LineString extends GeometryObject { * MultiLineString geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.5 */ -export interface MultiLineString extends GeometryObject { +export interface MultiLineString extends GeoJsonObject { type: "MultiLineString"; coordinates: Position[][]; } @@ -122,7 +119,7 @@ export interface MultiLineString extends GeometryObject { * Polygon geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.6 */ -export interface Polygon extends GeometryObject { +export interface Polygon extends GeoJsonObject { type: "Polygon"; coordinates: Position[][]; } @@ -131,7 +128,7 @@ export interface Polygon extends GeometryObject { * MultiPolygon geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.7 */ -export interface MultiPolygon extends GeometryObject { +export interface MultiPolygon extends GeoJsonObject { type: "MultiPolygon"; coordinates: Position[][][]; } @@ -140,7 +137,7 @@ export interface MultiPolygon extends GeometryObject { * Geometry Collection * https://tools.ietf.org/html/rfc7946#section-3.1.8 */ -export interface GeometryCollection extends GeometryObject { +export interface GeometryCollection extends GeoJsonObject { type: "GeometryCollection"; geometries: Geometry[]; } @@ -151,7 +148,7 @@ export type GeoJsonProperties = { [name: string]: any; } | null; * A feature object which contains a geometry and associated properties. * https://tools.ietf.org/html/rfc7946#section-3.2 */ -export interface Feature extends GeoJsonObject { +export interface Feature extends GeoJsonObject { type: "Feature"; /** * The feature's geometry @@ -172,7 +169,7 @@ export interface Feature extends GeoJsonObject { +export interface FeatureCollection extends GeoJsonObject { type: "FeatureCollection"; features: Array>; } From 2d45354af5d3d536b873104151f0c993c6257eff Mon Sep 17 00:00:00 2001 From: Dominic Fallows Date: Sat, 5 Jan 2019 16:59:47 +0000 Subject: [PATCH 087/646] Export `BaseLine` to fix `cannot be named ts4023` Export the `BaseLine` interface to fix TS `cannot be named errors`, for example: ```bash Exported variable 'scale' has or is using name 'BaseLine' from external module "node_modules/@types/typography/index" but cannot be named.ts(4023) ``` --- types/typography/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/typography/index.d.ts b/types/typography/index.d.ts index 457d2f4b45..75b70dced6 100644 --- a/types/typography/index.d.ts +++ b/types/typography/index.d.ts @@ -2,10 +2,11 @@ // Project: https://github.com/KyleAMathews/typography.js // Definitions by: Boye // Krzysztof Żuraw +// Dominic Fallows // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -interface BaseLine { +export interface BaseLine { fontSize: string; lineHeight: string; } From 58e01e780d39cf25fd5a9241b9d271b4e035f3a2 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 5 Jan 2019 16:26:04 -0500 Subject: [PATCH 088/646] Add test for type aliases --- types/geojson/geojson-tests.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index 2cb9fce33f..20d058b2dc 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -1,8 +1,7 @@ import { - BBox, - Feature, FeatureCollection, Geometry, GeometryCollection, LineString, + Feature, FeatureCollection, GeometryCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeoJsonGeometryTypes, - GeometryObject, GeoJsonProperties + GeoJsonTypes, GeometryObject } from "geojson"; let featureCollection: FeatureCollection = { @@ -59,6 +58,9 @@ featureCollection.features[0].type; // $ExpectType "Feature" featureCollection.features[0].geometry; // $ExpectType Geometry featureCollection.features[0].geometry.type; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" +declare let tg: GeoJsonGeometryTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" +declare let t: GeoJsonTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" | "Feature" | "FeatureCollection" + const featureWithPolygon: Feature = { type: "Feature", bbox: [-180.0, -90.0, 180.0, 90.0], From 4103015e81f58f9e90231009c61087b49ba3ce07 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 5 Jan 2019 21:42:50 -0500 Subject: [PATCH 089/646] rework test --- types/geojson/geojson-tests.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index 20d058b2dc..6c83334d15 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -58,8 +58,10 @@ featureCollection.features[0].type; // $ExpectType "Feature" featureCollection.features[0].geometry; // $ExpectType Geometry featureCollection.features[0].geometry.type; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" -declare let tg: GeoJsonGeometryTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" -declare let t: GeoJsonTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" | "Feature" | "FeatureCollection" +function testLiteralTypes(geojsonTypes: GeoJsonTypes, geometryTypes: GeoJsonGeometryTypes) { + geometryTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" + geojsonTypes; // $ExpectType "FeatureCollection" | "Feature" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" +} const featureWithPolygon: Feature = { type: "Feature", From f991d75a0a03c82e6aaed1acda8580e278f3c39e Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 5 Jan 2019 21:51:54 -0500 Subject: [PATCH 090/646] simplify test --- types/geojson/geojson-tests.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index 6c83334d15..82787c8c36 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -58,10 +58,11 @@ featureCollection.features[0].type; // $ExpectType "Feature" featureCollection.features[0].geometry; // $ExpectType Geometry featureCollection.features[0].geometry.type; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" -function testLiteralTypes(geojsonTypes: GeoJsonTypes, geometryTypes: GeoJsonGeometryTypes) { - geometryTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" - geojsonTypes; // $ExpectType "FeatureCollection" | "Feature" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" -} +declare let geometryTypes: GeoJsonGeometryTypes; +geometryTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" + +declare let geojsonTypes: GeoJsonTypes; +geojsonTypes; // $ExpectType "FeatureCollection" | "Feature" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" const featureWithPolygon: Feature = { type: "Feature", From e6873eba9f250c2d2026d8fd05804e866ef8ebeb Mon Sep 17 00:00:00 2001 From: mAAdhaTTah Date: Sat, 5 Jan 2019 22:02:48 -0500 Subject: [PATCH 091/646] Improve kefir types Add proper type refinement to the `filter` method. Combine the operators on the base Observable class. Add staticLand exports. Add default export. --- types/kefir/index.d.ts | 335 +++++++++++++++++++------------------ types/kefir/kefir-tests.ts | 11 +- 2 files changed, 177 insertions(+), 169 deletions(-) diff --git a/types/kefir/index.d.ts b/types/kefir/index.d.ts index e892e1b291..05fd7a7aab 100644 --- a/types/kefir/index.d.ts +++ b/types/kefir/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Kefir 3.7.3 +// Type definitions for Kefir 3.8.0 // Project: http://rpominov.github.io/kefir/ // Definitions by: Aya Morisawa // Piotr Hitori Bosak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.7 /// @@ -11,7 +11,7 @@ export type ValueOfAnObservable> = T['']; export interface Subscription { unsubscribe(): void; - closed: boolean; // Actually, `readonly` but it's avaiable in tsc starting with 2.0.0 + readonly closed: boolean; } export interface Observer { @@ -20,21 +20,24 @@ export interface Observer { end?: () => void; } -export interface Subscription { - unsubscribe(): void; - closed: boolean; // Actually, `readonly` but it's avaiable in tsc starting with 2.0.0 +interface ESObserver { + start?: Function, + next?: (value: T) => any, + error?: (error: S) => any, + complete?: () => any, } -export interface Observer { - value?: (value: T) => void; - error?: (error: S) => void; - end?: () => void; +interface ESObservable { + subscribe(callbacks: ESObserver): { unsubscribe(): void }; } -export interface Observable { +export class Observable { '': T; // TypeScript hack to enable value unwrapping for combine/flatMap - toProperty(getCurrent?: () => T): Property; + toProperty(): Property; + toProperty(getCurrent?: () => T2): Property; + changes(): Observable; + // Subscribe / add side effects onValue(callback: (value: T) => void): this; offValue(callback: (value: T) => void): this; @@ -42,8 +45,8 @@ export interface Observable { offError(callback: (error: S) => void): this; onEnd(callback: () => void): this; offEnd(callback: () => void): this; - onAny(callback: (event: Event) => void): this; - offAny(callback: (event: Event) => void): this; + onAny(callback: (event: Event) => void): this; + offAny(callback: (event: Event) => void): this; log(name?: string): this; spy(name?: string): this; offLog(name?: string): this; @@ -51,7 +54,7 @@ export interface Observable { flatten(transformer?: (value: T) => U[]): Stream; toPromise(): Promise; toPromise>(PromiseConstructor: () => W): W; - toESObservable(): any; + toESObservable(): ESObservable; // This method is designed to replace all other methods for subscribing observe(params: Observer): Subscription; observe( @@ -61,172 +64,174 @@ export interface Observable { ): Subscription; setName(source: Observable, selfName: string): this; setName(selfName: string): this; -} -export interface Stream extends Observable { + thru(cb: (obs: Observable) => Observable): Observable; // Modify an stream - map(fn: (value: T) => U): Stream; - filter(predicate?: (value: T) => boolean): Stream; - take(n: number): Stream; - takeWhile(predicate?: (value: T) => boolean): Stream; - last(): Stream; - skip(n: number): Stream; - skipWhile(predicate?: (value: T) => boolean): Stream; - skipDuplicates(comparator?: (a: T, b: T) => boolean): Stream; - diff(fn?: (prev: T, next: T) => T, seed?: T): Stream; - scan(fn: (prev: T | W, next: T) => W): Stream; - scan(fn: (prev: W, next: T) => W, seed: W): Stream; - delay(wait: number): Stream; - throttle(wait: number, options?: { leading?: boolean, trailing?: boolean }): Stream; - debounce(wait: number, options?: { immediate: boolean }): Stream; - valuesToErrors(): Stream; - valuesToErrors(handler: (value: T) => { convert: boolean, error: U }): Stream; - errorsToValues(handler?: (error: S) => { convert: boolean, value: U }): Stream; - mapErrors(fn: (error: S) => U): Stream; - filterErrors(predicate?: (error: S) => boolean): Stream; - endOnError(): Stream; - takeErrors(n: number): Stream; - ignoreValues(): Stream; - ignoreErrors(): Stream; - ignoreEnd(): Stream; - beforeEnd(fn: () => U): Stream; - slidingWindow(max: number, mix?: number): Stream; - bufferWhile(predicate: (value: T) => boolean): Stream; - bufferWithCount(count: number, options?: { flushOnEnd: boolean }): Stream; - bufferWithTimeOrCount(interval: number, count: number, options?: { flushOnEnd: boolean }): Stream; - transduce(transducer: any): Stream; - withHandler(handler: (emitter: Emitter, event: Event) => void): Stream; + map(fn: (value: T) => U): Observable; + filter(fn: (value: T) => value is U): Observable + filter(predicate?: (value: T) => boolean): Observable; + take(n: number): Observable; + takeWhile(predicate?: (value: T) => boolean): Observable; + last(): Observable; + skip(n: number): Observable; + skipWhile(predicate?: (value: T) => boolean): Observable; + skipDuplicates(comparator?: (a: T, b: T) => boolean): Observable; + diff(fn?: (prev: T, next: T) => T, seed?: T): Observable; + scan(fn: (prev: T | W, next: T) => W): Observable; + scan(fn: (prev: W, next: T) => W, seed: W): Observable; + delay(wait: number): Observable; + throttle(wait: number, options?: { leading?: boolean, trailing?: boolean }): Observable; + debounce(wait: number, options?: { immediate: boolean }): Observable; + valuesToErrors(): Observable; + valuesToErrors(handler: (value: T) => { convert: boolean, error: U }): Observable; + errorsToValues(handler?: (error: S) => { convert: boolean, value: U }): Observable; + mapErrors(fn: (error: S) => U): Observable; + filterErrors(predicate?: (error: S) => boolean): Observable; + endOnError(): Observable; + takeErrors(n: number): Observable; + ignoreValues(): Observable; + ignoreErrors(): Observable; + ignoreEnd(): Observable; + beforeEnd(fn: () => U): Observable; + slidingWindow(max: number, mix?: number): Observable; + bufferWhile(predicate: (value: T) => boolean): Observable; + bufferWithCount(count: number, options?: { flushOnEnd: boolean }): Observable; + bufferWithTimeOrCount(interval: number, count: number, options?: { flushOnEnd: boolean }): Observable; + transduce(transducer: any): Observable; + withHandler(handler: (emitter: Emitter, event: Event) => void): Observable; // Combine streams - combine(otherObs: Stream, combinator?: (value: T, ...values: U[]) => W): Stream; - zip(otherObs: Stream, combinator?: (value: T, ...values: U[]) => W): Stream; - merge(otherObs: Stream): Stream; - concat(otherObs: Stream): Stream; - flatMap(transform: (value: T) => Stream): Stream; - flatMap>(): Stream, any>; - flatMapLatest(fn: (value: T) => Stream): Stream; - flatMapLatest>(): Stream, any>; - flatMapFirst(fn: (value: T) => Stream): Stream; - flatMapFirst>(): Stream, any>; - flatMapConcat(fn: (value: T) => Stream): Stream; - flatMapConcat>(): Stream, any>; - flatMapConcurLimit(fn: (value: T) => Stream, limit: number): Stream; - flatMapErrors(transform: (error: S) => Stream): Stream; + combine(otherObs: Observable, combinator?: (value: T, ...values: U[]) => W): Observable; + zip(otherObs: Observable, combinator?: (value: T, ...values: U[]) => W): Observable; + merge(otherObs: Observable): Observable; + concat(otherObs: Observable): Observable; + flatMap(transform: (value: T) => Observable): Observable; + flatMap>(): Observable, any>; + flatMapLatest(fn: (value: T) => Observable): Observable; + flatMapLatest>(): Observable, any>; + flatMapFirst(fn: (value: T) => Observable): Observable; + flatMapFirst>(): Observable, any>; + flatMapConcat(fn: (value: T) => Observable): Observable; + flatMapConcat>(): Observable, any>; + flatMapConcurLimit(fn: (value: T) => Observable, limit: number): Observable; + flatMapErrors(transform: (error: S) => Observable): Observable; // Combine two streams - filterBy(otherObs: Observable): Stream; - sampledBy(otherObs: Observable, combinator?: (a: T, b: U) => W): Stream; - skipUntilBy(otherObs: Observable): Stream; - takeUntilBy(otherObs: Observable): Stream; - bufferBy(otherObs: Observable, options?: { flushOnEnd: boolean }): Stream; - bufferWhileBy(otherObs: Observable, options?: { flushOnEnd?: boolean, flushOnChange?: boolean }): Stream; - awaiting(otherObs: Observable): Stream; + filterBy(otherObs: Observable): Observable; + sampledBy(otherObs: Observable): Observable; + sampledBy(otherObs: Observable, combinator: (a: T, b: U) => W): Observable; + skipUntilBy(otherObs: Observable): Observable; + takeUntilBy(otherObs: Observable): Observable; + bufferBy(otherObs: Observable, options?: { flushOnEnd: boolean }): Observable; + bufferWhileBy(otherObs: Observable, options?: { flushOnEnd?: boolean, flushOnChange?: boolean }): Observable; + awaiting(otherObs: Observable): Observable; } -export interface Property extends Observable { - changes(): Stream; - // Modify an property - map(fn: (value: T) => U): Property; - filter(predicate?: (value: T) => boolean): Property; - take(n: number): Property; - takeWhile(predicate?: (value: T) => boolean): Property; - last(): Property; - skip(n: number): Property; - skipWhile(predicate?: (value: T) => boolean): Property; - skipDuplicates(comparator?: (a: T, b: T) => boolean): Property; - diff(fn?: (prev: T, next: T) => T, seed?: T): Property; - scan(fn: (prev: T, next: T) => T, seed?: T): Property; - delay(wait: number): Property; - throttle(wait: number, options?: { leading?: boolean, trailing?: boolean }): Property; - debounce(wait: number, options?: { immediate: boolean }): Property; - valuesToErrors(handler?: (value: T) => { convert: boolean, error: U }): Property; - errorsToValues(handler?: (error: S) => { convert: boolean, value: U }): Property; - mapErrors(fn: (error: S) => U): Property; - filterErrors(predicate?: (error: S) => boolean): Property; - endOnError(): Property; - takeErrors(n: number): Stream; - ignoreValues(): Property; - ignoreErrors(): Property; - ignoreEnd(): Property; - beforeEnd(fn: () => U): Property; - slidingWindow(max: number, mix?: number): Property; - bufferWhile(predicate: (value: T) => boolean): Property; - bufferWithCount(count: number, options?: { flushOnEnd: boolean }): Property; - bufferWithTimeOrCount(interval: number, count: number, options?: { flushOnEnd: boolean }): Property; - transduce(transducer: any): Property; - withHandler(handler: (emitter: Emitter, event: Event) => void): Property; - // Combine properties - combine(otherObs: Property, combinator?: (value: T, ...values: U[]) => W): Property; - zip(otherObs: Property, combinator?: (value: T, ...values: U[]) => W): Property; - merge(otherObs: Property): Property; - concat(otherObs: Property): Property; - flatMap(transform: (value: T) => Property): Property; - flatMap>(): Property, any>; - flatMapLatest(fn: (value: T) => Property): Property; - flatMapLatest>(): Property, any>; - flatMapFirst(fn: (value: T) => Property): Property; - flatMapFirst>(): Property, any>; - flatMapConcat(fn: (value: T) => Property): Property; - flatMapConcurLimit(fn: (value: T) => Property, limit: number): Property; - flatMapErrors(transform: (error: S) => Property): Property; - // Combine two properties - filterBy(otherObs: Observable): Property; - sampledBy(otherObs: Observable, combinator?: (a: T, b: U) => W): Property; - skipUntilBy(otherObs: Observable): Property; - takeUntilBy(otherObs: Observable): Property; - bufferBy(otherObs: Observable, options?: { flushOnEnd: boolean }): Property; - bufferWhileBy(otherObs: Observable, options?: { flushOnEnd?: boolean, flushOnChange?: boolean }): Property; - awaiting(otherObs: Observable): Property; +export class Stream extends Observable { + } -export interface ObservablePool extends Observable { +export class Property extends Observable { + +} + +export class Pool extends Observable { plug(obs: Observable): this; - unPlug(obs: Observable): this; + unplug(obs: Observable): this; } -export interface Event { - type: string; - value: T; -} +export type Event = + { type: 'value', value: V } | + { type: 'error', value: E } | + { type: 'end', value: void }; -export interface Emitter { - emit(value: T): void; - error(error: S): void; +export interface Emitter { + value(value: V): boolean; + event(event: Event): boolean; + error(e: E): boolean; end(): void; - emitEvent(event: { type: string, value: T | S }): void; + + // Deprecated methods + emit(value: V): boolean; + emitEvent(event: Event): boolean; } // Create a stream -export declare function never(): Stream; -export declare function later(wait: number, value: T): Stream; -export declare function interval(interval: number, value: T): Stream; -export declare function sequentially(interval: number, values: T[]): Stream; -export declare function fromPoll(interval: number, fn: () => T): Stream; -export declare function withInterval(interval: number, handler: (emitter: Emitter) => void): Stream; -export declare function fromCallback(fn: (callback: (value: T) => void) => void): Stream; -export declare function fromNodeCallback(fn: (callback: (error: S, result: T) => void) => void): Stream; -export declare function fromEvents(target: EventTarget | NodeJS.EventEmitter | { on: Function, off: Function }, eventName: string, transform?: (value: T) => S): Stream; -export declare function stream(subscribe: (emitter: Emitter) => Function | void): Stream; -export declare function fromESObservable(observable: any): Stream +export function never(): Stream; +export function later(wait: number, value: T): Stream; +export function interval(interval: number, value: T): Stream; +export function sequentially(interval: number, values: T[]): Stream; +export function fromPoll(interval: number, fn: () => T): Stream; +export function withInterval(interval: number, handler: (emitter: Emitter) => void): Stream; +export function fromCallback(fn: (callback: (value: T) => void) => void): Stream; +export function fromNodeCallback(fn: (callback: (error: S, result: T) => void) => void): Stream; +export function fromEvents(target: EventTarget | NodeJS.EventEmitter | { on: Function, off: Function }, eventName: string, transform?: (value: T) => S): Stream; +export function stream(subscribe: (emitter: Emitter) => Function | void): Stream; +export function fromESObservable(observable: any): Stream // Create a property -export declare function constant(value: T): Property; -export declare function constantError(error: T): Property; -export declare function fromPromise(promise: Promise): Property; +export function constant(value: T): Property; +export function constantError(error: T): Property; +export function fromPromise(promise: Promise): Property; // Combine observables -export declare function combine(obss: Observable[], passiveObss: Observable[], combinator?: (...values: T[]) => U): Stream; -export declare function combine(obss: Observable[], combinator: (...values: T[]) => U): Stream; -export declare function combine }>(obss: T): Stream<{ [P in keyof T]: ValueOfAnObservable }, any>; -export declare function combine], P extends keyof T>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine]>(obss: T): Stream<[ValueOfAnObservable], any>; -export declare function combine(obss: T): Stream; -export declare function zip(obss: Observable[], passiveObss?: Observable[], combinator?: (...values: T[]) => U): Observable; -export declare function merge(obss: Observable[]): Observable; -export declare function concat(obss: Observable[]): Observable; -export declare function pool(): ObservablePool; -export declare function repeat(generator: (i: number) => Observable | boolean): Observable; +export function combine(obss: Observable[], passiveObss: Observable[], combinator?: (...values: T[]) => U): Stream; +export function combine(obss: Observable[], combinator: (...values: T[]) => U): Stream; +export function combine }>(obss: T): Stream<{ [P in keyof T]: ValueOfAnObservable }, any>; +export function combine], P extends keyof T>(obss: T): Stream<[ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine]>(obss: T): Stream<[ValueOfAnObservable], any>; +export function combine(obss: T): Stream; +export function combine], P extends [Observable], K>(obss: T, obssP: P, combinator: (a: T[0][''], b: P[0]['']) => K): Observable; +export function zip(obss: Observable[], passiveObss?: Observable[], combinator?: (...values: T[]) => U): Observable; +export function merge(obss: Observable[]): Observable; +export function concat(obss: Observable[]): Observable; +export function pool(): Pool; +export function repeat(generator: (i: number) => Observable | boolean): Observable; + +export var staticLand: { + Observable: { + ap(obsF: Observable<(x: A) => B, E1>, obsV: Observable): Observable; + bimap(fnE: (x: E1) => E2, fnV: (x: V1) => V2, obs: Observable): Observable; + chain(cb: (value: V) => Observable, s: Observable): Observable; + concat(obs1: Observable, obs2: Observable): Observable; + empty(): Observable; + map(cb: (value: V) => V2, s: Observable): Observable; + of(value: V): Observable; + } +} + +declare var kefir: { + Observable: typeof Observable; + Pool: typeof Pool; + Stream: typeof Stream; + Property: typeof Property; + + never: typeof never, + later: typeof later, + interval: typeof interval, + sequentially: typeof sequentially, + fromPoll: typeof fromPoll, + withInterval: typeof withInterval, + fromCallback: typeof fromCallback, + fromNodeCallback: typeof fromNodeCallback, + fromEvents: typeof fromEvents, + stream: typeof stream, + fromESObservable: typeof fromESObservable, + constant: typeof constant, + constantError: typeof constantError, + fromPromise: typeof fromPromise, + combine: typeof combine, + zip: typeof zip, + merge: typeof merge, + concat: typeof concat, + pool: typeof pool, + repeat: typeof repeat, + + staticLand: typeof staticLand +}; + +export default kefir; diff --git a/types/kefir/kefir-tests.ts b/types/kefir/kefir-tests.ts index d2dbd5835e..0fba9c5d21 100644 --- a/types/kefir/kefir-tests.ts +++ b/types/kefir/kefir-tests.ts @@ -1,6 +1,6 @@ import * as Kefir from 'kefir'; -import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'kefir'; +import { Observable, Pool, Stream, Property, Event, Emitter } from 'kefir'; //Create a stream { @@ -130,7 +130,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke var myTransducer: any; let observable28: Stream = Kefir.sequentially(100, [1, 2, 3, 4, 5, 6]).transduce(myTransducer); } - let observable28: Stream = Kefir.sequentially(100, [0, 1, 2, 3]).withHandler((emitter: Emitter, event: Event) => { + let observable28: Stream = Kefir.sequentially(100, [0, 1, 2, 3]).withHandler((emitter: Emitter, event: Event) => { if (event.type === 'end') { emitter.emit('bye'); emitter.end(); @@ -141,6 +141,9 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke } } }); + type First = 'first'; + type Second = 'second'; + let observable32: Stream = Kefir.sequentially(100, ['first', 'second']).filter((value): value is First => value === 'first'); } // Combine observables @@ -177,7 +180,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke let a: Stream = Kefir.sequentially(100, [0, 1, 2]); let b: Stream = Kefir.sequentially(100, [0, 1, 2]).delay(30); let c: Observable = Kefir.sequentially(100, [0, 1, 2]).delay(60); - let pool: ObservablePool = Kefir.pool(); + let pool: Pool = Kefir.pool(); pool.plug(a); pool.plug(b); pool.plug(c); @@ -207,7 +210,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke { let a: Property = Kefir.sequentially(200, [2, 3]).toProperty(() => 1); let b: Stream = Kefir.interval(100, 0).delay(40).take(5); - let observable02: Property = a.sampledBy(b) + let observable02: Property = a.sampledBy(b) } { let foo: Stream = Kefir.sequentially(100, [1, 2, 3, 4]); From d1023c2e81c99e0c5dd540c600e1104e2db27266 Mon Sep 17 00:00:00 2001 From: Zhicheng WANG Date: Sun, 6 Jan 2019 11:36:19 +0800 Subject: [PATCH 092/646] fix: add parameter `HTMLParser` to makeMarkdown --- types/showdown/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index 21075fd6c7..f98c2c4692 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -296,11 +296,12 @@ declare namespace Showdown { /** * Converts an HTML string into a markdown string - * + * * @param src The input text (HTML) + * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used. * @returns The output markdown */ - makeMarkdown(src: string): string; + makeMarkdown(src: string, HTMLParser?: HTMLDocument): string; /** * Setting a "local" option only affects the specified Converter object. From 15f532b2e5b7c3021e02de667aea632f81e9419f Mon Sep 17 00:00:00 2001 From: Mihail Novikov Date: Sun, 6 Jan 2019 12:10:16 +0300 Subject: [PATCH 093/646] [@types/react-simple-maps] Fix types --- types/react-simple-maps/index.d.ts | 55 ++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/types/react-simple-maps/index.d.ts b/types/react-simple-maps/index.d.ts index cb146c372f..c73321f9a1 100644 --- a/types/react-simple-maps/index.d.ts +++ b/types/react-simple-maps/index.d.ts @@ -6,8 +6,34 @@ import * as React from 'react'; +interface ZoomableProps { + center?: Point; + zoom?: number; + disablePanning?: boolean; + style?: React.CSSProperties; + width?: number; + height?: number; + onMoveStart?: (currentCenter: Point) => void; + onMoveEnd?: (newCenter: Point) => void; +} + +interface Events { + onClick?: (geography: object, evt: React.MouseEvent) => void; + onMouseEnter?: (geography: object, evt: React.MouseEvent) => void; + onMouseMove?: (geography: object, evt: React.MouseEvent) => void; + onMouseLeave?: (geography: object, evt: React.MouseEvent) => void; + onMouseDown?: (geography: object, evt: React.MouseEvent) => void; + onMouseUp?: (geography: object, evt: React.MouseEvent) => void; + onFocus?: (geography: object, evt: React.FocusEvent) => void; + onBlur?: (geography: object, evt: React.FocusEvent) => void; +} + export type Point = [number, number]; +export type MarkerType = { + coordinates: Point; +}; + export interface Line { coordinates: { start: Point; @@ -28,18 +54,21 @@ export interface ComposableMapProps { }; style?: React.CSSProperties; defs?: SVGDefsElement; + className?: string; + showCenter?: boolean; + preserveAspectRatio?: string; + viewBox?: string; } -export interface ZoomableProps { - zoom?: number; - center?: Point; - style?: React.CSSProperties; - onMoveStart?: (currentCenter: Point) => void; - onMoveEnd?: (newCenter: Point) => void; +export interface ZoomableGlobeProps extends ZoomableProps { + sensitivity?: number; } export interface ZoomableGroupProps extends ZoomableProps { - disablePanning?: boolean; + backdrop?: { + x: Point; + y: Point; + }; } export interface GeographiesProps { @@ -48,7 +77,7 @@ export interface GeographiesProps { children?: (geographies: object[], projection: (point: Point) => void) => void; } -export interface GeographyProps { +export interface GeographyProps extends Events { cacheId?: number | string | null; precision?: number; round?: boolean; @@ -62,10 +91,8 @@ export interface GeographyProps { }; } -export interface MarkerProps { - marker?: { - coordinates: Point; - }; +export interface MarkerProps extends Events { + marker?: MarkerType; tabable?: boolean; style?: { default?: React.CSSProperties; @@ -99,7 +126,7 @@ export interface GraticuleProps { Globe?: boolean; } -export interface LineProps { +export interface LineProps extends Events { line?: Line; tabable?: boolean; style?: { @@ -113,7 +140,7 @@ export interface LineProps { export class ComposableMap extends React.Component {} export class ZoomableGroup extends React.Component {} -export class ZoomableGlobe extends React.Component {} +export class ZoomableGlobe extends React.Component {} export class Geographies extends React.Component {} export class Geography extends React.Component {} export class Markers extends React.Component {} From 7524d5a22b103d5b2cda214c10806759f04093d0 Mon Sep 17 00:00:00 2001 From: Mihail Novikov Date: Sun, 6 Jan 2019 12:16:24 +0300 Subject: [PATCH 094/646] [@types/react-simple-maps] Fix types --- types/react-simple-maps/index.d.ts | 41 ++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/types/react-simple-maps/index.d.ts b/types/react-simple-maps/index.d.ts index c73321f9a1..06cb7bc09a 100644 --- a/types/react-simple-maps/index.d.ts +++ b/types/react-simple-maps/index.d.ts @@ -17,17 +17,6 @@ interface ZoomableProps { onMoveEnd?: (newCenter: Point) => void; } -interface Events { - onClick?: (geography: object, evt: React.MouseEvent) => void; - onMouseEnter?: (geography: object, evt: React.MouseEvent) => void; - onMouseMove?: (geography: object, evt: React.MouseEvent) => void; - onMouseLeave?: (geography: object, evt: React.MouseEvent) => void; - onMouseDown?: (geography: object, evt: React.MouseEvent) => void; - onMouseUp?: (geography: object, evt: React.MouseEvent) => void; - onFocus?: (geography: object, evt: React.FocusEvent) => void; - onBlur?: (geography: object, evt: React.FocusEvent) => void; -} - export type Point = [number, number]; export type MarkerType = { @@ -77,7 +66,7 @@ export interface GeographiesProps { children?: (geographies: object[], projection: (point: Point) => void) => void; } -export interface GeographyProps extends Events { +export interface GeographyProps { cacheId?: number | string | null; precision?: number; round?: boolean; @@ -89,9 +78,17 @@ export interface GeographyProps extends Events { hover?: React.CSSProperties; pressed?: React.CSSProperties; }; + onClick?: (geography: object, evt: React.MouseEvent) => void; + onMouseEnter?: (geography: object, evt: React.MouseEvent) => void; + onMouseMove?: (geography: object, evt: React.MouseEvent) => void; + onMouseLeave?: (geography: object, evt: React.MouseEvent) => void; + onMouseDown?: (geography: object, evt: React.MouseEvent) => void; + onMouseUp?: (geography: object, evt: React.MouseEvent) => void; + onFocus?: (geography: object, evt: React.FocusEvent) => void; + onBlur?: (geography: object, evt: React.FocusEvent) => void; } -export interface MarkerProps extends Events { +export interface MarkerProps { marker?: MarkerType; tabable?: boolean; style?: { @@ -100,6 +97,14 @@ export interface MarkerProps extends Events { pressed?: React.CSSProperties; }; preserveMarkerAspect?: boolean; + onClick?: (marker: MarkerType, evt: React.MouseEvent) => void; + onMouseEnter?: (marker: MarkerType, evt: React.MouseEvent) => void; + onMouseMove?: (marker: MarkerType, evt: React.MouseEvent) => void; + onMouseLeave?: (marker: MarkerType, evt: React.MouseEvent) => void; + onMouseDown?: (marker: MarkerType, evt: React.MouseEvent) => void; + onMouseUp?: (marker: MarkerType, evt: React.MouseEvent) => void; + onFocus?: (marker: MarkerType, evt: React.FocusEvent) => void; + onBlur?: (marker: MarkerType, evt: React.FocusEvent) => void; } export interface AnnotationProps { @@ -126,7 +131,7 @@ export interface GraticuleProps { Globe?: boolean; } -export interface LineProps extends Events { +export interface LineProps { line?: Line; tabable?: boolean; style?: { @@ -136,6 +141,14 @@ export interface LineProps extends Events { }; preserveMarkerAspect?: boolean; buildPath?: (start: Point, end: Point, line: Line) => string; + onClick?: (line: Line, evt: React.MouseEvent) => void; + onMouseEnter?: (line: Line, evt: React.MouseEvent) => void; + onMouseMove?: (line: Line, evt: React.MouseEvent) => void; + onMouseLeave?: (line: Line, evt: React.MouseEvent) => void; + onMouseDown?: (line: Line, evt: React.MouseEvent) => void; + onMouseUp?: (line: Line, evt: React.MouseEvent) => void; + onFocus?: (line: Line, evt: React.FocusEvent) => void; + onBlur?: (line: Line, evt: React.FocusEvent) => void; } export class ComposableMap extends React.Component {} From 3d96c9aa59b822f913be6a5d58bfaac69092d407 Mon Sep 17 00:00:00 2001 From: Mihail Novikov Date: Sun, 6 Jan 2019 12:31:37 +0300 Subject: [PATCH 095/646] [@react-simple-maps] Fix test errors --- types/react-simple-maps/index.d.ts | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/types/react-simple-maps/index.d.ts b/types/react-simple-maps/index.d.ts index 06cb7bc09a..e76c4e3f0d 100644 --- a/types/react-simple-maps/index.d.ts +++ b/types/react-simple-maps/index.d.ts @@ -6,22 +6,11 @@ import * as React from 'react'; -interface ZoomableProps { - center?: Point; - zoom?: number; - disablePanning?: boolean; - style?: React.CSSProperties; - width?: number; - height?: number; - onMoveStart?: (currentCenter: Point) => void; - onMoveEnd?: (newCenter: Point) => void; -} - export type Point = [number, number]; -export type MarkerType = { +export interface MarkerType { coordinates: Point; -}; +} export interface Line { coordinates: { @@ -49,11 +38,27 @@ export interface ComposableMapProps { viewBox?: string; } -export interface ZoomableGlobeProps extends ZoomableProps { +export interface ZoomableGlobeProps { + center?: Point; + zoom?: number; + disablePanning?: boolean; + style?: React.CSSProperties; + width?: number; + height?: number; + onMoveStart?: (currentCenter: Point) => void; + onMoveEnd?: (newCenter: Point) => void; sensitivity?: number; } -export interface ZoomableGroupProps extends ZoomableProps { +export interface ZoomableGroupProps { + center?: Point; + zoom?: number; + disablePanning?: boolean; + style?: React.CSSProperties; + width?: number; + height?: number; + onMoveStart?: (currentCenter: Point) => void; + onMoveEnd?: (newCenter: Point) => void; backdrop?: { x: Point; y: Point; From c4a9538c1793018af267ac60644b51b642a3d795 Mon Sep 17 00:00:00 2001 From: bonan Date: Sun, 6 Jan 2019 15:10:25 +0100 Subject: [PATCH 096/646] Add definition for mediaType() in @types/accept --- types/accept/accept-tests.ts | 2 ++ types/accept/index.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/types/accept/accept-tests.ts b/types/accept/accept-tests.ts index 011216ede4..659d05c174 100644 --- a/types/accept/accept-tests.ts +++ b/types/accept/accept-tests.ts @@ -14,6 +14,8 @@ accept.language("en;q=0.7, en-GB;q=0.8", ["en-gb"]); // language === "en-GB" const languages = accept.languages("da, en;q=0.7, en-GB;q=0.8"); // languages === ["da", "en-GB", "en"] languages.lastIndexOf(''); +accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1"); +accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1", ["application/json", "text/html"]); const mediaTypes = accept.mediaTypes("text/plain, application/json;q=0.5, text/html, */*;q=0.1"); // mediaTypes === ["text/plain", "text/html", "application/json", "*/*"] mediaTypes.lastIndexOf(''); diff --git a/types/accept/index.d.ts b/types/accept/index.d.ts index b067ea4306..886193a01e 100644 --- a/types/accept/index.d.ts +++ b/types/accept/index.d.ts @@ -10,6 +10,7 @@ export function encoding(encodingHeader?: string, preferences?: string[]): strin export function encodings(encodingHeader?: string): string[]; export function language(languageHeader?: string, preferences?: string[]): string; export function languages(languageHeader?: string): string[]; +export function mediaType(mediaTypeHeader?: string, preferences?: string[]): string; export function mediaTypes(mediaTypeHeader?: string): string[]; export function parseAll( headers: Record From ef09a8002a083c2050b42ef8280ccdb09aa25c14 Mon Sep 17 00:00:00 2001 From: cwomack Date: Sun, 6 Jan 2019 10:21:59 -0800 Subject: [PATCH 097/646] feat(react-content-loader): add ariaLabel property --- types/react-content-loader/index.d.ts | 1 + types/react-content-loader/react-content-loader-tests.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/types/react-content-loader/index.d.ts b/types/react-content-loader/index.d.ts index c395fc8a34..eca7233862 100644 --- a/types/react-content-loader/index.d.ts +++ b/types/react-content-loader/index.d.ts @@ -22,6 +22,7 @@ export interface ContentLoaderProps { 'xMidYMid slice' | 'xMaxYMid slice' | 'xMinYMax slice' | 'xMidYMax slice' | 'xMaxYMax slice'; uniquekey?: string; className?: string; + ariaLabel?: string; } export default class ContentLoader extends React.Component { } export class Facebook extends React.Component { } diff --git a/types/react-content-loader/react-content-loader-tests.tsx b/types/react-content-loader/react-content-loader-tests.tsx index b64deba6c4..d8fa1e1b11 100644 --- a/types/react-content-loader/react-content-loader-tests.tsx +++ b/types/react-content-loader/react-content-loader-tests.tsx @@ -17,6 +17,7 @@ const CustomComponent = () => { preserveAspectRatio="xMinYMin meet" uniquekey="reactcontentloader" className="my-class" + ariaLabel="loading..." > {/* Pure SVG */} From 1dc5761b46c1c7b2f6ebf319815936ef8d17524d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 15:59:11 -0300 Subject: [PATCH 098/646] Update version to 3.15.0 --- types/validatorjs/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index b5047a6656..29db85ecac 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for validatorjs v3.7.0 +// Type definitions for validatorjs v3.15.0 // Project: https://github.com/skaterdav85/validatorjs // Definitions by: Karol Janyst // Dan Manastireanu +// Matías Olivera // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Validator { From 6a45a1d60ed66fe51cf7c0922f7de2b02abd034c Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sun, 6 Jan 2019 20:02:44 +0100 Subject: [PATCH 099/646] [request-stats] Add types --- types/request-stats/index.d.ts | 190 +++++++++++++++++++++ types/request-stats/request-stats-tests.ts | 52 ++++++ types/request-stats/tsconfig.json | 23 +++ types/request-stats/tslint.json | 1 + 4 files changed, 266 insertions(+) create mode 100644 types/request-stats/index.d.ts create mode 100644 types/request-stats/request-stats-tests.ts create mode 100644 types/request-stats/tsconfig.json create mode 100644 types/request-stats/tslint.json diff --git a/types/request-stats/index.d.ts b/types/request-stats/index.d.ts new file mode 100644 index 0000000000..3f1afa19d4 --- /dev/null +++ b/types/request-stats/index.d.ts @@ -0,0 +1,190 @@ +// Type definitions for request-stats 3.0 +// Project: https://github.com/watson/request-stats +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { + Server as HttpServer, + IncomingMessage, + ServerResponse, + IncomingHttpHeaders, + OutgoingHttpHeaders, +} from 'http'; +import { Server as HttpsServer } from 'https'; +import { EventEmitter } from 'events'; + +export = requestStats; + +/** + * Attach request-stats to a HTTP server. + * If no callback is provided, you can later attach a listener on the "complete" event. + * + * @param server Initialize request-stats with an instance a HTTP server. + * @param statsCallback A callback which will be called for each completed HTTP request with a stats object. + */ +declare function requestStats( + server: HttpServer | HttpsServer, + statsCallback?: requestStats.StatsCallback +): requestStats.StatsEmitter; + +/** + * Attach request-stats to a single HTTP request. + * If no callback is provided, you can later attach a listener on the "complete" event. + * + * @param req An instance of a HTTP request. + * @param res An instance of a HTTP response. + * @param statsCallback A callback which will be called with a stats object when the HTTP request completes. + */ +declare function requestStats( + req: IncomingMessage, + res: ServerResponse, + statsCallback?: requestStats.StatsCallback +): requestStats.StatsEmitter; + +declare namespace requestStats { + type StatsCallback = (stats: Stats) => void; + + interface Stats { + /** + * `true` if the connection was closed correctly and `false` otherwise + */ + ok: boolean; + + /** + * The milliseconds it took to serve the request + */ + time: number; + + req: { + /** + * Number of bytes sent by the client + */ + bytes: number; + /** + * The headers sent by the client + */ + headers: IncomingHttpHeaders; + /** + * The HTTP method used by the client + */ + method: string; + /** + * The path part of the request URL + */ + path: string; + /** + * The remote ip + */ + ip: string; + /** + * The original `http.IncomingMessage` object + */ + raw: IncomingMessage; + }; + res: { + /** + * Number of bytes sent back to the client + */ + bytes: number; + /** + * The headers sent back to the client + */ + headers: OutgoingHttpHeaders; + /** + * The HTTP status code returned to the client + */ + status: number; + /** + * The original `http.ServerResponse` object + */ + raw: ServerResponse; + }; + } + + interface Request { + /** + * Returns a progress object if called while a HTTP request is in progress. + * If called multiple times, the returned progress object will contain the delta of the previous + * call to `.progress()`. + */ + progress(): Progress; + } + + interface Progress { + /** + * `false` if the request is still in progress + */ + completed: boolean; + /** + * The total time the reuqest have been in progress + */ + time: number; + /** + * The time since previous call to `.progress()` + */ + timeDelta: number; + req: { + /** + * Total bytes received + */ + bytes: number; + /** + * Bytes received since previous call to `.progress()` + */ + bytesDelta: number; + /** + * Bytes per second calculated since previous call to `.progress()` + */ + speed: number; + /** + * If the request contains a Content-Size header + */ + bytesLeft: number; + /** + * If the request contains a Content-Size header + */ + timeLeft: number; + }; + res: { + /** + * Total bytes send back to the client + */ + bytes: number; + /** + * Bytes sent back to the client since previous call to `.progress()` + */ + bytesDelta: number; + /** + * Bytes per second calculated since previous call to `.progress()` + */ + speed: number; + }; + } + + interface StatsEmitter extends EventEmitter { + addListener(event: 'complete', listener: StatsCallback): this; + addListener(event: 'request', listener: (req: Request) => void): this; + on(event: 'complete', listener: StatsCallback): this; + on(event: 'request', listener: (req: Request) => void): this; + once(event: 'complete', listener: StatsCallback): this; + once(event: 'request', listener: (req: Request) => void): this; + removeListener(event: 'complete', listener: StatsCallback): this; + removeListener(event: 'request', listener: (req: Request) => void): this; + off(event: 'complete', listener: StatsCallback): this; + off(event: 'request', listener: (req: Request) => void): this; + removeAllListeners(event?: 'complete' | 'request'): this; + listeners(event: 'complete'): StatsCallback[]; + listeners(event: 'request'): Array<(req: Request) => void>; + rawListeners(event: 'complete'): StatsCallback[]; + rawListeners(event: 'request'): Array<(req: Request) => void>; + emit(event: 'complete', stats: Stats): boolean; + emit(event: 'request', req: Request): boolean; + listenerCount(type: 'complete' | 'request'): number; + prependListener(event: 'complete', listener: StatsCallback): this; + prependListener(event: 'request', listener: (req: Request) => void): this; + prependOnceListener(event: 'complete', listener: StatsCallback): this; + prependOnceListener(event: 'request', listener: (req: Request) => void): this; + eventNames(): Array<'complete' | 'request'>; + } +} diff --git a/types/request-stats/request-stats-tests.ts b/types/request-stats/request-stats-tests.ts new file mode 100644 index 0000000000..7c73596ad1 --- /dev/null +++ b/types/request-stats/request-stats-tests.ts @@ -0,0 +1,52 @@ +import requestStats = require('request-stats'); +import * as http from 'http'; + +const server = http.createServer((req, res) => { + requestStats(req, res); // $ExpectType StatsEmitter + requestStats(req, res, stats => { + stats; // $ExpectType Stats + }); +}); + +const stats = requestStats(server); +stats; // $ExpectType StatsEmitter +// $ExpectType StatsEmitter +requestStats(server, stats => { + stats; // $ExpectType Stats + + stats.ok; // $ExpectType boolean + stats.time; // $ExpectType number + stats.req.bytes; // $ExpectType number + stats.req.headers; // $ExpectType IncomingHttpHeaders + stats.req.method; // $ExpectType string + stats.req.path; // $ExpectType string + stats.req.ip; // $ExpectType string + stats.req.raw; // $ExpectType IncomingMessage + stats.res.bytes; // $ExpectType number + stats.res.headers; // $ExpectType OutgoingHttpHeaders + stats.res.status; // $ExpectType number + stats.res.raw; // $ExpectType ServerResponse +}); + +stats.on('complete', stats => { + stats; // $ExpectType Stats +}); + +stats.on('request', req => { + req; // $ExpectType Request + + const progress = req.progress(); + progress; // $ExpectType Progress + + progress.completed; // $ExpectType boolean + progress.time; // $ExpectType number + progress.timeDelta; // $ExpectType number + progress.req.bytes; // $ExpectType number + progress.req.bytesDelta; // $ExpectType number + progress.req.speed; // $ExpectType number + progress.req.bytesLeft; // $ExpectType number + progress.req.timeLeft; // $ExpectType number + progress.res.bytes; // $ExpectType number + progress.res.bytesDelta; // $ExpectType number + progress.res.speed; // $ExpectType number +}); diff --git a/types/request-stats/tsconfig.json b/types/request-stats/tsconfig.json new file mode 100644 index 0000000000..77f283fcb4 --- /dev/null +++ b/types/request-stats/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", + "request-stats-tests.ts" + ] +} diff --git a/types/request-stats/tslint.json b/types/request-stats/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/request-stats/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 20adc13e50f45e6cbd42706719a041d3a864c394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 16:22:52 -0300 Subject: [PATCH 100/646] Delete the interface ParsedRule It isn't used in any place. --- types/validatorjs/index.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index 29db85ecac..9a660c5966 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -7,10 +7,6 @@ declare namespace Validator { - interface ParsedRule { - attribute: Array<{ name: string, value: any }> - } - interface ValidationErrors { [field: string]: string } From 19d40360f893ec8f3804a07711fa0eea51b17e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 16:49:16 -0300 Subject: [PATCH 101/646] Code formatting with Prettier --- types/validatorjs/index.d.ts | 78 +++++++++++++------------- types/validatorjs/validatorjs-tests.ts | 59 ++++++++++--------- 2 files changed, 68 insertions(+), 69 deletions(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index 9a660c5966..1a41866d0f 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -6,64 +6,64 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Validator { - interface ValidationErrors { - [field: string]: string + [field: string]: string; } interface ErrorMessages { - [key: string]: string | ErrorMessages + [key: string]: string | ErrorMessages; } interface AttributeNames { - [attribute: string]: string + [attribute: string]: string; } - type AttributeFormatter = (attribute: any) => any + type AttributeFormatter = (attribute: any) => any; interface Errors { - errors : ValidationErrors - add (attribute: string, message: string): void - get (attribute: string): Array - first (attribute: string): string | boolean - all (): ValidationErrors - has (attribute: string): boolean + errors: ValidationErrors; + add(attribute: string, message: string): void; + get(attribute: string): Array; + first(attribute: string): string | boolean; + all(): ValidationErrors; + has(attribute: string): boolean; } interface ValidatorStatic { - new (data: A, rules: any, customMessages?: ErrorMessages): Validator - setMessages (lang: string, messages: ErrorMessages): any - getMessages (lang: string): ErrorMessages - useLang (lang: string): void - getDefaultLang (): string - setAttributeFormatter (func: AttributeFormatter): void - stopOnError (attributes: boolean | Array): void - register (name: string, fn: Function, message: string): void - registerAsync (name: string, fn: Function, message: string): void + new (data: A, rules: any, customMessages?: ErrorMessages): Validator< + A + >; + setMessages(lang: string, messages: ErrorMessages): any; + getMessages(lang: string): ErrorMessages; + useLang(lang: string): void; + getDefaultLang(): string; + setAttributeFormatter(func: AttributeFormatter): void; + stopOnError(attributes: boolean | Array): void; + register(name: string, fn: Function, message: string): void; + registerAsync(name: string, fn: Function, message: string): void; } interface Validator { - lang: string - input: A - messages: ErrorMessages - errors: Errors - errorCount: number - hasAsync: boolean - rules: any - numericRules: Array - attributeFormatter: AttributeFormatter - check (): boolean - checkAsync (passes?: Function, fails?: Function): void - setAttributeNames (attributes: AttributeNames): void - setAttributeFormatter (func: AttributeFormatter): void - getRule (name: string): Function - stopOnError (passes?: Function): boolean | void - passes (passes?: Function): boolean | void - fails (fails?: Function): boolean | void + lang: string; + input: A; + messages: ErrorMessages; + errors: Errors; + errorCount: number; + hasAsync: boolean; + rules: any; + numericRules: Array; + attributeFormatter: AttributeFormatter; + check(): boolean; + checkAsync(passes?: Function, fails?: Function): void; + setAttributeNames(attributes: AttributeNames): void; + setAttributeFormatter(func: AttributeFormatter): void; + getRule(name: string): Function; + stopOnError(passes?: Function): boolean | void; + passes(passes?: Function): boolean | void; + fails(fails?: Function): boolean | void; } - } -declare const Validator: Validator.ValidatorStatic +declare const Validator: Validator.ValidatorStatic; export = Validator; export as namespace Validator; diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index 4eb24ed6bd..4ab3e28159 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -1,41 +1,40 @@ -import Validator = require("validatorjs"); +import Validator = require('validatorjs'); var rules: any = { - foo: "required" -} + foo: 'required' +}; var data: any = { - foo: "bar" -} + foo: 'bar' +}; -var validator: Validator.Validator = new Validator(data, rules) +var validator: Validator.Validator = new Validator(data, rules); -var passes: boolean = validator.passes() as boolean -validator.passes(() => {}) +var passes: boolean = validator.passes() as boolean; +validator.passes(() => {}); -var fails: boolean = validator.fails() as boolean -validator.fails(() => {}) +var fails: boolean = validator.fails() as boolean; +validator.fails(() => {}); -var check: boolean = validator.check() +var check: boolean = validator.check(); -var errors: Validator.Errors = validator.errors -var all: Validator.ValidationErrors = errors.all() -var error: Array = errors.get("foo") -var first: string | boolean = errors.first("foo") -var has: boolean = errors.has("foo") +var errors: Validator.Errors = validator.errors; +var all: Validator.ValidationErrors = errors.all(); +var error: Array = errors.get('foo'); +var first: string | boolean = errors.first('foo'); +var has: boolean = errors.has('foo'); -Validator.setMessages("en", { - integer: 'The :attribute must be an integer.', - min: { - numeric: 'The :attribute must be at least :min.', - string: 'The :attribute must be at least :min characters.' - } +Validator.setMessages('en', { + integer: 'The :attribute must be an integer.', + min: { + numeric: 'The :attribute must be at least :min.', + string: 'The :attribute must be at least :min characters.' } -); -var messages: Validator.ErrorMessages = Validator.getMessages("en") -Validator.useLang("en") -var lang: string = Validator.getDefaultLang() -Validator.setAttributeFormatter((attributes: any) => ({})) -Validator.stopOnError(true) -Validator.register("custom", () => {}, "error.custom") -Validator.registerAsync("custom", () => {}, "error.custom") +}); +var messages: Validator.ErrorMessages = Validator.getMessages('en'); +Validator.useLang('en'); +var lang: string = Validator.getDefaultLang(); +Validator.setAttributeFormatter((attributes: any) => ({})); +Validator.stopOnError(true); +Validator.register('custom', () => {}, 'error.custom'); +Validator.registerAsync('custom', () => {}, 'error.custom'); From 1e6edecd0089c3f75989fde122f438d61eed7305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 17:03:04 -0300 Subject: [PATCH 102/646] Add interface Rules --- types/validatorjs/index.d.ts | 7 ++++ types/validatorjs/validatorjs-tests.ts | 56 +++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index 1a41866d0f..a084866805 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -6,6 +6,13 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Validator { + interface TypeCheckingRule { + [attribute: string]: Array; + } + interface Rules { + [attribute: string]: string | Array | Rules; + } + interface ValidationErrors { [field: string]: string; } diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index 4ab3e28159..9c4255c757 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -1,6 +1,60 @@ import Validator = require('validatorjs'); -var rules: any = { +/** + * Validation rules + */ + +function objectRules() { + const data: any = { name: 'John' }; + const rules: Validator.Rules = { name: 'required' }; + const validation = new Validator(data, rules); +} + +function nestedRules() { + const data: any = { name: 'John', bio: { age: 28 } }; + + const nested: Validator.Rules = { + name: 'required', + bio: { age: 'min:18' } + }; + const flattened: Validator.Rules = { + name: 'required', + 'bio.age': 'min:18' + }; + + const validation1 = new Validator(data, nested); + const validation2 = new Validator(data, flattened); +} + +function wildcardRules() { + const data: any = { + users: [{ name: 'John', bio: { age: 28 } }] + }; + + const rules: Validator.Rules = { + 'users.*.name': 'required', + 'users.*.bio.age': 'min:18' + }; + + const validation = new Validator(data, rules); +} + +function arrayRules() { + const data: any = { name: 'John' }; + const rules: Validator.Rules = { name: ['required', 'string'] }; + const validation = new Validator(data, rules); +} + +function typeCheckingRules() { + const data: any = { age: 30, name: '' }; + const rules: Validator.Rules = { + age: ['required', { in: [29, 30] }], + name: [{ required_if: ['age', 30] }] + }; + const validation = new Validator(data, rules); +} + +var rules: Validator.Rules = { foo: 'required' }; From d79a32cd8c8fe7feb79d51e839c195c72778451f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 17:39:51 -0300 Subject: [PATCH 103/646] Separate the tests with comments --- types/validatorjs/validatorjs-tests.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index 9c4255c757..500e62580e 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -62,7 +62,10 @@ var data: any = { foo: 'bar' }; -var validator: Validator.Validator = new Validator(data, rules); + +/** + * Passing validation + */ var passes: boolean = validator.passes() as boolean; validator.passes(() => {}); @@ -72,12 +75,20 @@ validator.fails(() => {}); var check: boolean = validator.check(); +/** + * Validation errors + */ + var errors: Validator.Errors = validator.errors; var all: Validator.ValidationErrors = errors.all(); var error: Array = errors.get('foo'); var first: string | boolean = errors.first('foo'); var has: boolean = errors.has('foo'); +/** + * Validator + */ + Validator.setMessages('en', { integer: 'The :attribute must be an integer.', min: { From da6d526cb0d72fac31e09f4dc4e96d9bde59e03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 17:43:31 -0300 Subject: [PATCH 104/646] Use ES6 syntax --- types/validatorjs/validatorjs-tests.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index 500e62580e..a02ed2351e 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -54,36 +54,37 @@ function typeCheckingRules() { const validation = new Validator(data, rules); } -var rules: Validator.Rules = { +const rules: Validator.Rules = { foo: 'required' }; -var data: any = { +const data: any = { foo: 'bar' }; +const validator: Validator.Validator = new Validator(data, rules); /** * Passing validation */ -var passes: boolean = validator.passes() as boolean; +const passes: boolean = validator.passes() as boolean; validator.passes(() => {}); -var fails: boolean = validator.fails() as boolean; +const fails: boolean = validator.fails() as boolean; validator.fails(() => {}); -var check: boolean = validator.check(); +const check: boolean = validator.check(); /** * Validation errors */ -var errors: Validator.Errors = validator.errors; -var all: Validator.ValidationErrors = errors.all(); -var error: Array = errors.get('foo'); -var first: string | boolean = errors.first('foo'); -var has: boolean = errors.has('foo'); +const errors: Validator.Errors = validator.errors; +const all: Validator.ValidationErrors = errors.all(); +const error: Array = errors.get('foo'); +const first: string | boolean = errors.first('foo'); +const has: boolean = errors.has('foo'); /** * Validator @@ -96,9 +97,9 @@ Validator.setMessages('en', { string: 'The :attribute must be at least :min characters.' } }); -var messages: Validator.ErrorMessages = Validator.getMessages('en'); +const messages: Validator.ErrorMessages = Validator.getMessages('en'); Validator.useLang('en'); -var lang: string = Validator.getDefaultLang(); +const lang: string = Validator.getDefaultLang(); Validator.setAttributeFormatter((attributes: any) => ({})); Validator.stopOnError(true); Validator.register('custom', () => {}, 'error.custom'); From 70385fd6e6bc5a458430a6c29ea86663391a057b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 17:51:44 -0300 Subject: [PATCH 105/646] Fix interface ValidationErrors --- types/validatorjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index a084866805..ceaf2cfc93 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -14,7 +14,7 @@ declare namespace Validator { } interface ValidationErrors { - [field: string]: string; + [field: string]: Array; } interface ErrorMessages { From 7e6e4d7915fb31b0463386ac211d2709e4aefbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 17:58:19 -0300 Subject: [PATCH 106/646] Correct the return value of the first method It return the first error message or false. It never returns true. --- types/validatorjs/index.d.ts | 3 ++- types/validatorjs/validatorjs-tests.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index ceaf2cfc93..9a489980de 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -9,6 +9,7 @@ declare namespace Validator { interface TypeCheckingRule { [attribute: string]: Array; } + interface Rules { [attribute: string]: string | Array | Rules; } @@ -31,7 +32,7 @@ declare namespace Validator { errors: ValidationErrors; add(attribute: string, message: string): void; get(attribute: string): Array; - first(attribute: string): string | boolean; + first(attribute: string): string | false; all(): ValidationErrors; has(attribute: string): boolean; } diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index a02ed2351e..eb8eda9656 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -83,7 +83,7 @@ const check: boolean = validator.check(); const errors: Validator.Errors = validator.errors; const all: Validator.ValidationErrors = errors.all(); const error: Array = errors.get('foo'); -const first: string | boolean = errors.first('foo'); +const first: string | false = errors.first('foo'); const has: boolean = errors.has('foo'); /** From f5a867e210ecdbdb271a131b006a2421b0faff8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 18:06:26 -0300 Subject: [PATCH 107/646] Use interface Rules in Validator Related with commit 1e6edecd0089c3f75989fde122f438d61eed7305 --- types/validatorjs/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index 9a489980de..8d463f57b9 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -38,9 +38,11 @@ declare namespace Validator { } interface ValidatorStatic { - new (data: A, rules: any, customMessages?: ErrorMessages): Validator< - A - >; + new ( + data: A, + rules: Rules, + customMessages?: ErrorMessages + ): Validator; setMessages(lang: string, messages: ErrorMessages): any; getMessages(lang: string): ErrorMessages; useLang(lang: string): void; @@ -58,7 +60,7 @@ declare namespace Validator { errors: Errors; errorCount: number; hasAsync: boolean; - rules: any; + rules: Rules; numericRules: Array; attributeFormatter: AttributeFormatter; check(): boolean; From 7f0b66c4599813934114365a523ec26be0da4268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 18:45:30 -0300 Subject: [PATCH 108/646] Add type RegisterCallback --- types/validatorjs/index.d.ts | 8 +++++++- types/validatorjs/validatorjs-tests.ts | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index 8d463f57b9..26afaf88f9 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -37,6 +37,12 @@ declare namespace Validator { has(attribute: string): boolean; } + type RegisterCallback = ( + value: string | number | boolean, + args: string, + attribute: string + ) => boolean; + interface ValidatorStatic { new ( data: A, @@ -49,7 +55,7 @@ declare namespace Validator { getDefaultLang(): string; setAttributeFormatter(func: AttributeFormatter): void; stopOnError(attributes: boolean | Array): void; - register(name: string, fn: Function, message: string): void; + register(name: string, fn: RegisterCallback, message: string): void; registerAsync(name: string, fn: Function, message: string): void; } diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index eb8eda9656..9611314bb5 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -102,5 +102,10 @@ Validator.useLang('en'); const lang: string = Validator.getDefaultLang(); Validator.setAttributeFormatter((attributes: any) => ({})); Validator.stopOnError(true); -Validator.register('custom', () => {}, 'error.custom'); + +// Register custom validation rules + +const callback: Validator.RegisterCallback = (value, args, attribute) => true; +Validator.register('custom', callback, 'error.custom'); + Validator.registerAsync('custom', () => {}, 'error.custom'); From 0f3459152dc5b1496729fe3ae45a3771082f0f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 18:54:43 -0300 Subject: [PATCH 109/646] Make optional the argument "message" --- types/validatorjs/index.d.ts | 2 +- types/validatorjs/validatorjs-tests.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index 26afaf88f9..1adec06e25 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -55,7 +55,7 @@ declare namespace Validator { getDefaultLang(): string; setAttributeFormatter(func: AttributeFormatter): void; stopOnError(attributes: boolean | Array): void; - register(name: string, fn: RegisterCallback, message: string): void; + register(name: string, fn: RegisterCallback, message?: string): void; registerAsync(name: string, fn: Function, message: string): void; } diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index 9611314bb5..c816226074 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -107,5 +107,6 @@ Validator.stopOnError(true); const callback: Validator.RegisterCallback = (value, args, attribute) => true; Validator.register('custom', callback, 'error.custom'); +Validator.register('custom', callback); Validator.registerAsync('custom', () => {}, 'error.custom'); From b77685931d591d50720fcaffbd78232359d12944 Mon Sep 17 00:00:00 2001 From: Jari Pennanen Date: Mon, 7 Jan 2019 00:05:23 +0200 Subject: [PATCH 110/646] breaks, breakClips, metadata These values have too strict definitions, they are defined in https://developers.google.com/cast/docs/reference/caf_receiver/cast.framework.messages.MediaInformation#metadata as undefined. My vscode ran the file through prettier, not sure if it added extra changes I didn't intend. --- .../cast.framework.messages.d.ts | 80 +++++-------------- 1 file changed, 22 insertions(+), 58 deletions(-) diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index c3dc4a405f..41ea2b854e 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1,13 +1,7 @@ import { Event, DetailedErrorCode } from "./cast.framework.events"; -export as namespace messages -export type UserAction = - | "LIKE" - | "DISLIKE" - | "FOLLOW" - | "UNFOLLOW" - | "FLAG" - | "SKIP_AD"; +export as namespace messages; +export type UserAction = "LIKE" | "DISLIKE" | "FOLLOW" | "UNFOLLOW" | "FLAG" | "SKIP_AD"; export type UserActionContext = | "UNKNOWN_CONTEXT" @@ -22,12 +16,7 @@ export type UserActionContext = | "PLAYER" | "COACH"; -export type TextTrackType = - | "SUBTITLES" - | "CAPTIONS" - | "DESCRIPTIONS" - | "CHAPTERS" - | "METADATA"; +export type TextTrackType = "SUBTITLES" | "CAPTIONS" | "DESCRIPTIONS" | "CHAPTERS" | "METADATA"; export type TextTrackWindowType = "NONE" | "NORMAL" | "ROUNDED_CORNERS"; @@ -44,12 +33,7 @@ export type TextTrackFontGenericFamily = export type TextTrackFontStyle = "NORMAL" | "BOLD" | "BOLD_ITALIC" | "ITALIC"; -export type TextTrackEdgeType = - | "NONE" - | "OUTLINE" - | "DROP_SHADOW" - | "RAISED" - | "DEPRESSED"; +export type TextTrackEdgeType = "NONE" | "OUTLINE" | "DROP_SHADOW" | "RAISED" | "DEPRESSED"; export type Command = | "PAUSE" @@ -64,11 +48,7 @@ export type Command = export type SeekResumeState = "PLAYBACK_START" | "PLAYBACK_PAUSE"; -export type StreamingProtocolType = - | "UNKNOWN" - | "MPEG_DASH" - | "HLS" - | "SMOOTH_STREAMING"; +export type StreamingProtocolType = "UNKNOWN" | "MPEG_DASH" | "HLS" | "SMOOTH_STREAMING"; export type StreamType = "BUFFERED" | "LIVE" | "NONE"; @@ -101,11 +81,7 @@ export type ErrorReason = | "INVALID_REQUEST" | "GENERIC_LOAD_ERROR"; -export type RepeatMode = - | "REPEAT_OFF" - | "REPEAT_ALL" - | "REPEAT_SINGLE" - | "REPEAT_ALL_AND_SHUFFLE"; +export type RepeatMode = "REPEAT_OFF" | "REPEAT_ALL" | "REPEAT_SINGLE" | "REPEAT_ALL_AND_SHUFFLE"; export type IdleReason = "CANCELLED" | "INTERRUPTED" | "FINISHED" | "ERROR"; @@ -160,12 +136,7 @@ export type MessageType = export type PlayerState = "IDLE" | "PLAYING" | "PAUSED" | "BUFFERING"; -export type QueueChangeType = - | "INSERT" - | "REMOVE" - | "ITEMS_CHANGE" - | "UPDATE" - | "NO_CHANGE"; +export type QueueChangeType = "INSERT" | "REMOVE" | "ITEMS_CHANGE" | "UPDATE" | "NO_CHANGE"; export type QueueType = | "ALBUM" @@ -178,12 +149,7 @@ export type QueueType = | "LIVE_TV" | "MOVIE"; -export type MetadataType = - | "GENERIC" - | "MOVIE" - | "TV_SHOW" - | "MUSIC_TRACK" - | "PHOTO"; +export type MetadataType = "GENERIC" | "MOVIE" | "TV_SHOW" | "MUSIC_TRACK" | "PHOTO"; /** * RefreshCredentials request data. @@ -1372,12 +1338,12 @@ export interface MediaInformation { * is playing or ones that receiver will play shortly after; instead of sending * whole list of clips. This is to avoid overflow of MediaStatus message. */ - breakClips: BreakClip[]; + breakClips?: BreakClip[]; /** * List of breaks. */ - breaks: Break[]; + breaks?: Break[]; /** * Typically the url of the media. @@ -1414,12 +1380,18 @@ export interface MediaInformation { /** * The format of the HLS media segment. */ - hlsSegmentFormat: HlsSegmentFormat; + hlsSegmentFormat?: HlsSegmentFormat; /** * The media metadata. */ - metadata: MediaMetadata; + metadata?: + | MediaMetadata + | GenericMediaMetadata + | MovieMediaMetadata + | MusicTrackMediaMetadata + | PhotoMediaMetadata + | TvShowMediaMetadata; /** * The stream type. @@ -1429,12 +1401,12 @@ export interface MediaInformation { /** * The style of text track. */ - textTrackStyle: TextTrackStyle; + textTrackStyle?: TextTrackStyle; /** * The media tracks. */ - tracks: Track[]; + tracks?: Track[]; } /** @@ -1515,12 +1487,7 @@ export interface LoadByEntityRequestData { * attributes. */ export class LiveSeekableRange { - constructor( - start?: number, - end?: number, - isMovingWindow?: boolean, - isLiveDone?: boolean - ); + constructor(start?: number, end?: number, isMovingWindow?: boolean, isLiveDone?: boolean); /** * A boolean value indicates whether a live stream is ended. If it is done; @@ -1659,10 +1626,7 @@ export class FetchItemsRequestData extends RequestData { * Extended media status information */ export class ExtendedMediaStatus { - constructor( - playerState: MediaInformation, - opt_media?: MediaInformation - ); + constructor(playerState: MediaInformation, opt_media?: MediaInformation); media: MediaInformation; From 4de11f4fb370f9e5bb0b1e7864b31ad97d2ccad2 Mon Sep 17 00:00:00 2001 From: Anton Astashov Date: Sun, 6 Jan 2019 15:10:40 -0600 Subject: [PATCH 111/646] [@types/koa-router]: Parameterize `Router` After #31704 it would be useful to specify what is `Context.State` and `Context` inside the `Router`'s handlers. For that, we could provide a way to parameterize `Router` (also fallbacking to default `any` and `{}` in case the generic type params are omitted). So it would work like that: ```ts type MyState = {foo: string} type MyContext = {bar: string} const app = new Koa<{}, {}>(); const router = new Router(); router.get('/', (ctx, next) => { // ctx here is Koa.ParameterizedContext> console.log(ctx.state.foo); ctx.body = 'Hello World!'; }); app.use(async (ctx, next) => { ctx.state.foo = "foo" ctx.bar = "bar"; await next(); }) .use(router.routes()) .use(router.allowedMethods()) .use(async (ctx, next) => { // ctx here is Koa.ParameterizedContext> console.log(ctx.router); console.log(ctx.bar); await next(); }) .listen(3000); ``` But if we don't parameterize `Router`, it will work as before: ```ts const app = new Koa(); const router = new Router(); router.get('/', (ctx, next) => { // ctx here is Koa.ParameterizedContext ctx.body = 'Hello World!'; }); app.use(async (ctx, next) => { ctx.state.foo = "foo" ctx.bar = "bar"; await next(); }) .use(router.routes()) .use(router.allowedMethods()) .listen(3000); ``` What do you think? --- types/koa-router/index.d.ts | 163 +++++++++++++++++++++------ types/koa-router/koa-router-tests.ts | 73 +++++++++++- 2 files changed, 193 insertions(+), 43 deletions(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index b2163d09d1..6c17c2f3c1 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -43,7 +43,7 @@ declare namespace Router { strict?: boolean; } - export interface IRouterContext extends Koa.Context { + export interface IRouterContext { /** * url params */ @@ -51,11 +51,14 @@ declare namespace Router { /** * the router instance */ - router: Router; + router: Router; } - export interface IMiddleware { - (ctx: Koa.ParameterizedContext<{}, IRouterContext>, next: () => Promise): any; + export interface IMiddleware { + ( + ctx: Koa.ParameterizedContext & CustomT>, + next: () => Promise + ): void; } export interface IParamMiddleware { @@ -148,7 +151,7 @@ declare namespace Router { } } -declare class Router { +declare class Router { params: Object; stack: Array; @@ -164,109 +167,195 @@ declare class Router { * sequentially, requests start at the first middleware and work their way * "down" the middleware stack. */ - use(...middleware: Array): Router; - use(path: string | string[] | RegExp, ...middleware: Array): Router; + use(...middleware: Array>): Router; + use( + path: string | string[] | RegExp, + ...middleware: Array> + ): Router; /** * HTTP get method */ - get(name: string, path: string | RegExp, ...middleware: Array): Router; - get(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + get( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + get( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP post method */ - post(name: string, path: string | RegExp, ...middleware: Array): Router; - post(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + post( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + post( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP put method */ - put(name: string, path: string | RegExp, ...middleware: Array): Router; - put(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + put( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + put( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP link method */ - link(name: string, path: string | RegExp, ...middleware: Array): Router; - link(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + link( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + link( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP unlink method */ - unlink(name: string, path: string | RegExp, ...middleware: Array): Router; - unlink(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; - + unlink( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + unlink( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP delete method */ - delete(name: string, path: string | RegExp, ...middleware: Array): Router; - delete(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + delete( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + delete( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * Alias for `router.delete()` because delete is a reserved word */ - del(name: string, path: string | RegExp, ...middleware: Array): Router; - del(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + del( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + del( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP head method */ - head(name: string, path: string | RegExp, ...middleware: Array): Router; - head(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + head( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + head( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP options method */ - options(name: string, path: string | RegExp, ...middleware: Array): Router; - options(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + options( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + options( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP path method */ - patch(name: string, path: string | RegExp, ...middleware: Array): Router; - patch(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + patch( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + patch( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * Register route with all methods. */ - all(name: string, path: string | RegExp, ...middleware: Array): Router; - all(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + all( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + all( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * Set the path prefix for a Router instance that was already initialized. */ - prefix(prefix: string): Router; + prefix(prefix: string): Router; /** * Returns router middleware which dispatches a route matching the request. */ - routes(): Koa.Middleware; + routes(): Koa.Middleware>; /** * Returns router middleware which dispatches a route matching the request. */ - middleware(): Koa.Middleware; + middleware(): Koa.Middleware>; /** * Returns separate middleware for responding to `OPTIONS` requests with * an `Allow` header containing the allowed methods, as well as responding * with `405 Method Not Allowed` and `501 Not Implemented` as appropriate. */ - allowedMethods(options?: Router.IRouterAllowedMethodsOptions): Koa.Middleware; + allowedMethods( + options?: Router.IRouterAllowedMethodsOptions + ): Koa.Middleware>; /** * Redirect `source` to `destination` URL with optional 30x status `code`. * * Both `source` and `destination` can be route names. */ - redirect(source: string, destination: string, code?: number): Router; + redirect(source: string, destination: string, code?: number): Router; /** * Create and register a route. */ - register(path: string | RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Object): Router.Layer; + register( + path: string | RegExp, + methods: string[], + middleware: Router.IMiddleware, + opts?: Object + ): Router.Layer; /** * Lookup route with given `name`. @@ -304,7 +393,7 @@ declare class Router { /** * Run middleware for named route parameters. Useful for auto-loading or validation. */ - param(param: string, middleware: Router.IParamMiddleware): Router; + param(param: string, middleware: Router.IParamMiddleware): Router; /** * Generate URL from url pattern and given `params`. diff --git a/types/koa-router/koa-router-tests.ts b/types/koa-router/koa-router-tests.ts index 50e66509ea..186d253409 100644 --- a/types/koa-router/koa-router-tests.ts +++ b/types/koa-router/koa-router-tests.ts @@ -1,9 +1,15 @@ import Koa = require("koa"); +import { Context } from "koa"; +import compose = require("koa-compose"); +import etag = require("koa-etag"); import Router = require("koa-router"); +type MyState = {foo: string} +type MyContext = {bar: string} + const app = new Koa<{}, {}>(); -const router = new Router({ +const router = new Router({ prefix: "/users" }); @@ -31,9 +37,10 @@ router } }) .post('/users', function (ctx, next) { - // ... + ctx.state.foo = 'foo'; }) .put('/users/:id', function (ctx, next) { + ctx.bar = 'bar'; ctx.body = ctx.params.id; }) .del('/users/:id', function () { @@ -49,11 +56,65 @@ const match = router.match('/users/:id', 'GET'); let layer: Router.Layer let layerOptions: Router.ILayerOptions -const mw: Router.IMiddleware = (ctx: Router.IRouterContext, next: () => Promise) => { +const mw: Router.IMiddleware = (ctx: Koa.ParameterizedContext, next: () => Promise) => { ctx.body = "Ok"; }; -app.use(router.routes()); -app.use(router.allowedMethods()); +app.use(async (ctx: Koa.ParameterizedContext, next) => { + ctx.state.foo = 'foo'; + await next(); + }) + .use(router.routes()) + .use(router.allowedMethods()) + .use(async (ctx, next) => { + ctx.state.foo = '3'; + await next(); + }) + .listen(3000); -app.listen(3000); +const router3 = new Router(); +router3.get('/', (ctx) => { + ctx.foo = "bar"; + console.log(ctx.router.params); + ctx.body = "Hello World!"; +}); +new Koa() + .use(async (ctx, next) => next()) + .use(router3.routes()) + .use(router.allowedMethods()) + .listen(3001); + +// It's from https://github.com/DefinitelyTyped/DefinitelyTyped/pull/31704#issuecomment-451075919, +// to make sure we don't break it again + +declare module "koa" { + interface Context { + name: string; + } +} + +const app2 = new Koa(); + +const conditional = async (ctx: Context, next: any) => { + await next(); + if (ctx.fresh) { + ctx.status = 304; + ctx.body = null; + } +}; + +const router2 = compose([conditional, etag()]); + +app2.use(router2); + +app2.use(async (ctx: Context, next: any) => { + ctx.name = "hello world"; + await next(); +}); + +app2.use((ctx: Context, next: any) => { + console.log(ctx.name); + ctx.body = ctx.name; +}); + +app2.listen(8000); From 385bb50a9830ee92b6321368d13de630316de318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Olivera?= Date: Sun, 6 Jan 2019 19:02:34 -0300 Subject: [PATCH 112/646] Add type RegisterAsyncCallback --- types/validatorjs/index.d.ts | 13 ++++++++++++- types/validatorjs/validatorjs-tests.ts | 11 ++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/types/validatorjs/index.d.ts b/types/validatorjs/index.d.ts index 1adec06e25..128add8727 100644 --- a/types/validatorjs/index.d.ts +++ b/types/validatorjs/index.d.ts @@ -43,6 +43,13 @@ declare namespace Validator { attribute: string ) => boolean; + type RegisterAsyncCallback = ( + value: string | number | boolean, + args: string, + attribute: string, + passes: (success?: boolean, message?: string) => void + ) => void; + interface ValidatorStatic { new ( data: A, @@ -56,7 +63,11 @@ declare namespace Validator { setAttributeFormatter(func: AttributeFormatter): void; stopOnError(attributes: boolean | Array): void; register(name: string, fn: RegisterCallback, message?: string): void; - registerAsync(name: string, fn: Function, message: string): void; + registerAsync( + name: string, + fn: RegisterAsyncCallback, + message: string + ): void; } interface Validator { diff --git a/types/validatorjs/validatorjs-tests.ts b/types/validatorjs/validatorjs-tests.ts index c816226074..a1538fc7fb 100644 --- a/types/validatorjs/validatorjs-tests.ts +++ b/types/validatorjs/validatorjs-tests.ts @@ -109,4 +109,13 @@ const callback: Validator.RegisterCallback = (value, args, attribute) => true; Validator.register('custom', callback, 'error.custom'); Validator.register('custom', callback); -Validator.registerAsync('custom', () => {}, 'error.custom'); +const asyncCallback: Validator.RegisterAsyncCallback = ( + value, + args, + attribute, + passes +) => { + passes(); + passes(false, 'error.custom'); +}; +Validator.registerAsync('custom', () => {}, 'error.default'); From f000c4700cfa24b5bdfb02fbb796d601ccac0bda Mon Sep 17 00:00:00 2001 From: Jari Pennanen Date: Mon, 7 Jan 2019 00:32:08 +0200 Subject: [PATCH 113/646] removed my reformatting hassle, sorry. --- .../cast.framework.messages.d.ts | 76 ++++++++++++++----- 1 file changed, 59 insertions(+), 17 deletions(-) diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index 41ea2b854e..366e02d707 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1,7 +1,13 @@ import { Event, DetailedErrorCode } from "./cast.framework.events"; -export as namespace messages; -export type UserAction = "LIKE" | "DISLIKE" | "FOLLOW" | "UNFOLLOW" | "FLAG" | "SKIP_AD"; +export as namespace messages +export type UserAction = + | "LIKE" + | "DISLIKE" + | "FOLLOW" + | "UNFOLLOW" + | "FLAG" + | "SKIP_AD"; export type UserActionContext = | "UNKNOWN_CONTEXT" @@ -16,7 +22,12 @@ export type UserActionContext = | "PLAYER" | "COACH"; -export type TextTrackType = "SUBTITLES" | "CAPTIONS" | "DESCRIPTIONS" | "CHAPTERS" | "METADATA"; +export type TextTrackType = + | "SUBTITLES" + | "CAPTIONS" + | "DESCRIPTIONS" + | "CHAPTERS" + | "METADATA"; export type TextTrackWindowType = "NONE" | "NORMAL" | "ROUNDED_CORNERS"; @@ -33,7 +44,12 @@ export type TextTrackFontGenericFamily = export type TextTrackFontStyle = "NORMAL" | "BOLD" | "BOLD_ITALIC" | "ITALIC"; -export type TextTrackEdgeType = "NONE" | "OUTLINE" | "DROP_SHADOW" | "RAISED" | "DEPRESSED"; +export type TextTrackEdgeType = + | "NONE" + | "OUTLINE" + | "DROP_SHADOW" + | "RAISED" + | "DEPRESSED"; export type Command = | "PAUSE" @@ -48,7 +64,11 @@ export type Command = export type SeekResumeState = "PLAYBACK_START" | "PLAYBACK_PAUSE"; -export type StreamingProtocolType = "UNKNOWN" | "MPEG_DASH" | "HLS" | "SMOOTH_STREAMING"; +export type StreamingProtocolType = + | "UNKNOWN" + | "MPEG_DASH" + | "HLS" + | "SMOOTH_STREAMING"; export type StreamType = "BUFFERED" | "LIVE" | "NONE"; @@ -81,7 +101,11 @@ export type ErrorReason = | "INVALID_REQUEST" | "GENERIC_LOAD_ERROR"; -export type RepeatMode = "REPEAT_OFF" | "REPEAT_ALL" | "REPEAT_SINGLE" | "REPEAT_ALL_AND_SHUFFLE"; +export type RepeatMode = + | "REPEAT_OFF" + | "REPEAT_ALL" + | "REPEAT_SINGLE" + | "REPEAT_ALL_AND_SHUFFLE"; export type IdleReason = "CANCELLED" | "INTERRUPTED" | "FINISHED" | "ERROR"; @@ -136,7 +160,12 @@ export type MessageType = export type PlayerState = "IDLE" | "PLAYING" | "PAUSED" | "BUFFERING"; -export type QueueChangeType = "INSERT" | "REMOVE" | "ITEMS_CHANGE" | "UPDATE" | "NO_CHANGE"; +export type QueueChangeType = + | "INSERT" + | "REMOVE" + | "ITEMS_CHANGE" + | "UPDATE" + | "NO_CHANGE"; export type QueueType = | "ALBUM" @@ -149,7 +178,12 @@ export type QueueType = | "LIVE_TV" | "MOVIE"; -export type MetadataType = "GENERIC" | "MOVIE" | "TV_SHOW" | "MUSIC_TRACK" | "PHOTO"; +export type MetadataType = + | "GENERIC" + | "MOVIE" + | "TV_SHOW" + | "MUSIC_TRACK" + | "PHOTO"; /** * RefreshCredentials request data. @@ -1385,13 +1419,13 @@ export interface MediaInformation { /** * The media metadata. */ - metadata?: - | MediaMetadata - | GenericMediaMetadata - | MovieMediaMetadata - | MusicTrackMediaMetadata - | PhotoMediaMetadata - | TvShowMediaMetadata; + metadata: + | MediaMetadata + | GenericMediaMetadata + | MovieMediaMetadata + | MusicTrackMediaMetadata + | PhotoMediaMetadata + | PhotoMediaMetadata; /** * The stream type. @@ -1487,7 +1521,12 @@ export interface LoadByEntityRequestData { * attributes. */ export class LiveSeekableRange { - constructor(start?: number, end?: number, isMovingWindow?: boolean, isLiveDone?: boolean); + constructor( + start?: number, + end?: number, + isMovingWindow?: boolean, + isLiveDone?: boolean + ); /** * A boolean value indicates whether a live stream is ended. If it is done; @@ -1626,7 +1665,10 @@ export class FetchItemsRequestData extends RequestData { * Extended media status information */ export class ExtendedMediaStatus { - constructor(playerState: MediaInformation, opt_media?: MediaInformation); + constructor( + playerState: MediaInformation, + opt_media?: MediaInformation + ); media: MediaInformation; From 4d6fe35d64f4c8ba4da58c00fb37fd00166dce03 Mon Sep 17 00:00:00 2001 From: Jari Pennanen Date: Mon, 7 Jan 2019 00:35:45 +0200 Subject: [PATCH 114/646] this is also optional according to Google documentation. --- types/chromecast-caf-receiver/cast.framework.messages.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index 366e02d707..0ff76d9bb1 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1419,7 +1419,7 @@ export interface MediaInformation { /** * The media metadata. */ - metadata: + metadata?: | MediaMetadata | GenericMediaMetadata | MovieMediaMetadata From 23625dac03ee8611295df810885d56e0ae2e3372 Mon Sep 17 00:00:00 2001 From: Jari Pennanen Date: Mon, 7 Jan 2019 00:37:49 +0200 Subject: [PATCH 115/646] typo... --- types/chromecast-caf-receiver/cast.framework.messages.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index 0ff76d9bb1..d7897d8282 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1424,8 +1424,8 @@ export interface MediaInformation { | GenericMediaMetadata | MovieMediaMetadata | MusicTrackMediaMetadata - | PhotoMediaMetadata - | PhotoMediaMetadata; + | PhotoMediaMetadata + | TvShowMediaMetadata; /** * The stream type. From b47a23490774bd6e6ab345e1195d85ebeecbb0d7 Mon Sep 17 00:00:00 2001 From: Jari Pennanen Date: Mon, 7 Jan 2019 00:44:49 +0200 Subject: [PATCH 116/646] trailing spaces huh --- .../cast.framework.messages.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index d7897d8282..1846fd4840 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1419,11 +1419,11 @@ export interface MediaInformation { /** * The media metadata. */ - metadata?: - | MediaMetadata - | GenericMediaMetadata - | MovieMediaMetadata - | MusicTrackMediaMetadata + metadata?: + | MediaMetadata + | GenericMediaMetadata + | MovieMediaMetadata + | MusicTrackMediaMetadata | PhotoMediaMetadata | TvShowMediaMetadata; From 279827ac2fefe6415c2a1f40a00b635a04972e25 Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 20:28:38 -0500 Subject: [PATCH 117/646] Added typings for workbox-webpack-plugin --- types/workbox-webpack-plugin/index.d.ts | 378 ++++++++++++++++++ types/workbox-webpack-plugin/tsconfig.json | 23 ++ types/workbox-webpack-plugin/tslint.json | 3 + types/workbox-webpack-plugin/workbox-tests.ts | 190 +++++++++ 4 files changed, 594 insertions(+) create mode 100644 types/workbox-webpack-plugin/index.d.ts create mode 100644 types/workbox-webpack-plugin/tsconfig.json create mode 100644 types/workbox-webpack-plugin/tslint.json create mode 100644 types/workbox-webpack-plugin/workbox-tests.ts diff --git a/types/workbox-webpack-plugin/index.d.ts b/types/workbox-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..7b460a6de4 --- /dev/null +++ b/types/workbox-webpack-plugin/index.d.ts @@ -0,0 +1,378 @@ +// Type definitions for workbox-webpack-plugin 3.6.3 +// Project: https://github.com/GoogleChrome/workbox/blob/master/packages/workbox-webpack-plugin +// Definitions by: Kevin Groat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2.2 + +import { Loader, Plugin } from 'webpack'; + +/** + * Workbox provides two webpack plugins: one that generates a complete service worker for you and one that generates a list of assets to precache that is injected into a service worker file. + * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin + */ +declare namespace WorkboxWebpackPlugin { + type ChacheStrategy = 'cacheFirst' | 'cacheOnly' | 'networkFirst' | 'networkOnly' | 'staleWhileRevalidate'; + + interface ManifestEntry { + revision: string; + url: string; + } + + interface RuntimeCacheOptions { + /** + * Fall back to the cache after X seconds. + */ + networkTimeoutSeconds?: number; + + /** + * A custom cache name for this route. + */ + cacheName?: string; + + /** + * Custom cache expiration. + */ + expiration?: { + /** + * Cache will only hold X entries. + */ + maxEntries?: number; + /** + * Cache will only hold entries for X seconds. + */ + maxAgeSeconds?: number; + }; + + /** + * Configure background sync. + */ + backgroundSync?: { + name: string; + options?: { + maxRetentionTime: number; + }; + }; + + /** + * Configure which responses are considered cacheable. + */ + cacheableResponse?: { + /** + * Only cache responses with HTTP code(s) listed. + */ + statuses?: number[]; + /** + * Only cache responses with headers which match this map. + */ + headers?: { [header: string]: string }; + }; + + /** + * Configure the broadcast cache update plugin. + */ + broadcastUpdate?: { + channelName?: string; + }; + + /** + * Add in any additional plugin logic you need. + */ + plugins?: any[] + + /** + * Used to configure the handler. + */ + fetchOptions?: any + + /** + * Used to configure the handler. + */ + matchOptions?: any; + } + + interface RuntimeCacheRule { + /** + * Cache any same-origin request that matches the pattern. + */ + urlPattern?: string | RegExp; + /** + * The `handler` values are strings, corresponding to names of the strategies supported by [`workbox.strategies`](https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.strategies#methods). + */ + handler?: ChacheStrategy; + /** + * The `options` properties can be used to configure instances of the cache expiration, cacheable response, and broadcast cache update plugins to apply to a given route. + */ + options?: RuntimeCacheOptions; + } + + interface CommonOptions { + /** + * The path and filename of the service worker file that will be created by the build process, relative to the webpack output directory. + * @default 'service-worker.js' + * @example swDest: 'custom-sw-name.js' + */ + swDest?: string; + + /** + * Valid values are `'cdn'`, `'local'`, and `'disabled'`. + * - `'cdn'`, the default, will use a URL for the Workbox runtime libraries hosted on a highly-available Google Cloud Storage instance. + * - `'local'` will copy all of the Workbox runtime libraries into a versioned directory alongside your generated service worker, and configure the service worker to use those local copies. This option is provided for developers who would prefer to host everything themselves and not rely on the Google Cloud Storage CDN. + * - `'disabled'` will opt-out automatic behavior. It's up to you to host a local copy of the Workbox libraries at your preferred URL, and to pass in the correct path to `workbox-sw.js` via the `importScripts` configuration option. + * - Note: In webpack, passing in a string corresponding to the webpack chunk name containing a custom Workbox runtime library bundle is also supported. + * + * @default 'cdn' + * @example importWorkboxFrom: 'local' + */ + importWorkboxFrom?: 'cdn' | 'local' | 'disabled'; + + /** + * By default, Workbox will precache assets regardless of which chunk the asset is part of. + * If you would like to override this behavior via a whitelist, specify one or more chunk names. Only assets belonging to those chunks will be precached; any assets belonging to another chunk or without a chunk association will be skipped. + * @default [] + * @example chunks: ['chunk-name-1', 'chunk-name-2'] + */ + chunks?: string[]; + + /** + * By default, Workbox will precache all assets generated by the webpack compilation, regardless of which chunk the asset is part of. + * If you would like to override this behavior via a blacklist, specify one or more chunk names. Any assets belonging to those chunks will be skipped. + * @default [] + * @example excludeChunks: ['chunk-name-1', 'chunk-name-2'] + */ + excludeChunks?: string[]; + + /** + * This allows you to only include assets matching any of the provided criteria when creating the precache manifest. It provides a filename-based approach to filtering. + * This filtering takes place after any chunk-based filtering is applied. + * In keeping with [webpack convention](https://webpack.js.org/configuration/module/#condition), the option `test` can be used as an alias/alternative to `include`. + * @default [] + * @example include: [/\.html$/, /\.js$/] + * @alias test + */ + include?: (string|RegExp)[]; + test?: (string|RegExp)[]; + + /** + * This allows you to specifically omit assets matching any of the provided criteria from being included in the precache manifest. It provides a filename-based approach to filtering. + * This filtering takes place after any chunk-based filtering is applied. + * @default [/\.map$/, /^manifest.*\.js(?:on)?$/] + * @example exclude: [/\.jpg$/, /\.png$/] + */ + exclude?: (string|RegExp)[]; + + /** + * Workbox creates assets as part of your webpack build process: a precache manifest file, and potentially a local copy of the Workbox libraries (if `importWorkboxFrom` is set to `'local'`). + * These assets will, by default, be created at the root of your webpack build directory, i.e. `output.path`. You can set the `importsDirectory` option if you want these assets to be created in a subdirectory of `output.path` instead of at the top-level. + * Note: This option does not effect where the main service worker JavaScript file is created. That is determined by the `swDest` option. + * @default '' + * @example importsDirectory: 'wb-assets' + */ + importsDirectory?: string; + + /** + * Workbox automatically creates a JavaScript file that contains information about URLs that need to be precached. By default, this file is called `precache-manifest.[manifestHash].js`, where `[manifestHash]` is automatically replaced by a unique value that identifies the contents of the file. + * `precacheManifestFilename` can be used to override this default filename. You must include the string `[manifestHash]` somewhere as part of the filename. + * If you'd like to change the output directory to which the precache manifest is written, you can configure the `importsDirectory` option. + * @default 'precache-manifest.[manifestHash].js' + * @example precacheManifestFilename: 'wb-manifest.[manifestHash].js' + */ + precacheManifestFilename?: string; + + /** + * The base directory you wish to match `globPatterns` against, relative to the current working directory. + * If you do set this, make sure to also configure `globPatterns`. + * @default undefined + * @example globDirectory: '.' + */ + globDirectory?: string; + + /** + * Determines whether or not symlinks are followed when generating the precache manifest. + * For more information, see the definition of `follow` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * @default true + * @example globFollow: false + */ + globFollow?: boolean; + + /** + * A set of patterns matching files to always exclude when generating the precache manifest. + * For more information, see the definition of `ignore` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * @default ['node_modules/**\/*'] + * @example globIgnores: ['**\/ignored.html'] + */ + globIgnores?: string[] + + /** + * Files matching against any of these patterns will be included in the precache manifest. + * For more information, see the [glob primer](https://github.com/isaacs/node-glob#glob-primer). + * Note: Setting `globPatterns` is often unnecessary when using the `workbox-webpack-plugin`, which will automatically precache files that are part of the webpack build pipeline by default. When using the webpack plugin, only set it when you need to cache [non-webpack assets](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#cache_additional_non-webpack_assets). + * @default [] + * @example globPatterns: ['dist/*.{js,png,html,css}'] + */ + globPatterns?: string[] + + /** + * If `true`, an error reading a directory when generating a precache manifest will cause the build to fail. If `false`, the problematic directory will be skipped. + * For more information, see the definition of `strict` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * @default true + * @example globStrict: false + */ + globStrict?: boolean; + + /** + * If a URL is rendered generated based on some server-side logic, its contents may depend on multiple files or on some other unique string value. + * If used with an array of strings, they will be interpreted as glob patterns, and the contents of any files matching the patterns will be used to uniquely version the URL. + * If used with a single string, it will be interpreted as unique versioning information that you've generated out of band for a given URL. + * @default null + */ + templatedUrls?: { [url: string]: string | (string[]) } | null; + + /** + * This value can be used to determine the maximum size of files that will be precached. This prevents you from inadvertantly precaching very large files that might have accidentally matched one of your patterns. + * @default 2097152 + * @example maximumFileSizeToCacheInBytes: 4 * 1024 * 1024 + */ + maximumFileSizeToCacheInBytes?: number; + + /** + * Assets that match this regex will be assumed to be uniquely versioned via their URL, and exempted from the normal HTTP cache-busting that's done when populating the precache. + * While not required, it's recommended that if your existing build process already inserts a `[hash]` value into each filename, you provide a RegExp that will detect those values, as it will reduce the amount of bandwidth consumed when precaching. + * @default null + * @example dontCacheBustUrlsMatching: /\.\w{8}\./ + */ + dontCacheBustUrlsMatching?: RegExp | null; + + /** + * A mapping of prefixes that, if present in an entry in the precache manifest, will be replaced with the corresponding value. + * This can be used to, for example, remove or add a path prefix from a manifest entry if your web hosting setup doesn't match your local filesystem setup. + * As an alternative with more flexibility, you can use the `manifestTransforms` option and provide a function that modifies the entries in the manifest using whatever logic you provide. + * @default null + * @example modifyUrlPrefix: { '/dist': '' } + */ + modifyUrlPrefix?: { [url: string]: string } | null; + + /** + * One or more [`ManifestTransform`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestTransform) functions, which will be applied sequentially against the generated manifest. + * If `modifyUrlPrefix` or `dontCacheBustUrlsMatching` are also specified, their corresponding transformations will be applied first. + */ + manifestTransforms?: ((originalManifest: ManifestEntry[]) => { manifest: ManifestEntry[], warnings?: string[] })[] | null; + } + + export interface GenerateSWOptions extends CommonOptions { + /** + * Whether or not the service worker should skip over the waiting lifecycle stage. Normally this is used with `clientsClaim: true`. + * @default false + * @example skipWaiting: true + */ + skipWaiting?: boolean; + + /** + * Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim) any existing clients as soon as it activates. + * @default false + * @example clientsClaim: true + */ + clientsClaim?: boolean; + + /** + * Passing in an array of objects containing `urlPatterns`, `handlers`, and potentially `options` will add the appropriate code to the generated service worker to handle runtime caching. + * Requests for precached URLs that are picked up via `globPatterns` are handled by default, and don't need to be accommodated in `runtimeCaching`. + * @default [] + */ + runtimeCaching?: RuntimeCacheRule[]; + + /** + * This will be used to create a [`NavigationRoute`](https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.routing.NavigationRoute) that will respond to [navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) for URLs that that aren't precached. + * This is meant to be used in a [Single Page App](https://en.wikipedia.org/wiki/Single-page_application) scenario, in which you want all navigations to use common App Shell HTML. + * It's not intended for use as a fallback that's displayed when the browser is offline. + * @default undefined + * @example navigateFallback: '/app-shell' + */ + navigateFallback?: string + + /** + * An optional array of regular expressions that restricts which URLs the configured navigateFallback behavior applies to. + * This is useful if only a subset of your site's URLs should be treated as being part of a Single Page App. + * If both navigateFallbackBlacklist and navigateFallbackWhitelist are configured, the blacklist takes precedent. + * @default [] + * @example navigateFallbackBlacklist: [/^\/_/, /admin/] + */ + navigateFallbackBlacklist?: RegExp[] + + /** + * An optional array of regular expressions that restricts which URLs the configured navigateFallback behavior applies to. + * This is useful if only a subset of your site's URLs should be treated as being part of a Single Page App. + * If both navigateFallbackBlacklist and navigateFallbackWhitelist are configured, the blacklist takes precedent. + * @default [] + * @example navigateFallbackWhitelist: [/^\/pages/] + */ + navigateFallbackWhitelist?: RegExp[] + + /** + * An required list of JavaScript files that should be passed to [`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts) inside the generated service worker file. + * If one of the imported files sets the `self.__precacheManifest` variable to an array of [`ManifestEntrys`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestEntry), those entries will be automatically precached in the generated service worker. + * This is also useful when you want to let Workbox create your top-level service worker file, but want to include some additional code, such as a `push` event listener. + * @default [] + * @example importScripts: ['push-notifications.abcd1234.js'] + */ + importScripts?: string[] + + /** + * Any search parameter names that match against one of the regex's in this array will be removed before looking for a precache match. + * This is useful if your users might request URLs that contain, for example, URL parameters used to track the source of the traffic. Those URL parameters would normally cause the cache lookup to fail, since the URL strings used as cache keys would not be expected to include them. + * @default [/^utm_/] + * @example ignoreUrlParametersMatching: [/./] + */ + ignoreUrlParametersMatching?: RegExp[] + + /** + * If a [navigation request](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) for a URL ending in `/` fails to match a precached URL, this value will be appended to the URL and that will be checked for a precache match. + * This should be configured to whatever your web server is using, if anything, for its [directory index](https://httpd.apache.org/docs/2.0/mod/mod_dir.html). + * @default 'index.html' + * @example directoryIndex: 'index.html' + */ + directoryIndex?: string; + + /** + * An optional ID to be prepended to cache names used by Workbox. + * This is primarily useful for local development where multiple sites may be served from the same `http://localhost:port` origin. + * @default null + * @example cacheId: 'my-app' + */ + cacheId?: string | null; + + /** + * Controls whether or not to include support for [offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics). + * When `true`, `workbox.googleAnalytics.initialize()` will be added to your new service worker file. + * @default false + * @example offlineGoogleAnalytics: true + */ + offlineGoogleAnalytics?: boolean; + } + + export interface InjectManifestOptions extends CommonOptions { + /** + * The path to the source service worker file that can contain your own customized code, in addition to containing a match for `injectionPointRegexp`. + * Your service worker file should reference the `self.__precacheManifest` variable to obtain a list of [`ManifestEntrys`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestEntry) obtained as part of the compilation: `workbox.precaching.precacheAndRoute(self.__precacheManifest)`. + * @example swSrc: path.join('src', 'sw.js') + */ + swSrc: string; + } + + /** + * The `GenerateSW` plugin will create a service worker file for you and add it to the webpack asset pipeline. + * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin + */ + export class GenerateSW extends Plugin { + constructor (opts?: GenerateSWOptions); + } + + /** + * The `InjectManifest` plugin will generate a list of URLs to precache and add that precache manifest to an existing service worker file. It will otherwise leave the file as-is. + * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin + */ + export class InjectManifest extends Plugin { + constructor (opts?: InjectManifestOptions); + } +} + +export = WorkboxWebpackPlugin diff --git a/types/workbox-webpack-plugin/tsconfig.json b/types/workbox-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..cabf425dbe --- /dev/null +++ b/types/workbox-webpack-plugin/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", + "rx-node-tests.ts" + ] +} \ No newline at end of file diff --git a/types/workbox-webpack-plugin/tslint.json b/types/workbox-webpack-plugin/tslint.json new file mode 100644 index 0000000000..e595b70d63 --- /dev/null +++ b/types/workbox-webpack-plugin/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json", +} diff --git a/types/workbox-webpack-plugin/workbox-tests.ts b/types/workbox-webpack-plugin/workbox-tests.ts new file mode 100644 index 0000000000..5d1ba8f272 --- /dev/null +++ b/types/workbox-webpack-plugin/workbox-tests.ts @@ -0,0 +1,190 @@ + +import { GenerateSW, InjectManifest } from './index' + +// GenerateSW +{ + let plugin: GenerateSW + + // No options object + plugin = new GenerateSW() + + // Empty options object + plugin = new GenerateSW({}) + + // With all of the examples + plugin = new GenerateSW({ + swDest: 'custom-sw-name.js', + importWorkboxFrom: 'local', + // *Only* include assets that belong to these chunks: + chunks: ['chunk-name-1', 'chunk-name-2'], + // Exclude assets that belong to these chunks: + excludeChunks: ['chunk-name-1', 'chunk-name-2'], + // Only include HTML and JS assets when precaching: + include: [/\.html$/, /\.js$/], + // Exclude JPG and PNG assets from precaching: + exclude: [/\.jpg$/, /\.png$/], + // Use a 'wb-assets' directory for Workbox's assets, + // under the top-level output directory. + importsDirectory: 'wb-assets', + precacheManifestFilename: 'wb-manifest.[manifestHash].js', + skipWaiting: true, + clientsClaim: true, + runtimeCaching: [{ + // Match any same-origin request that contains 'api'. + urlPattern: /api/, + // Apply a network-first strategy. + handler: 'networkFirst', + options: { + // Fall back to the cache after 10 seconds. + networkTimeoutSeconds: 10, + // Use a custom cache name for this route. + cacheName: 'my-api-cache', + // Configure custom cache expiration. + expiration: { + maxEntries: 5, + maxAgeSeconds: 60, + }, + // Configure background sync. + backgroundSync: { + name: 'my-queue-name', + options: { + maxRetentionTime: 60 * 60, + }, + }, + // Configure which responses are considered cacheable. + cacheableResponse: { + statuses: [0, 200], + headers: {'x-test': 'true'}, + }, + // Configure the broadcast cache update plugin. + broadcastUpdate: { + channelName: 'my-update-channel', + }, + // Add in any additional plugin logic you need. + plugins: [ + { cacheDidUpdate: () => {/* custom plugin code */} }, + ], + // matchOptions and fetchOptions are used to configure the handler. + fetchOptions: { + mode: 'no-cors', + }, + matchOptions: { + ignoreSearch: true, + }, + }, + }, { + // To match cross-origin requests, use a RegExp that matches + // the start of the origin: + urlPattern: new RegExp('^https://cors\.example\.com/'), + handler: 'staleWhileRevalidate', + options: { + cacheableResponse: { + statuses: [0, 200] + } + } + }], + navigateFallback: '/app-shell', + // Exempt all URLs that start with /_ or contain admin anywhere: + navigateFallbackBlacklist: [/^\/_/, /admin/], + // Include URLs that start with /pages: + navigateFallbackWhitelist: [/^\/pages/], + importScripts: ['push-notifications.abcd1234.js'], + // This will ignore all parameters: + ignoreUrlParametersMatching: [/./], + directoryIndex: 'index.html', + cacheId: 'my-app', + offlineGoogleAnalytics: true, + // Treat all patterns as relative to the current directory: + globDirectory: '.', + globFollow: false, + globIgnores: ['**/ignored.html'], + globPatterns: ['dist/*.{js,png,html,css}'], + globStrict: false, + templatedUrls: { + '/app-shell': [ + 'dev/templates/app-shell.hbs', + 'dev/**/*.css', + ], + '/other-page': 'my-version-info', + }, + // Increase the limit to 4mb: + maximumFileSizeToCacheInBytes: 4 * 1024 * 1024, + dontCacheBustUrlsMatching: /\.\w{8}\./, + modifyUrlPrefix: { + // Remove a '/dist' prefix from the URLs: + '/dist': '' + }, + manifestTransforms: [ + // Basic transformation to remove a certain URL: + (originalManifest) => { + const manifest = originalManifest.filter( + (entry) => entry.url !== 'ignored.html'); + // Optionally, set warning messages. + const warnings = []; + return {manifest, warnings}; + } + ] + }) +} + +// InjectManifest +{ + let plugin: InjectManifest + + // No options object + plugin = new InjectManifest() + + // Minimal options object (swSrc is required) + plugin = new InjectManifest({ + swSrc: 'service-worker.js' + }) + + // With all of the examples + plugin = new InjectManifest({ + swDest: 'custom-sw-name.js', + importWorkboxFrom: 'local', + // *Only* include assets that belong to these chunks: + chunks: ['chunk-name-1', 'chunk-name-2'], + // Exclude assets that belong to these chunks: + excludeChunks: ['chunk-name-1', 'chunk-name-2'], + // Only include HTML and JS assets when precaching: + include: [/\.html$/, /\.js$/], + // Exclude JPG and PNG assets from precaching: + exclude: [/\.jpg$/, /\.png$/], + // Use a 'wb-assets' directory for Workbox's assets, + // under the top-level output directory. + importsDirectory: 'wb-assets', + precacheManifestFilename: 'wb-manifest.[manifestHash].js', + swSrc: 'service-worker.js', + // Treat all patterns as relative to the current directory: + globDirectory: '.', + globFollow: false, + globIgnores: ['**/ignored.html'], + globPatterns: ['dist/*.{js,png,html,css}'], + globStrict: false, + templatedUrls: { + '/app-shell': [ + 'dev/templates/app-shell.hbs', + 'dev/**/*.css', + ], + '/other-page': 'my-version-info', + }, + // Increase the limit to 4mb: + maximumFileSizeToCacheInBytes: 4 * 1024 * 1024, + dontCacheBustUrlsMatching: /\.\w{8}\./, + modifyUrlPrefix: { + // Remove a '/dist' prefix from the URLs: + '/dist': '' + }, + manifestTransforms: [ + // Basic transformation to remove a certain URL: + (originalManifest) => { + const manifest = originalManifest.filter( + (entry) => entry.url !== 'ignored.html'); + // Optionally, set warning messages. + const warnings = []; + return {manifest, warnings}; + } + ] + }) +} \ No newline at end of file From 84b76bf1eb6c4e97e39f8ff3bae91ea2ebcf3601 Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 20:40:59 -0500 Subject: [PATCH 118/646] Made manifestTransforms accept a ReadonlyArray --- types/workbox-webpack-plugin/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/workbox-webpack-plugin/index.d.ts b/types/workbox-webpack-plugin/index.d.ts index 7b460a6de4..6d874737f3 100644 --- a/types/workbox-webpack-plugin/index.d.ts +++ b/types/workbox-webpack-plugin/index.d.ts @@ -255,7 +255,7 @@ declare namespace WorkboxWebpackPlugin { * One or more [`ManifestTransform`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestTransform) functions, which will be applied sequentially against the generated manifest. * If `modifyUrlPrefix` or `dontCacheBustUrlsMatching` are also specified, their corresponding transformations will be applied first. */ - manifestTransforms?: ((originalManifest: ManifestEntry[]) => { manifest: ManifestEntry[], warnings?: string[] })[] | null; + manifestTransforms?: ((originalManifest: ReadonlyArray) => { manifest: ManifestEntry[], warnings?: string[] })[] | null; } export interface GenerateSWOptions extends CommonOptions { From eca3ccbfac555d2b4efdee0a61d01d45dc6ad967 Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 20:41:51 -0500 Subject: [PATCH 119/646] Fixed compiler & linter issues --- types/workbox-webpack-plugin/tsconfig.json | 2 +- types/workbox-webpack-plugin/tslint.json | 2 +- types/workbox-webpack-plugin/workbox-tests.ts | 24 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/types/workbox-webpack-plugin/tsconfig.json b/types/workbox-webpack-plugin/tsconfig.json index cabf425dbe..0b25eabf98 100644 --- a/types/workbox-webpack-plugin/tsconfig.json +++ b/types/workbox-webpack-plugin/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "rx-node-tests.ts" + "workbox-tests.ts" ] } \ No newline at end of file diff --git a/types/workbox-webpack-plugin/tslint.json b/types/workbox-webpack-plugin/tslint.json index e595b70d63..f93cf8562a 100644 --- a/types/workbox-webpack-plugin/tslint.json +++ b/types/workbox-webpack-plugin/tslint.json @@ -1,3 +1,3 @@ { - "extends": "dtslint/dt.json", + "extends": "dtslint/dt.json" } diff --git a/types/workbox-webpack-plugin/workbox-tests.ts b/types/workbox-webpack-plugin/workbox-tests.ts index 5d1ba8f272..0562d8f797 100644 --- a/types/workbox-webpack-plugin/workbox-tests.ts +++ b/types/workbox-webpack-plugin/workbox-tests.ts @@ -1,15 +1,15 @@ -import { GenerateSW, InjectManifest } from './index' +import { GenerateSW, InjectManifest } from './index'; // GenerateSW { - let plugin: GenerateSW + let plugin: GenerateSW; // No options object - plugin = new GenerateSW() + plugin = new GenerateSW(); // Empty options object - plugin = new GenerateSW({}) + plugin = new GenerateSW({}); // With all of the examples plugin = new GenerateSW({ @@ -120,24 +120,24 @@ import { GenerateSW, InjectManifest } from './index' const manifest = originalManifest.filter( (entry) => entry.url !== 'ignored.html'); // Optionally, set warning messages. - const warnings = []; - return {manifest, warnings}; + const warnings = ['warning']; + return {manifest, warnings: [] }; } ] - }) + }); } // InjectManifest { - let plugin: InjectManifest + let plugin: InjectManifest; // No options object - plugin = new InjectManifest() + plugin = new InjectManifest(); // Minimal options object (swSrc is required) plugin = new InjectManifest({ swSrc: 'service-worker.js' - }) + }); // With all of the examples plugin = new InjectManifest({ @@ -182,9 +182,9 @@ import { GenerateSW, InjectManifest } from './index' const manifest = originalManifest.filter( (entry) => entry.url !== 'ignored.html'); // Optionally, set warning messages. - const warnings = []; + const warnings = ['warning']; return {manifest, warnings}; } ] - }) + }); } \ No newline at end of file From 9f677e0247f7e23d48cbdf97a594bb9685dd0188 Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 20:49:05 -0500 Subject: [PATCH 120/646] Fixed typescript version line --- types/workbox-webpack-plugin/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/workbox-webpack-plugin/index.d.ts b/types/workbox-webpack-plugin/index.d.ts index 6d874737f3..32691ed3f2 100644 --- a/types/workbox-webpack-plugin/index.d.ts +++ b/types/workbox-webpack-plugin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/GoogleChrome/workbox/blob/master/packages/workbox-webpack-plugin // Definitions by: Kevin Groat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.2.2 +// typesVerisons: 3.0, 3.1, 3.2 import { Loader, Plugin } from 'webpack'; From cf89ad150771b953483572743ed22e02bc728dfa Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 20:53:53 -0500 Subject: [PATCH 121/646] Renamed tests file --- .../{workbox-tests.ts => workbox-webpack-plugin-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename types/workbox-webpack-plugin/{workbox-tests.ts => workbox-webpack-plugin-tests.ts} (100%) diff --git a/types/workbox-webpack-plugin/workbox-tests.ts b/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts similarity index 100% rename from types/workbox-webpack-plugin/workbox-tests.ts rename to types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts From 76548541509ee9a8bf4eb91b14af58f0cd195e1f Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 21:07:52 -0500 Subject: [PATCH 122/646] Fixed linting issues --- types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts b/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts index 0562d8f797..36c7101028 100644 --- a/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts +++ b/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts @@ -1,4 +1,3 @@ - import { GenerateSW, InjectManifest } from './index'; // GenerateSW @@ -187,4 +186,4 @@ import { GenerateSW, InjectManifest } from './index'; } ] }); -} \ No newline at end of file +} From 79d1731c9ab4d33270dcd54c3ec9503c5c6d14d1 Mon Sep 17 00:00:00 2001 From: Oskar Lindgren Date: Mon, 7 Jan 2019 11:35:49 +0900 Subject: [PATCH 123/646] change browserName to optional webdriverio Capabiliy browserName is not mandatory when using appium for mobile testing --- types/webdriverio/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webdriverio/index.d.ts b/types/webdriverio/index.d.ts index 4a1f585808..67fe0454db 100644 --- a/types/webdriverio/index.d.ts +++ b/types/webdriverio/index.d.ts @@ -171,7 +171,7 @@ declare namespace WebdriverIO { } interface Capabilities { - browserName: string; + browserName?: string; acceptInsecureCerts?: boolean; browserVersion?: string; platformName?: string; From 3dd2fd8b7535cb51bc5e14ee8378dc680ba5c3d5 Mon Sep 17 00:00:00 2001 From: Oskar Lindgren Date: Mon, 7 Jan 2019 11:42:19 +0900 Subject: [PATCH 124/646] add deviceName needed for appium When using webdriverio for appium the DesiredCapability deviceName is needed. --- types/webdriverio/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/webdriverio/index.d.ts b/types/webdriverio/index.d.ts index 4a1f585808..dc5f9acf73 100644 --- a/types/webdriverio/index.d.ts +++ b/types/webdriverio/index.d.ts @@ -278,6 +278,7 @@ declare namespace WebdriverIO { platformVersion?: string; automationName?: string; app?: string; + deviceName?: string; cleanSession?: boolean; From cba252620481c1aee242fdaa9cb280f0d89b941a Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 22:01:15 -0500 Subject: [PATCH 125/646] fixed test name in tsconfig --- types/workbox-webpack-plugin/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/workbox-webpack-plugin/tsconfig.json b/types/workbox-webpack-plugin/tsconfig.json index 0b25eabf98..a88f32e967 100644 --- a/types/workbox-webpack-plugin/tsconfig.json +++ b/types/workbox-webpack-plugin/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "workbox-tests.ts" + "workbox-webpack-plugin-tests.ts" ] } \ No newline at end of file From f9da1d14364dcd94aea84edbca8f61482190edbd Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 22:05:48 -0500 Subject: [PATCH 126/646] Returned TypeScript Version --- types/workbox-webpack-plugin/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/workbox-webpack-plugin/index.d.ts b/types/workbox-webpack-plugin/index.d.ts index 32691ed3f2..6e27ffa563 100644 --- a/types/workbox-webpack-plugin/index.d.ts +++ b/types/workbox-webpack-plugin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/GoogleChrome/workbox/blob/master/packages/workbox-webpack-plugin // Definitions by: Kevin Groat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// typesVerisons: 3.0, 3.1, 3.2 +// TypeScript Version: 3.2 import { Loader, Plugin } from 'webpack'; From ad3a04f91f1ee99b23826f348ff803e175c44a56 Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 22:23:33 -0500 Subject: [PATCH 127/646] No longer relying on webpack for plugin definition --- types/workbox-webpack-plugin/index.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/workbox-webpack-plugin/index.d.ts b/types/workbox-webpack-plugin/index.d.ts index 6e27ffa563..ae6f6f6854 100644 --- a/types/workbox-webpack-plugin/index.d.ts +++ b/types/workbox-webpack-plugin/index.d.ts @@ -2,9 +2,6 @@ // Project: https://github.com/GoogleChrome/workbox/blob/master/packages/workbox-webpack-plugin // Definitions by: Kevin Groat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.2 - -import { Loader, Plugin } from 'webpack'; /** * Workbox provides two webpack plugins: one that generates a complete service worker for you and one that generates a list of assets to precache that is injected into a service worker file. @@ -13,6 +10,10 @@ import { Loader, Plugin } from 'webpack'; declare namespace WorkboxWebpackPlugin { type ChacheStrategy = 'cacheFirst' | 'cacheOnly' | 'networkFirst' | 'networkOnly' | 'staleWhileRevalidate'; + abstract class WebpackPlugin { + apply(...args: any[]): void; + } + interface ManifestEntry { revision: string; url: string; From 3781aa7ff332febc7f755efe02107835b3126644 Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 22:29:41 -0500 Subject: [PATCH 128/646] Fixing relative location import --- types/workbox-webpack-plugin/index.d.ts | 4 ++-- types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/workbox-webpack-plugin/index.d.ts b/types/workbox-webpack-plugin/index.d.ts index ae6f6f6854..6a7850cc43 100644 --- a/types/workbox-webpack-plugin/index.d.ts +++ b/types/workbox-webpack-plugin/index.d.ts @@ -363,7 +363,7 @@ declare namespace WorkboxWebpackPlugin { * The `GenerateSW` plugin will create a service worker file for you and add it to the webpack asset pipeline. * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin */ - export class GenerateSW extends Plugin { + export class GenerateSW extends WebpackPlugin { constructor (opts?: GenerateSWOptions); } @@ -371,7 +371,7 @@ declare namespace WorkboxWebpackPlugin { * The `InjectManifest` plugin will generate a list of URLs to precache and add that precache manifest to an existing service worker file. It will otherwise leave the file as-is. * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin */ - export class InjectManifest extends Plugin { + export class InjectManifest extends WebpackPlugin { constructor (opts?: InjectManifestOptions); } } diff --git a/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts b/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts index 36c7101028..dd3e109b4a 100644 --- a/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts +++ b/types/workbox-webpack-plugin/workbox-webpack-plugin-tests.ts @@ -1,4 +1,4 @@ -import { GenerateSW, InjectManifest } from './index'; +import { GenerateSW, InjectManifest } from 'workbox-webpack-plugin'; // GenerateSW { From 4ebd73854336749c03b5c7b02cbeb1c70a452746 Mon Sep 17 00:00:00 2001 From: Kevin Groat Date: Sun, 6 Jan 2019 22:58:48 -0500 Subject: [PATCH 129/646] Fixed linting errors --- types/workbox-webpack-plugin/index.d.ts | 826 +++++++++++++----------- 1 file changed, 454 insertions(+), 372 deletions(-) diff --git a/types/workbox-webpack-plugin/index.d.ts b/types/workbox-webpack-plugin/index.d.ts index 6a7850cc43..2789583d2c 100644 --- a/types/workbox-webpack-plugin/index.d.ts +++ b/types/workbox-webpack-plugin/index.d.ts @@ -1,379 +1,461 @@ -// Type definitions for workbox-webpack-plugin 3.6.3 +// Type definitions for workbox-webpack-plugin 3.6 // Project: https://github.com/GoogleChrome/workbox/blob/master/packages/workbox-webpack-plugin // Definitions by: Kevin Groat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** - * Workbox provides two webpack plugins: one that generates a complete service worker for you and one that generates a list of assets to precache that is injected into a service worker file. - * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin - */ -declare namespace WorkboxWebpackPlugin { - type ChacheStrategy = 'cacheFirst' | 'cacheOnly' | 'networkFirst' | 'networkOnly' | 'staleWhileRevalidate'; +export type ChacheStrategy = 'cacheFirst' | 'cacheOnly' | 'networkFirst' | 'networkOnly' | 'staleWhileRevalidate'; - abstract class WebpackPlugin { - apply(...args: any[]): void; - } - - interface ManifestEntry { - revision: string; - url: string; - } - - interface RuntimeCacheOptions { - /** - * Fall back to the cache after X seconds. - */ - networkTimeoutSeconds?: number; - - /** - * A custom cache name for this route. - */ - cacheName?: string; - - /** - * Custom cache expiration. - */ - expiration?: { - /** - * Cache will only hold X entries. - */ - maxEntries?: number; - /** - * Cache will only hold entries for X seconds. - */ - maxAgeSeconds?: number; - }; - - /** - * Configure background sync. - */ - backgroundSync?: { - name: string; - options?: { - maxRetentionTime: number; - }; - }; - - /** - * Configure which responses are considered cacheable. - */ - cacheableResponse?: { - /** - * Only cache responses with HTTP code(s) listed. - */ - statuses?: number[]; - /** - * Only cache responses with headers which match this map. - */ - headers?: { [header: string]: string }; - }; - - /** - * Configure the broadcast cache update plugin. - */ - broadcastUpdate?: { - channelName?: string; - }; - - /** - * Add in any additional plugin logic you need. - */ - plugins?: any[] - - /** - * Used to configure the handler. - */ - fetchOptions?: any - - /** - * Used to configure the handler. - */ - matchOptions?: any; - } - - interface RuntimeCacheRule { - /** - * Cache any same-origin request that matches the pattern. - */ - urlPattern?: string | RegExp; - /** - * The `handler` values are strings, corresponding to names of the strategies supported by [`workbox.strategies`](https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.strategies#methods). - */ - handler?: ChacheStrategy; - /** - * The `options` properties can be used to configure instances of the cache expiration, cacheable response, and broadcast cache update plugins to apply to a given route. - */ - options?: RuntimeCacheOptions; - } - - interface CommonOptions { - /** - * The path and filename of the service worker file that will be created by the build process, relative to the webpack output directory. - * @default 'service-worker.js' - * @example swDest: 'custom-sw-name.js' - */ - swDest?: string; - - /** - * Valid values are `'cdn'`, `'local'`, and `'disabled'`. - * - `'cdn'`, the default, will use a URL for the Workbox runtime libraries hosted on a highly-available Google Cloud Storage instance. - * - `'local'` will copy all of the Workbox runtime libraries into a versioned directory alongside your generated service worker, and configure the service worker to use those local copies. This option is provided for developers who would prefer to host everything themselves and not rely on the Google Cloud Storage CDN. - * - `'disabled'` will opt-out automatic behavior. It's up to you to host a local copy of the Workbox libraries at your preferred URL, and to pass in the correct path to `workbox-sw.js` via the `importScripts` configuration option. - * - Note: In webpack, passing in a string corresponding to the webpack chunk name containing a custom Workbox runtime library bundle is also supported. - * - * @default 'cdn' - * @example importWorkboxFrom: 'local' - */ - importWorkboxFrom?: 'cdn' | 'local' | 'disabled'; - - /** - * By default, Workbox will precache assets regardless of which chunk the asset is part of. - * If you would like to override this behavior via a whitelist, specify one or more chunk names. Only assets belonging to those chunks will be precached; any assets belonging to another chunk or without a chunk association will be skipped. - * @default [] - * @example chunks: ['chunk-name-1', 'chunk-name-2'] - */ - chunks?: string[]; - - /** - * By default, Workbox will precache all assets generated by the webpack compilation, regardless of which chunk the asset is part of. - * If you would like to override this behavior via a blacklist, specify one or more chunk names. Any assets belonging to those chunks will be skipped. - * @default [] - * @example excludeChunks: ['chunk-name-1', 'chunk-name-2'] - */ - excludeChunks?: string[]; - - /** - * This allows you to only include assets matching any of the provided criteria when creating the precache manifest. It provides a filename-based approach to filtering. - * This filtering takes place after any chunk-based filtering is applied. - * In keeping with [webpack convention](https://webpack.js.org/configuration/module/#condition), the option `test` can be used as an alias/alternative to `include`. - * @default [] - * @example include: [/\.html$/, /\.js$/] - * @alias test - */ - include?: (string|RegExp)[]; - test?: (string|RegExp)[]; - - /** - * This allows you to specifically omit assets matching any of the provided criteria from being included in the precache manifest. It provides a filename-based approach to filtering. - * This filtering takes place after any chunk-based filtering is applied. - * @default [/\.map$/, /^manifest.*\.js(?:on)?$/] - * @example exclude: [/\.jpg$/, /\.png$/] - */ - exclude?: (string|RegExp)[]; - - /** - * Workbox creates assets as part of your webpack build process: a precache manifest file, and potentially a local copy of the Workbox libraries (if `importWorkboxFrom` is set to `'local'`). - * These assets will, by default, be created at the root of your webpack build directory, i.e. `output.path`. You can set the `importsDirectory` option if you want these assets to be created in a subdirectory of `output.path` instead of at the top-level. - * Note: This option does not effect where the main service worker JavaScript file is created. That is determined by the `swDest` option. - * @default '' - * @example importsDirectory: 'wb-assets' - */ - importsDirectory?: string; - - /** - * Workbox automatically creates a JavaScript file that contains information about URLs that need to be precached. By default, this file is called `precache-manifest.[manifestHash].js`, where `[manifestHash]` is automatically replaced by a unique value that identifies the contents of the file. - * `precacheManifestFilename` can be used to override this default filename. You must include the string `[manifestHash]` somewhere as part of the filename. - * If you'd like to change the output directory to which the precache manifest is written, you can configure the `importsDirectory` option. - * @default 'precache-manifest.[manifestHash].js' - * @example precacheManifestFilename: 'wb-manifest.[manifestHash].js' - */ - precacheManifestFilename?: string; - - /** - * The base directory you wish to match `globPatterns` against, relative to the current working directory. - * If you do set this, make sure to also configure `globPatterns`. - * @default undefined - * @example globDirectory: '.' - */ - globDirectory?: string; - - /** - * Determines whether or not symlinks are followed when generating the precache manifest. - * For more information, see the definition of `follow` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). - * @default true - * @example globFollow: false - */ - globFollow?: boolean; - - /** - * A set of patterns matching files to always exclude when generating the precache manifest. - * For more information, see the definition of `ignore` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). - * @default ['node_modules/**\/*'] - * @example globIgnores: ['**\/ignored.html'] - */ - globIgnores?: string[] - - /** - * Files matching against any of these patterns will be included in the precache manifest. - * For more information, see the [glob primer](https://github.com/isaacs/node-glob#glob-primer). - * Note: Setting `globPatterns` is often unnecessary when using the `workbox-webpack-plugin`, which will automatically precache files that are part of the webpack build pipeline by default. When using the webpack plugin, only set it when you need to cache [non-webpack assets](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#cache_additional_non-webpack_assets). - * @default [] - * @example globPatterns: ['dist/*.{js,png,html,css}'] - */ - globPatterns?: string[] - - /** - * If `true`, an error reading a directory when generating a precache manifest will cause the build to fail. If `false`, the problematic directory will be skipped. - * For more information, see the definition of `strict` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). - * @default true - * @example globStrict: false - */ - globStrict?: boolean; - - /** - * If a URL is rendered generated based on some server-side logic, its contents may depend on multiple files or on some other unique string value. - * If used with an array of strings, they will be interpreted as glob patterns, and the contents of any files matching the patterns will be used to uniquely version the URL. - * If used with a single string, it will be interpreted as unique versioning information that you've generated out of band for a given URL. - * @default null - */ - templatedUrls?: { [url: string]: string | (string[]) } | null; - - /** - * This value can be used to determine the maximum size of files that will be precached. This prevents you from inadvertantly precaching very large files that might have accidentally matched one of your patterns. - * @default 2097152 - * @example maximumFileSizeToCacheInBytes: 4 * 1024 * 1024 - */ - maximumFileSizeToCacheInBytes?: number; - - /** - * Assets that match this regex will be assumed to be uniquely versioned via their URL, and exempted from the normal HTTP cache-busting that's done when populating the precache. - * While not required, it's recommended that if your existing build process already inserts a `[hash]` value into each filename, you provide a RegExp that will detect those values, as it will reduce the amount of bandwidth consumed when precaching. - * @default null - * @example dontCacheBustUrlsMatching: /\.\w{8}\./ - */ - dontCacheBustUrlsMatching?: RegExp | null; - - /** - * A mapping of prefixes that, if present in an entry in the precache manifest, will be replaced with the corresponding value. - * This can be used to, for example, remove or add a path prefix from a manifest entry if your web hosting setup doesn't match your local filesystem setup. - * As an alternative with more flexibility, you can use the `manifestTransforms` option and provide a function that modifies the entries in the manifest using whatever logic you provide. - * @default null - * @example modifyUrlPrefix: { '/dist': '' } - */ - modifyUrlPrefix?: { [url: string]: string } | null; - - /** - * One or more [`ManifestTransform`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestTransform) functions, which will be applied sequentially against the generated manifest. - * If `modifyUrlPrefix` or `dontCacheBustUrlsMatching` are also specified, their corresponding transformations will be applied first. - */ - manifestTransforms?: ((originalManifest: ReadonlyArray) => { manifest: ManifestEntry[], warnings?: string[] })[] | null; - } - - export interface GenerateSWOptions extends CommonOptions { - /** - * Whether or not the service worker should skip over the waiting lifecycle stage. Normally this is used with `clientsClaim: true`. - * @default false - * @example skipWaiting: true - */ - skipWaiting?: boolean; - - /** - * Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim) any existing clients as soon as it activates. - * @default false - * @example clientsClaim: true - */ - clientsClaim?: boolean; - - /** - * Passing in an array of objects containing `urlPatterns`, `handlers`, and potentially `options` will add the appropriate code to the generated service worker to handle runtime caching. - * Requests for precached URLs that are picked up via `globPatterns` are handled by default, and don't need to be accommodated in `runtimeCaching`. - * @default [] - */ - runtimeCaching?: RuntimeCacheRule[]; - - /** - * This will be used to create a [`NavigationRoute`](https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.routing.NavigationRoute) that will respond to [navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) for URLs that that aren't precached. - * This is meant to be used in a [Single Page App](https://en.wikipedia.org/wiki/Single-page_application) scenario, in which you want all navigations to use common App Shell HTML. - * It's not intended for use as a fallback that's displayed when the browser is offline. - * @default undefined - * @example navigateFallback: '/app-shell' - */ - navigateFallback?: string - - /** - * An optional array of regular expressions that restricts which URLs the configured navigateFallback behavior applies to. - * This is useful if only a subset of your site's URLs should be treated as being part of a Single Page App. - * If both navigateFallbackBlacklist and navigateFallbackWhitelist are configured, the blacklist takes precedent. - * @default [] - * @example navigateFallbackBlacklist: [/^\/_/, /admin/] - */ - navigateFallbackBlacklist?: RegExp[] - - /** - * An optional array of regular expressions that restricts which URLs the configured navigateFallback behavior applies to. - * This is useful if only a subset of your site's URLs should be treated as being part of a Single Page App. - * If both navigateFallbackBlacklist and navigateFallbackWhitelist are configured, the blacklist takes precedent. - * @default [] - * @example navigateFallbackWhitelist: [/^\/pages/] - */ - navigateFallbackWhitelist?: RegExp[] - - /** - * An required list of JavaScript files that should be passed to [`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts) inside the generated service worker file. - * If one of the imported files sets the `self.__precacheManifest` variable to an array of [`ManifestEntrys`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestEntry), those entries will be automatically precached in the generated service worker. - * This is also useful when you want to let Workbox create your top-level service worker file, but want to include some additional code, such as a `push` event listener. - * @default [] - * @example importScripts: ['push-notifications.abcd1234.js'] - */ - importScripts?: string[] - - /** - * Any search parameter names that match against one of the regex's in this array will be removed before looking for a precache match. - * This is useful if your users might request URLs that contain, for example, URL parameters used to track the source of the traffic. Those URL parameters would normally cause the cache lookup to fail, since the URL strings used as cache keys would not be expected to include them. - * @default [/^utm_/] - * @example ignoreUrlParametersMatching: [/./] - */ - ignoreUrlParametersMatching?: RegExp[] - - /** - * If a [navigation request](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) for a URL ending in `/` fails to match a precached URL, this value will be appended to the URL and that will be checked for a precache match. - * This should be configured to whatever your web server is using, if anything, for its [directory index](https://httpd.apache.org/docs/2.0/mod/mod_dir.html). - * @default 'index.html' - * @example directoryIndex: 'index.html' - */ - directoryIndex?: string; - - /** - * An optional ID to be prepended to cache names used by Workbox. - * This is primarily useful for local development where multiple sites may be served from the same `http://localhost:port` origin. - * @default null - * @example cacheId: 'my-app' - */ - cacheId?: string | null; - - /** - * Controls whether or not to include support for [offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics). - * When `true`, `workbox.googleAnalytics.initialize()` will be added to your new service worker file. - * @default false - * @example offlineGoogleAnalytics: true - */ - offlineGoogleAnalytics?: boolean; - } - - export interface InjectManifestOptions extends CommonOptions { - /** - * The path to the source service worker file that can contain your own customized code, in addition to containing a match for `injectionPointRegexp`. - * Your service worker file should reference the `self.__precacheManifest` variable to obtain a list of [`ManifestEntrys`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestEntry) obtained as part of the compilation: `workbox.precaching.precacheAndRoute(self.__precacheManifest)`. - * @example swSrc: path.join('src', 'sw.js') - */ - swSrc: string; - } - - /** - * The `GenerateSW` plugin will create a service worker file for you and add it to the webpack asset pipeline. - * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin - */ - export class GenerateSW extends WebpackPlugin { - constructor (opts?: GenerateSWOptions); - } - - /** - * The `InjectManifest` plugin will generate a list of URLs to precache and add that precache manifest to an existing service worker file. It will otherwise leave the file as-is. - * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin - */ - export class InjectManifest extends WebpackPlugin { - constructor (opts?: InjectManifestOptions); - } +export interface ManifestEntry { + revision: string; + url: string; } -export = WorkboxWebpackPlugin +export interface RuntimeCacheOptions { + /** + * Fall back to the cache after X seconds. + */ + networkTimeoutSeconds?: number; + + /** + * A custom cache name for this route. + */ + cacheName?: string; + + /** + * Custom cache expiration. + */ + expiration?: { + /** + * Cache will only hold X entries. + */ + maxEntries?: number; + /** + * Cache will only hold entries for X seconds. + */ + maxAgeSeconds?: number; + }; + + /** + * Configure background sync. + */ + backgroundSync?: { + name: string; + options?: { + maxRetentionTime: number; + }; + }; + + /** + * Configure which responses are considered cacheable. + */ + cacheableResponse?: { + /** + * Only cache responses with HTTP code(s) listed. + */ + statuses?: number[]; + /** + * Only cache responses with headers which match this map. + */ + headers?: { [header: string]: string }; + }; + + /** + * Configure the broadcast cache update plugin. + */ + broadcastUpdate?: { + channelName?: string; + }; + + /** + * Add in any additional plugin logic you need. + */ + plugins?: any[]; + + /** + * Used to configure the handler. + */ + fetchOptions?: any; + + /** + * Used to configure the handler. + */ + matchOptions?: any; +} + +export interface RuntimeCacheRule { + /** + * Cache any same-origin request that matches the pattern. + */ + urlPattern?: string | RegExp; + + /** + * The `handler` values are strings, corresponding to names of the strategies supported by + * [`workbox.strategies`](https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.strategies#methods). + */ + handler?: ChacheStrategy; + + /** + * The `options` properties can be used to configure instances of the cache expiration, cacheable response, and broadcast cache update plugins to apply to a given route. + */ + options?: RuntimeCacheOptions; +} + +export interface CommonOptions { + /** + * The path and filename of the service worker file that will be created by the build process, relative to the webpack output directory. + * + * @default 'service-worker.js' + * @example swDest: 'custom-sw-name.js' + */ + swDest?: string; + + /** + * Valid values are `'cdn'`, `'local'`, and `'disabled'`. + * + * - `'cdn'`, the default, will use a URL for the Workbox runtime libraries hosted on a highly-available Google Cloud Storage instance. + * + * - `'local'` will copy all of the Workbox runtime libraries into a versioned directory alongside your generated service worker, and configure the service worker to use those local copies. + * This option is provided for developers who would prefer to host everything themselves and not rely on the Google Cloud Storage CDN. + * + * - `'disabled'` will opt-out automatic behavior. It's up to you to host a local copy of the Workbox libraries at your preferred URL, and to pass in the correct path to `workbox-sw.js` + * via the `importScripts` configuration option. + * + * - Note: In webpack, passing in a string corresponding to the webpack chunk name containing a custom Workbox runtime library bundle is also supported. + * + * @default 'cdn' + * @example importWorkboxFrom: 'local' + */ + importWorkboxFrom?: 'cdn' | 'local' | 'disabled'; + + /** + * By default, Workbox will precache assets regardless of which chunk the asset is part of. + * + * If you would like to override this behavior via a whitelist, specify one or more chunk names. Only assets belonging to those chunks will be precached; + * any assets belonging to another chunk or without a chunk association will be skipped. + * + * @default [] + * @example chunks: ['chunk-name-1', 'chunk-name-2'] + */ + chunks?: string[]; + + /** + * By default, Workbox will precache all assets generated by the webpack compilation, regardless of which chunk the asset is part of. + * + * If you would like to override this behavior via a blacklist, specify one or more chunk names. Any assets belonging to those chunks will be skipped. + * + * @default [] + * @example excludeChunks: ['chunk-name-1', 'chunk-name-2'] + */ + excludeChunks?: string[]; + + /** + * This allows you to only include assets matching any of the provided criteria when creating the precache manifest. It provides a filename-based approach to filtering. + * + * This filtering takes place after any chunk-based filtering is applied. + * + * In keeping with [webpack convention](https://webpack.js.org/configuration/module/#condition), the option `test` can be used as an alias/alternative to `include`. + * + * @default [] + * @example include: [/\.html$/, /\.js$/] + * @alias test + */ + include?: Array; + test?: Array; + + /** + * This allows you to specifically omit assets matching any of the provided criteria from being included in the precache manifest. It provides a filename-based approach to filtering. + * + * This filtering takes place after any chunk-based filtering is applied. + * + * @default [/\.map$/, /^manifest.*\.js(?:on)?$/] + * @example exclude: [/\.jpg$/, /\.png$/] + */ + exclude?: Array; + + /** + * Workbox creates assets as part of your webpack build process: a precache manifest file, and potentially a local copy of the Workbox libraries (if `importWorkboxFrom` is set to `'local'`). + * + * These assets will, by default, be created at the root of your webpack build directory, i.e. `output.path`. You can set the `importsDirectory` option if you want these assets to be created in + * a subdirectory of `output.path` instead of at the top-level. + * + * Note: This option does not effect where the main service worker JavaScript file is created. That is determined by the `swDest` option. + * + * @default '' + * @example importsDirectory: 'wb-assets' + */ + importsDirectory?: string; + + /** + * Workbox automatically creates a JavaScript file that contains information about URLs that need to be precached. By default, this file is called `precache-manifest.[manifestHash].js`, + * where `[manifestHash]` is automatically replaced by a unique value that identifies the contents of the file. + * + * `precacheManifestFilename` can be used to override this default filename. You must include the string `[manifestHash]` somewhere as part of the filename. + * + * If you'd like to change the output directory to which the precache manifest is written, you can configure the `importsDirectory` option. + * + * @default 'precache-manifest.[manifestHash].js' + * @example precacheManifestFilename: 'wb-manifest.[manifestHash].js' + */ + precacheManifestFilename?: string; + + /** + * The base directory you wish to match `globPatterns` against, relative to the current working directory. + * + * If you do set this, make sure to also configure `globPatterns`. + * + * @default undefined + * @example globDirectory: '.' + */ + globDirectory?: string; + + /** + * Determines whether or not symlinks are followed when generating the precache manifest. + * + * For more information, see the definition of `follow` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * + * @default true + * @example globFollow: false + */ + globFollow?: boolean; + + /** + * A set of patterns matching files to always exclude when generating the precache manifest. + * + * For more information, see the definition of `ignore` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * + * @default ['node_modules/**\/*'] + * @example globIgnores: ['**\/ignored.html'] + */ + globIgnores?: string[]; + + /** + * Files matching against any of these patterns will be included in the precache manifest. + * + * For more information, see the [glob primer](https://github.com/isaacs/node-glob#glob-primer). + * + * Note: Setting `globPatterns` is often unnecessary when using the `workbox-webpack-plugin`, which will automatically precache files that are part of the webpack build pipeline by default. + * When using the webpack plugin, only set it when you need to cache + * [non-webpack assets](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#cache_additional_non-webpack_assets). + * + * @default [] + * @example globPatterns: ['dist/*.{js,png,html,css}'] + */ + globPatterns?: string[]; + + /** + * If `true`, an error reading a directory when generating a precache manifest will cause the build to fail. If `false`, the problematic directory will be skipped. + * + * For more information, see the definition of `strict` in the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * + * @default true + * @example globStrict: false + */ + globStrict?: boolean; + + /** + * If a URL is rendered generated based on some server-side logic, its contents may depend on multiple files or on some other unique string value. + * + * If used with an array of strings, they will be interpreted as glob patterns, and the contents of any files matching the patterns will be used to uniquely version the URL. + * + * If used with a single string, it will be interpreted as unique versioning information that you've generated out of band for a given URL. + * + * @default null + */ + templatedUrls?: { [url: string]: string | (string[]) } | null; + + /** + * This value can be used to determine the maximum size of files that will be precached. This prevents you from inadvertantly precaching very large files that might have + * accidentally matched one of your patterns. + * + * @default 2097152 + * @example maximumFileSizeToCacheInBytes: 4 * 1024 * 1024 + */ + maximumFileSizeToCacheInBytes?: number; + + /** + * Assets that match this regex will be assumed to be uniquely versioned via their URL, and exempted from the normal HTTP cache-busting that's done when populating the precache. + * + * While not required, it's recommended that if your existing build process already inserts a `[hash]` value into each filename, you provide a RegExp that will detect those values, + * as it will reduce the amount of bandwidth consumed when precaching. + * + * @default null + * @example dontCacheBustUrlsMatching: /\.\w{8}\./ + */ + dontCacheBustUrlsMatching?: RegExp | null; + + /** + * A mapping of prefixes that, if present in an entry in the precache manifest, will be replaced with the corresponding value. + * + * This can be used to, for example, remove or add a path prefix from a manifest entry if your web hosting setup doesn't match your local filesystem setup. + * + * As an alternative with more flexibility, you can use the `manifestTransforms` option and provide a function that modifies the entries in the manifest using whatever logic you provide. + * + * @default null + * @example modifyUrlPrefix: { '/dist': '' } + */ + modifyUrlPrefix?: { [url: string]: string } | null; + + /** + * One or more [`ManifestTransform`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestTransform) + * functions, which will be applied sequentially against the generated manifest. + * + * If `modifyUrlPrefix` or `dontCacheBustUrlsMatching` are also specified, their corresponding transformations will be applied first. + */ + manifestTransforms?: Array<(originalManifest: ReadonlyArray) => { manifest: ManifestEntry[], warnings?: string[] }> | null; +} + +export interface GenerateSWOptions extends CommonOptions { + /** + * Whether or not the service worker should skip over the waiting lifecycle stage. Normally this is used with `clientsClaim: true`. + * + * @default false + * @example skipWaiting: true + */ + skipWaiting?: boolean; + + /** + * Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim) + * any existing clients as soon as it activates. + * + * @default false + * @example clientsClaim: true + */ + clientsClaim?: boolean; + + /** + * Passing in an array of objects containing `urlPatterns`, `handlers`, and potentially `options` will add the appropriate code to the generated service worker to handle runtime caching. + * + * Requests for precached URLs that are picked up via `globPatterns` are handled by default, and don't need to be accommodated in `runtimeCaching`. + * + * @default [] + */ + runtimeCaching?: RuntimeCacheRule[]; + + /** + * This will be used to create a [`NavigationRoute`](https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.routing.NavigationRoute) + * that will respond to [navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) + * for URLs that that aren't precached. + * + * This is meant to be used in a [Single Page App](https://en.wikipedia.org/wiki/Single-page_application) scenario, in which you want all navigations to use common App Shell HTML. + * + * It's not intended for use as a fallback that's displayed when the browser is offline. + * + * @default undefined + * @example navigateFallback: '/app-shell' + */ + navigateFallback?: string; + + /** + * An optional array of regular expressions that restricts which URLs the configured navigateFallback behavior applies to. + * + * This is useful if only a subset of your site's URLs should be treated as being part of a Single Page App. + * + * If both navigateFallbackBlacklist and navigateFallbackWhitelist are configured, the blacklist takes precedent. + * + * @default [] + * @example navigateFallbackBlacklist: [/^\/_/, /admin/] + */ + navigateFallbackBlacklist?: RegExp[]; + + /** + * An optional array of regular expressions that restricts which URLs the configured navigateFallback behavior applies to. + * + * This is useful if only a subset of your site's URLs should be treated as being part of a Single Page App. + * + * If both navigateFallbackBlacklist and navigateFallbackWhitelist are configured, the blacklist takes precedent. + * + * @default [] + * @example navigateFallbackWhitelist: [/^\/pages/] + */ + navigateFallbackWhitelist?: RegExp[]; + + /** + * An required list of JavaScript files that should be passed to + * [`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts) inside the generated service worker file. + * + * If one of the imported files sets the `self.__precacheManifest` variable to an array of + * [`ManifestEntrys`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestEntry), + * those entries will be automatically precached in the generated service worker. + * + * This is also useful when you want to let Workbox create your top-level service worker file, but want to include some additional code, such as a `push` event listener. + * + * @default [] + * @example importScripts: ['push-notifications.abcd1234.js'] + */ + importScripts?: string[]; + + /** + * Any search parameter names that match against one of the regex's in this array will be removed before looking for a precache match. + * + * This is useful if your users might request URLs that contain, for example, URL parameters used to track the source of the traffic. + * Those URL parameters would normally cause the cache lookup to fail, since the URL strings used as cache keys would not be expected to include them. + * + * @default [/^utm_/] + * @example ignoreUrlParametersMatching: [/./] + */ + ignoreUrlParametersMatching?: RegExp[]; + + /** + * If a [navigation request](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) + * for a URL ending in `/` fails to match a precached URL, this value will be appended to the URL and that will be checked for a precache match. + * + * This should be configured to whatever your web server is using, if anything, for its [directory index](https://httpd.apache.org/docs/2.0/mod/mod_dir.html). + * + * @default 'index.html' + * @example directoryIndex: 'index.html' + */ + directoryIndex?: string; + + /** + * An optional ID to be prepended to cache names used by Workbox. + * + * This is primarily useful for local development where multiple sites may be served from the same `http://localhost:port` origin. + * + * @default null + * @example cacheId: 'my-app' + */ + cacheId?: string | null; + + /** + * Controls whether or not to include support for [offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics). + * + * When `true`, `workbox.googleAnalytics.initialize()` will be added to your new service worker file. + * + * @default false + * @example offlineGoogleAnalytics: true + */ + offlineGoogleAnalytics?: boolean; +} + +export interface InjectManifestOptions extends CommonOptions { + /** + * The path to the source service worker file that can contain your own customized code, in addition to containing a match for `injectionPointRegexp`. + * + * Your service worker file should reference the `self.__precacheManifest` variable to obtain a list of + * [`ManifestEntrys`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.ManifestEntry) obtained as part of the compilation: + * `workbox.precaching.precacheAndRoute(self.__precacheManifest)`. + * + * @example swSrc: path.join('src', 'sw.js') + */ + swSrc: string; +} + +/** + * The `GenerateSW` plugin will create a service worker file for you and add it to the webpack asset pipeline. + * + * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin + */ +export class GenerateSW { + constructor(opts?: GenerateSWOptions); + apply(...args: any[]): void; +} + +/** + * The `InjectManifest` plugin will generate a list of URLs to precache and add that precache manifest to an existing service worker file. It will otherwise leave the file as-is. + * + * @see https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin + */ +export class InjectManifest { + constructor(opts?: InjectManifestOptions); + apply(...args: any[]): void; +} From e821f3072d516a04c66f6ad35dfa4b8f425c303c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Mon, 7 Jan 2019 15:49:11 +0800 Subject: [PATCH 130/646] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=EF=BC=8C=E8=B7=AF=E7=94=B1=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 327 +++++++++++++++++++++++++++++-------- 1 file changed, 258 insertions(+), 69 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index dcc3cd3e16..0882745c2f 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace wx { + // import startPullDownRefresh = swan.startPullDownRefresh; type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; type ResponseCallback = (res: any) => void; @@ -87,6 +88,8 @@ declare namespace wx { [key: string]: any } + // 网络 + // 发起请求 interface RequestHeader { [key: string]: string; } @@ -109,9 +112,79 @@ declare namespace wx { /** * wx.request发起的是https请求。一个微信小程序,同时只能有5个网络请求连接。 */ - function request(options: RequestOptions): void; + function request(options: RequestOptions): RequestTask; + /** + * 网络请求任务对象 + */ + interface RequestTask { + // 中断请求任务 + abort(): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } + // 下载 + interface OnProgressCallbackOptions { + // 下载进度百分比 + progress: number; + // 已经下载的数据长度,单位 Bytes + totalBytesWritten: number; + // 预期需要下载的数据总长度,单位 Bytes + totalBytesExpectedToWrite: number; + } + /** + * 一个可以监听下载进度变化事件,以及取消下载任务的对象 + */ + interface DownloadTask { + // 中断下载任务 + abort(): void; + // 下载进度变化事件的回调函数 + onProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 取消监听下载进度变化事件 + offProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } + interface DownloadFileOptions { + /** 下载资源的 url */ + url: string; + /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ + type?: string; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ + success?: TempFileResponseCallback; + /** 接口调用失败的回调函数 */ + fail?: ResponseCallback; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ResponseCallback; + } + /** + * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, + * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 + */ + function downloadFile(options: DownloadFileOptions): DownloadTask; + // 上传 + /** + * 一个可以监听上传进度变化事件,以及取消上传任务的对象 + */ + interface UploadTask { + // 中断上传任务 + abort(): void; + // 上传进度变化事件的回调函数 + onProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 取消监听上传进度变化事件 + offProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } interface UploadFileOptions { /** 开发者服务器 url */ url: string; @@ -137,30 +210,9 @@ declare namespace wx { * 客户端发起一个 HTTPS POST 请求, * 其中 Content-Type 为 multipart/form-data 。 */ - function uploadFile(options: UploadFileOptions): void; - - - interface DownloadFileOptions { - /** 下载资源的 url */ - url: string; - /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ - type?: string; - /** HTTP 请求 Header */ - header?: RequestHeader; - /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ - success?: TempFileResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, - * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 - */ - function downloadFile(options: DownloadFileOptions): void; - + function uploadFile(options: UploadFileOptions): UploadTask; + // WebSocket interface ConnectSocketOptions { /** 开发者服务器接口地址,必须是 HTTPS 协议,且域名必须是后台配置的合法域名 */ url: string; @@ -440,6 +492,29 @@ declare namespace wx { */ function chooseVideo(options: ChooseVideoOptions): void; + // 数据缓存 + interface StorageInfo { + // 当前 storage 中所有的 key + keys: Array; + // 当前占用的空间大小, 单位 KB + currentSize: number; + // 限制的空间大小,单位 KB + limitSize: number; + } + type StorageInfoCallback = (res: StorageInfoOptions) => void; + interface StorageInfoOptions extends CommonCallbackOptions{ + success?: StorageInfoCallback; + } + /** + * getStorageInfo的同步版本 + */ + function getStorageInfoSync(): StorageInfo; + /** + * 异步获取当前storage的相关信息 + * @param options + */ + function getStorageInfo(options: StorageInfoOptions): void; + interface SetStorageOptions { /** 本地缓存中的指定的 key */ key: string; @@ -498,6 +573,9 @@ declare namespace wx { */ function clearStorageSync(): void; + // 媒体 + // 地图 TODO + interface LocationData { /** 纬度,浮点数,范围为-90~90,负数表示南纬 */ latitude: number; @@ -658,17 +736,36 @@ declare namespace wx { // 调试 TODO // 路由 - interface routerOptions { - + interface routerOptions extends CommonCallbackOptions{ + // 需要跳转的应用内非 tabBar 的页面的路径, 路径后可以带参数。参数与路径之间使用 ? 分隔,参数键与参数值用 = 相连,不同参数用 & 分隔;如 'path?key=value&key2=value2' + url: string; + } + interface NavigateBackOptions extends CommonCallbackOptions { + // 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 + delta: number; } /** * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。 */ - function navigateBack(): void; - function switchTab(): void; - function navigateTo(): void; - function reLaunch(): void; - function redirectTo(): void; + function navigateBack(options: NavigateBackOptions): void; + /** + * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 + * @param options + */ + function switchTab(options: routerOptions): void; + /** + * 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 wx.navigateBack 可以返回到原页面。 + * @param options + */ + function navigateTo(options: routerOptions): void; + /** + * 关闭所有页面,打开到应用内的某个页面 + */ + function reLaunch(options: routerOptions): void; + /** + * 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 + */ + function redirectTo(options: routerOptions): void; // 界面 // 交互 @@ -689,8 +786,11 @@ declare namespace wx { * 公共回调函数 */ interface CommonCallbackOptions { + // 接口调用成功回调函数 success?: ResponseCallback; + // 接口调用失败回调函数 fail?: ResponseCallback; + // 接口调用结束的回调函数 complete?: ResponseCallback; } @@ -798,7 +898,133 @@ declare namespace wx { // 背景 function setBackgroundTextStyle(): void; + interface BackgroundColorOptions extends CommonCallbackOptions{ + // 窗口的背景色,必须为十六进制颜色值 + backgroundColor?: string; + // 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 + backgroundColorTop?: string; + // 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 + backgroundColorBottom?: string; + } function setBackgroundColor(): void; + // Tab Bar + interface TabBarItemOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + // tab 上的按钮文字 + text?: string; + // 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效,不支持网络图片 + iconPath?: string; + // 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效 + selectedIconPath?: string; + } + /** + * 动态设置 tabBar 某一项的内容 + * @param options + */ + function setTabBarItem(options: TabBarItemOptions): void; + + interface TabBarStyleOptions extends CommonCallbackOptions{ + // tab 上的文字默认颜色,HexColor + color: string; + // tab 上的文字选中时的颜色,HexColor + selectedColor: string; + // tab 的背景色,HexColor + backgroundColor: string; + // tabBar上边框的颜色, 仅支持 black/white + borderStyle: string; + } + /** + * 动态设置tabBar的整体样式 + */ + function setTabBarStyle(options: TabBarItemOptions): void; + + interface TabBarAnimationOptions extends CommonCallbackOptions{ + // 是否需要动画效果 + animation: boolean; + } + /** + * 隐藏tabBar + */ + function hideTabBar(options: TabBarAnimationOptions): void; + /** + * 显示tabBar + */ + function showTabBar(options: TabBarAnimationOptions): void; + + interface TabBarRedDotOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + } + /** + * 隐藏 tabBar 某一项的右上角的红点 + * @param options + */ + function hideTabBarRedDot(options: TabBarBadgeOptions): void; + /** + * 显示 tabBar 某一项的右上角的红点 + * @param options + */ + function showTabBarRedDot(options: TabBarRedDotOptions): void; + + interface TabBarBadgeOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + // 显示的文本,超过 4 个字符则显示成 ... + text: string; + } + /** + * 移除 tabBar 某一项右上角的文本 + * @param options + */ + function removeTabBarBadge(options: TabBarRedDotOptions): void; + /** + * 为 tabBar 某一项的右上角添加文本 + * @param options + */ + function setTabBarBadge(options: TabBarBadgeOptions): void; + + interface FontDescOptions { + // 字体样式,可选值为 normal / italic / oblique + style?: string; + // 字体粗细,可选值为 normal / bold / 100 / 200../ 900 + weight?: string; + // 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit + variant?: string; + } + // 字体 + interface FontFaceOptions extends CommonCallbackOptions{ + // 定义的字体名称 + family: string; + // 字体资源的地址。建议格式为 TTF 和 WOFF,WOFF2 在低版本的iOS上会不兼容。 + source: string; + // 可选的字体描述符 + desc?: FontDescOptions; + } + function loadFontFace(options: FontFaceOptions): void; + + // 下拉刷新 + /** + * 停止当前页面下拉刷新。 + */ + function stopPullDownRefresh(options?: CommonCallbackOptions): void; + + /** + * 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 + */ + function startPullDownRefresh(options?: CommonCallbackOptions): void; + + // 滚动 + interface PageScrollToOptions extends CommonCallbackOptions{ + // 滚动到页面的目标位置,单位 px + scrollTop: number; + // 滚动动画的时长,单位 ms。默认300 + duration: number; + } + /** + * 将页面滚动到 + */ + function pageScrollTo(): void; interface AccelerometerData { /** X 轴 */ @@ -845,46 +1071,9 @@ declare namespace wx { */ function hideNavigationBarLoading(): void; - interface NavigateToOptions { - /** 需要跳转的应用内页面的路径 */ - url: string; - /** 成功获取系统信息的回调 */ - success?: ResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 保留当前页面,跳转到应用内的某个页面,使用wx.navigateBack可以返回到原页面。 - * - * 注意:为了不让用户在使用小程序时造成困扰, - * 我们规定页面路径只能是五层,请尽量避免多层级的交互方式。 - */ - function navigateTo(options: NavigateToOptions): void; - - interface RedirectToOptions { - /** 需要跳转的应用内页面的路径 */ - url: string; - /** 成功获取系统信息的回调 */ - success?: ResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 关闭当前页面,跳转到应用内的某个页面。 - */ - function redirectTo(options: RedirectToOptions): void; - - /** - * 关闭当前页面,回退前一页面。 - */ - function navigateBack(): void; - type TimingFunction = 'linear' | 'ease' | 'ease-in' | 'ease-in-out' | 'ease-out' | 'step-start' | 'step-end'; + // 动画 interface CreateAnimationOptions { /** 动画持续时间,单位ms,默认值 400 */ duration?: number; From 034e6e8e62595317c33ef3a4227be3bc81401c08 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Mon, 7 Jan 2019 09:40:23 +0100 Subject: [PATCH 131/646] The Set.Animate requires support for optional tuples, TS3.0 required --- types/snapsvg/index.d.ts | 4 ++-- types/snapsvg/test/4.ts | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index ca08eb1eff..cc9c4f3627 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -5,7 +5,7 @@ // Andrey Kurdyumov , // Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 3.0 /// export = Snap; @@ -305,7 +305,7 @@ declare namespace Snap { export interface Set { animate(attrs:{[attr:string]:string|number|boolean|any},duration:number,easing?:(num:number)=>number,callback?:()=>void):Snap.Set; - animate(...params:Array<{attrs:any,duration:number,easing:(num:number)=>number,callback?:()=>void}>):Snap.Set; + animate(...attrs:[{[attr:string]:string|number|boolean|any},number?,((num:number)=>number)?,(()=>void)?][]):Snap.Element; attr(params:{[attr:string]:string|number|boolean|BBox|any}):Snap.Set; attr(param:"viewBox"):Snap.Set; attr(param:string):Snap.Set; diff --git a/types/snapsvg/test/4.ts b/types/snapsvg/test/4.ts index 6fcf8a2a95..cfe9b40b14 100644 --- a/types/snapsvg/test/4.ts +++ b/types/snapsvg/test/4.ts @@ -2,7 +2,7 @@ // Tests by Terry Mun // Checks that Snap.set() is properly typed - const s = Snap(200, 500); + const s = Snap(300, 500); s.attr({ viewBox: '0 0 200 500' }); @@ -34,6 +34,18 @@ }); } + // Animate elements individually + function animateMultipleTest() { + return new Promise(resolve => { + rectSet.animate( + [{ x: 100 }, 500, mina.linear], + [{ x: 100 }, 1000, mina.linear], + [{ x: 100 }, 1500, mina.linear], + [{ x: 100 }, 2000, mina.linear, resolve] + ); + }); + } + // Animate elements individually function forEachTest() { const colors = ['red', 'green', 'blue']; @@ -52,7 +64,7 @@ return new Promise(resolve => { rectSet.exclude(rect4); rectSet.animate({ - x: 100 + x: 150 }, 500, mina.bounce, resolve); }); } @@ -95,6 +107,7 @@ // Start test async function startTest() { await animateTest(); + await animateMultipleTest(); await forEachTest(); await excludeTest(); await spliceTest(); From f968fb1e6c8a198d9c5e090d606c695a38fcea0c Mon Sep 17 00:00:00 2001 From: Johan Brook Date: Mon, 7 Jan 2019 10:31:38 +0100 Subject: [PATCH 132/646] HLS.js: Add support for custom logger object in `debug` option --- types/hls.js/hls.js-tests.ts | 9 ++++++++- types/hls.js/index.d.ts | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/types/hls.js/hls.js-tests.ts b/types/hls.js/hls.js-tests.ts index 934ee1fd9c..90176ae6b7 100644 --- a/types/hls.js/hls.js-tests.ts +++ b/types/hls.js/hls.js-tests.ts @@ -23,7 +23,14 @@ class pLoader extends Hls.DefaultConfig.loader { if (Hls.isSupported()) { const video = document.getElementById('video'); - const hls = new Hls({ pLoader, startFragPrefetch: true }); + const hls = new Hls({ + pLoader, + startFragPrefetch: true, + debug: { + log: (...args: any[]) => console.log(...args) + } + }); + const version: string = Hls.version; hls.loadSource('http://www.streambox.fr/playlists/test_001/stream.m3u8'); hls.attachMedia(video); diff --git a/types/hls.js/index.d.ts b/types/hls.js/index.d.ts index 721f4a3dce..fe75d8456f 100644 --- a/types/hls.js/index.d.ts +++ b/types/hls.js/index.d.ts @@ -1,8 +1,9 @@ // Type definitions for hls.js 0.10 // Project: https://github.com/video-dev/hls.js // Definitions by: John G. Gainfort, Jr. +// Johan Brook // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.4 // Event Keys type K_MEDIA_ATTACHING = "hlsMediaAttaching"; @@ -307,6 +308,16 @@ declare namespace Hls { // interface SubtitleTracks {} + type CustomLogger = (...args: any[]) => void; + + interface CustomLoggerObject { + warn?: CustomLogger; + info?: CustomLogger; + log?: CustomLogger; + debug?: CustomLogger; + error?: CustomLogger; + } + interface Config { /** * (default: false) @@ -319,7 +330,7 @@ declare namespace Hls { * setting config.debug = true; will turn on debug logs on JS console. * a logger object could also be provided for custom logging: config.debug = customLogger; */ - debug: boolean; + debug: boolean | CustomLoggerObject; /** * (default: true) * if set to true, start level playlist and first fragments will be loaded automatically, after triggering of Hls.Events.MANIFEST_PARSED event From 85013ba4f5a1e0abd669aa2dc3d6ec78d2a8de63 Mon Sep 17 00:00:00 2001 From: Johan Brook Date: Mon, 7 Jan 2019 10:49:14 +0100 Subject: [PATCH 133/646] HLS.js: Add `liveBackBufferLength` property to Hls.Config --- types/hls.js/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/hls.js/index.d.ts b/types/hls.js/index.d.ts index fe75d8456f..9ea4f3db17 100644 --- a/types/hls.js/index.d.ts +++ b/types/hls.js/index.d.ts @@ -486,6 +486,14 @@ declare namespace Hls { * Android Google Chrome, etc. set this value to true. */ liveDurationInfinity: boolean; + /** + * (default: Infinity) + * Sets the maximum length of the buffer, in seconds, to keep during a live stream. Any video + * buffered past this time will be evicted. Infinity means no restriction on back buffer length; + * 0 keeps the minimum amount. The minimum amount is equal to the target duration of a segment + * to ensure that current playback is not interrupted. + */ + liveBackBufferLength: number; /** * (default: true) * Enable WebWorker (if available on browser) for TS demuxing/MP4 remuxing, to improve performance and avoid lag/frame drops. From 6528fd7ab1add2bd87d8a9bf2513495b5118a84d Mon Sep 17 00:00:00 2001 From: Johan Brook Date: Mon, 7 Jan 2019 10:49:27 +0100 Subject: [PATCH 134/646] HLS.js: Bump version to 0.12 --- types/hls.js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hls.js/index.d.ts b/types/hls.js/index.d.ts index 9ea4f3db17..9b7986b99f 100644 --- a/types/hls.js/index.d.ts +++ b/types/hls.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for hls.js 0.10 +// Type definitions for hls.js 0.12 // Project: https://github.com/video-dev/hls.js // Definitions by: John G. Gainfort, Jr. // Johan Brook From a65dcd6f408e70df9440b09e90df716bfce7df9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Mon, 7 Jan 2019 11:48:33 +0100 Subject: [PATCH 135/646] Removed createProvider function. --- types/react-redux/index.d.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 408ef1ad9a..ff69f6b33d 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -420,15 +420,6 @@ export interface ProviderProps { */ export class Provider extends Component> { } -/** - * Creates a new which will set the Redux Store on the passed key of the context. You probably only need this - * if you are in the inadvisable position of having multiple stores. You will also need to pass the same storeKey to the - * options argument of connect. - * - * @param storeKey The key of the context on which to set the store. - */ -export function createProvider(storeKey: string): typeof Provider; - /** * Exposes the internal context used in react-redux. It is generally advised to use the connect HOC to connect to the * redux store instead of this approeach. From d1bd470288cd98dbe3049d061b31192911881b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Mon, 7 Jan 2019 11:51:52 +0100 Subject: [PATCH 136/646] Renamed type of inner value of context. --- types/react-redux/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index ff69f6b33d..ef39b6d87c 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -394,10 +394,10 @@ export interface ConnectOptions { * * @default ReactReduxContext */ - context?: Context; + context?: Context; } -export interface ReactReduxContextObject { +export interface ReactReduxContextValue { store: Store; storeState: SS; } @@ -412,7 +412,7 @@ export interface ProviderProps { * If this is used, generate own connect HOC by using connectAdvanced, supplying the same context provided to the * Provider. Initial value doesn't matter, as it is overwritten with the internal state of Provider. */ - context?: Context; + context?: Context; } /** @@ -424,4 +424,4 @@ export class Provider extends Component; +export const ReactReduxContext: Context; From 1bf6e46582c2754f4e2e81b63e72255abd195854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Mon, 7 Jan 2019 11:52:07 +0100 Subject: [PATCH 137/646] Adapted tests to changes. --- types/react-redux/react-redux-tests.tsx | 48 ++----------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 017ba61d30..36cbe588ec 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject, Reducer } from 'redux'; -import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options, ReactReduxContext, ReactReduxContextObject } from 'react-redux'; +import { Connect, connect, Provider, DispatchProp, MapStateToProps, Options, ReactReduxContext, ReactReduxContextValue } from 'react-redux'; import objectAssign = require('object-assign'); // @@ -920,50 +920,6 @@ function TestWrappedComponent() { const TestConnected = (props: any) => ; } -function TestCreateProvider() { - const STORE_KEY = 'myStore'; - - const MyStoreProvider = createProvider(STORE_KEY); - - const myStoreConnect: Connect = ( - mapStateToProps?: any, - mapDispatchToProps?: any, - mergeProps?: any, - options: Options = {}, - ) => { - options.storeKey = STORE_KEY; - return connect( - mapStateToProps, - mapDispatchToProps, - mergeProps, - options, - ); - }; - - interface State { a: number; } - const store = createStore(() => ({ a: 1 })); - const myStore = createStore(() => ({ a: 2 })); - - interface AProps { a: number; } - const A = (props: AProps) => (

A is {props.a}

); - const A1 = connect(state => state)(A); - const A2 = myStoreConnect(state => state)(A); - - const Combined = () => ( - - - - - - - ); - - // This renders: - //

A is 1

- //

A is 2

- ReactDOM.render(, document.body); -} - function TestWithoutTOwnPropsDecoratedInference() { interface ForwardedProps { forwarded: string; @@ -1219,7 +1175,7 @@ function TestProviderContext() { ; // $ExpectError // Providing a an object of the correct type ensures type safety when consuming the context. - const initialContextValue: ReactReduxContextObject = { storeState: null, store }; + const initialContextValue: ReactReduxContextValue = { storeState: null, store }; const context = React.createContext(initialContextValue); ; From 2c69e217c77bda2571ac9618d83cee54488e786a Mon Sep 17 00:00:00 2001 From: MaikTizziani Date: Mon, 7 Jan 2019 11:55:51 +0100 Subject: [PATCH 138/646] added load method definition to Parameters --- types/twig/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/twig/index.d.ts b/types/twig/index.d.ts index d09e713e44..1959b30a95 100644 --- a/types/twig/index.d.ts +++ b/types/twig/index.d.ts @@ -18,6 +18,7 @@ export interface Parameters { options?: any; data?: any; async?: any; + load?: (template: Template) => void; } export interface Template { From 18cad92afed85e7a911d4ea714771048667ed577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Mon, 7 Jan 2019 12:00:18 +0100 Subject: [PATCH 139/646] Added files from v6 folder with files from version 6.0. --- types/react-redux/v6/index.d.ts | 412 +++++++ types/react-redux/v6/package.json | 6 + types/react-redux/v6/react-redux-tests.tsx | 1212 ++++++++++++++++++++ types/react-redux/v6/tsconfig.json | 26 + types/react-redux/v6/tslint.json | 3 + 5 files changed, 1659 insertions(+) create mode 100644 types/react-redux/v6/index.d.ts create mode 100644 types/react-redux/v6/package.json create mode 100644 types/react-redux/v6/react-redux-tests.tsx create mode 100644 types/react-redux/v6/tsconfig.json create mode 100644 types/react-redux/v6/tslint.json diff --git a/types/react-redux/v6/index.d.ts b/types/react-redux/v6/index.d.ts new file mode 100644 index 0000000000..bcbcced0bd --- /dev/null +++ b/types/react-redux/v6/index.d.ts @@ -0,0 +1,412 @@ +// Type definitions for react-redux 6.0 +// Project: https://github.com/reduxjs/react-redux +// Definitions by: Qubo , +// Kenzie Togami , +// Curits Layne +// Frank Tan +// Nicholas Boll +// Dibyo Majumdar +// Prashant Deva +// Thomas Charlat +// Valentin Descamps +// Johann Rakotoharisoa +// Anatoli Papirovski +// Boris Sergeyev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +// Known Issue: +// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes +// they are decorating. Due to this, if you are using @connect() decorator in your code, +// you will see a bunch of errors from TypeScript. The current workaround is to use connect() as a function call on +// a separate line instead of as a decorator. Discussed in this github issue: +// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20796 + +// NOTE about the wrong react-redux version in the header comment: +// The actual react-redux version is not 6.0.0, but we had to increase the major version +// to update this type definitions for redux@4.x from redux@3.x. +// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25321 + +import { + Component, + ComponentClass, + ComponentType, + StatelessComponent +} from 'react'; + +import { + Action, + ActionCreator, + AnyAction, + Dispatch, + Store +} from 'redux'; + +// Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html +export type Omit = Pick>; + +export interface DispatchProp
{ + dispatch: Dispatch; +} + +export type AdvancedComponentDecorator = + (component: ComponentType) => ComponentClass; + +/** + * A property P will be present if: + * - it is present in DecorationTargetProps + * + * Its value will be dependent on the following conditions + * - if property P is present in InjectedProps and its definition extends the definition + * in DecorationTargetProps, then its definition will be that of DecorationTargetProps[P] + * - if property P is not present in InjectedProps then its definition will be that of + * DecorationTargetProps[P] + * - if property P is present in InjectedProps but does not extend the + * DecorationTargetProps[P] definition, its definition will be that of InjectedProps[P] + */ +export type Matching = { + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; +}; + +/** + * a property P will be present if : + * - it is present in both DecorationTargetProps and InjectedProps + * - InjectedProps[P] can satisfy DecorationTargetProps[P] + * ie: decorated component can accept more types than decorator is injecting + * + * For decoration, inject props or ownProps are all optionally + * required by the decorated (right hand side) component. + * But any property required by the decorated component must be satisfied by the injected property. + */ +export type Shared< + InjectedProps, + DecorationTargetProps extends Shared + > = { + [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; + }; + +// Infers prop type from component C +export type GetProps = C extends ComponentType ? P : never; + +// Applies LibraryManagedAttributes (proper handling of defaultProps +// and propTypes), as well as defines WrappedComponent. +export type ConnectedComponentClass = ComponentClass> & { + WrappedComponent: C; +}; + +// Injects props and removes them from the prop requirements. +// Will not pass through the injected props if they are passed in during +// render. Also adds new prop requirements from TNeedsProps. +export type InferableComponentEnhancerWithProps = + >>>( + component: C + ) => ConnectedComponentClass, keyof Shared>> & TNeedsProps>; + +// Injects props and removes them from the prop requirements. +// Will not pass through the injected props if they are passed in during +// render. +export type InferableComponentEnhancer = + InferableComponentEnhancerWithProps; + +export type InferThunkActionCreatorType any> = + TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn + ? (...args: TParams) => TReturn + : TActionCreator; + +export type HandleThunkActionCreator = + TActionCreator extends (...args: any[]) => any + ? InferThunkActionCreatorType + : TActionCreator; + +// redux-thunk middleware returns thunk's return value from dispatch call +// https://github.com/reduxjs/redux-thunk#composition +export type ResolveThunks = + TDispatchProps extends { [key: string]: any } + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps; + +/** + * Connects a React component to a Redux store. + * + * - Without arguments, just wraps the component, without changing the behavior / props + * + * - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior + * is to override ownProps (as stated in the docs), so what remains is everything that's + * not a state or dispatch prop + * + * - When 3rd param is passed, we don't know if ownProps propagate and whether they + * should be valid component props, because it depends on mergeProps implementation. + * As such, it is the user's responsibility to extend ownProps interface from state or + * dispatch props or both when applicable + * + * @param mapStateToProps + * @param mapDispatchToProps + * @param mergeProps + * @param options + */ +export interface Connect { + // tslint:disable:no-unnecessary-generics + (): InferableComponentEnhancer; + + ( + mapStateToProps: MapStateToPropsParam + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsNonObject + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: null | undefined, + mapDispatchToProps: TDispatchProps, + ): InferableComponentEnhancerWithProps< + ResolveThunks, + TOwnProps + >; + + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsNonObject + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: TDispatchProps, + ): InferableComponentEnhancerWithProps< + TStateProps & ResolveThunks, + TOwnProps + >; + + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: null | undefined, + mergeProps: MergeProps, + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: MergeProps, + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: null | undefined, + mapDispatchToProps: null | undefined, + mergeProps: MergeProps, + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: MergeProps, + options?: Options + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: null | undefined, + mergeProps: null | undefined, + options: Options + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsNonObject, + mergeProps: null | undefined, + options: Options<{}, TStateProps, TOwnProps> + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: null | undefined, + mapDispatchToProps: TDispatchProps, + mergeProps: null | undefined, + options: Options<{}, TStateProps, TOwnProps> + ): InferableComponentEnhancerWithProps< + ResolveThunks, + TOwnProps + >; + + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsNonObject, + mergeProps: null | undefined, + options: Options + ): InferableComponentEnhancerWithProps; + + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: TDispatchProps, + mergeProps: null | undefined, + options: Options + ): InferableComponentEnhancerWithProps< + TStateProps & ResolveThunks, + TOwnProps + >; + // tslint:enable:no-unnecessary-generics +} + +/** + * The connect function. See {@type Connect} for details. + */ +export const connect: Connect; + +export type MapStateToProps = + (state: State, ownProps: TOwnProps) => TStateProps; + +export type MapStateToPropsFactory = + (initialState: State, ownProps: TOwnProps) => MapStateToProps; + +export type MapStateToPropsParam = MapStateToPropsFactory | MapStateToProps | null | undefined; + +export type MapDispatchToPropsFunction = + (dispatch: Dispatch, ownProps: TOwnProps) => TDispatchProps; + +export type MapDispatchToProps = + MapDispatchToPropsFunction | TDispatchProps; + +export type MapDispatchToPropsFactory = + (dispatch: Dispatch, ownProps: TOwnProps) => MapDispatchToPropsFunction; + +export type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; + +export type MapDispatchToPropsNonObject = MapDispatchToPropsFactory | MapDispatchToPropsFunction; + +export type MergeProps = + (stateProps: TStateProps, dispatchProps: TDispatchProps, ownProps: TOwnProps) => TMergedProps; + +export interface Options extends ConnectOptions { + /** + * If true, implements shouldComponentUpdate and shallowly compares the result of mergeProps, + * preventing unnecessary updates, assuming that the component is a “pure” component + * and does not rely on any input or state other than its props and the selected Redux store’s state. + * Defaults to true. + * @default true + */ + pure?: boolean; + + /** + * When pure, compares incoming store state to its previous value. + * @default strictEqual + */ + areStatesEqual?: (nextState: State, prevState: State) => boolean; + + /** + * When pure, compares incoming props to its previous value. + * @default shallowEqual + */ + areOwnPropsEqual?: (nextOwnProps: TOwnProps, prevOwnProps: TOwnProps) => boolean; + + /** + * When pure, compares the result of mapStateToProps to its previous value. + * @default shallowEqual + */ + areStatePropsEqual?: (nextStateProps: TStateProps, prevStateProps: TStateProps) => boolean; + + /** + * When pure, compares the result of mergeProps to its previous value. + * @default shallowEqual + */ + areMergedPropsEqual?: (nextMergedProps: TMergedProps, prevMergedProps: TMergedProps) => boolean; +} + +/** + * Connects a React component to a Redux store. It is the base for {@link connect} but is less opinionated about + * how to combine state, props, and dispatch into your final props. It makes no + * assumptions about defaults or memoization of results, leaving those responsibilities to the caller.It does not + * modify the component class passed to it; instead, it returns a new, connected component class for you to use. + * + * @param selectorFactory The selector factory. See SelectorFactory type for details. + * @param connectOptions If specified, further customizes the behavior of the connector. Additionally, any extra + * options will be passed through to your selectorFactory in the factoryOptions argument. + */ +export function connectAdvanced( + // tslint:disable-next-line no-unnecessary-generics + selectorFactory: SelectorFactory, + connectOptions?: ConnectOptions & TFactoryOptions +): AdvancedComponentDecorator; + +/** + * Initializes a selector function (during each instance's constructor). That selector function is called any time the + * connector component needs to compute new props, as a result of a store state change or receiving new props. The + * result of selector is expected to be a plain object, which is passed as the props to the wrapped + * component. If a consecutive call to selector returns the same object (===) as its previous + * call, the component will not be re-rendered. It's the responsibility of selector to return that + * previous object when appropriate. + */ +export type SelectorFactory = + (dispatch: Dispatch, factoryOptions: TFactoryOptions) => Selector; + +export type Selector = (state: S, ownProps: TOwnProps) => TProps; + +export interface ConnectOptions { + /** + * Computes the connector component's displayName property relative to that of the wrapped component. Usually + * overridden by wrapper functions. + * + * @default name => 'ConnectAdvanced('+name+')' + * @param componentName + */ + getDisplayName?: (componentName: string) => string; + /** + * Shown in error messages. Usually overridden by wrapper functions. + * + * @default 'connectAdvanced' + */ + methodName?: string; + /** + * If defined, a property named this value will be added to the props passed to the wrapped component. Its value + * will be the number of times the component has been rendered, which can be useful for tracking down unnecessary + * re-renders. + * + * @default undefined + */ + renderCountProp?: string; + /** + * Controls whether the connector component subscribes to redux store state changes. If set to false, it will only + * re-render on componentWillReceiveProps. + * + * @default true + */ + shouldHandleStateChanges?: boolean; + /** + * The key of props/context to get the store. You probably only need this if you are in the inadvisable position of + * having multiple stores. + * + * @default 'store' + */ + storeKey?: string; + /** + * If true, stores a ref to the wrapped component instance and makes it available via getWrappedInstance() method. + * + * @default false + */ + withRef?: boolean; +} + +export interface ProviderProps { + /** + * The single Redux store in your application. + */ + store: Store; +} + +/** + * Makes the Redux store available to the connect() calls in the component hierarchy below. + */ +export class Provider extends Component> { } + +/** + * Creates a new which will set the Redux Store on the passed key of the context. You probably only need this + * if you are in the inadvisable position of having multiple stores. You will also need to pass the same storeKey to the + * options argument of connect. + * + * @param storeKey The key of the context on which to set the store. + */ +export function createProvider(storeKey: string): typeof Provider; diff --git a/types/react-redux/v6/package.json b/types/react-redux/v6/package.json new file mode 100644 index 0000000000..7f5b19d45b --- /dev/null +++ b/types/react-redux/v6/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "redux": "^4.0.0" + } +} diff --git a/types/react-redux/v6/react-redux-tests.tsx b/types/react-redux/v6/react-redux-tests.tsx new file mode 100644 index 0000000000..554ace09ff --- /dev/null +++ b/types/react-redux/v6/react-redux-tests.tsx @@ -0,0 +1,1212 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject, Reducer } from 'redux'; +import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options } from 'react-redux'; +import objectAssign = require('object-assign'); + +// +// Quick Start +// https://github.com/rackt/react-redux/blob/master/docs/quick-start.md#quick-start +// + +// Test cases written in a way to isolate types and variables and verify the +// output of `connect` to make sure the signature is what is expected + +function Empty() { + interface OwnProps { + dispatch: Dispatch; + foo: string; + } + + class TestComponent extends React.Component {} + + const Test = connect()(TestComponent); + + const verify = ; +} + +function MapState() { + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + + class TestComponent extends React.Component {} + + const mapStateToProps = (_: any) => ({ + bar: 1 + }); + + const Test = connect( + mapStateToProps + )(TestComponent); + + const verify = ; +} + +function MapStateWithDispatchProp() { + interface OwnProps { foo: string; } + interface StateProps { bar: number; dispatch: Dispatch; } + + class TestComponent extends React.Component {} + + const mapStateToProps = (_: any) => ({ + bar: 1 + }); + + const Test = connect( + mapStateToProps + )(TestComponent); + + const verify = ; +} + +function MapStateFactory() { + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + + class TestComponent extends React.Component {} + + const mapStateToProps = () => () => ({ + bar: 1 + }); + + const Test = connect( + mapStateToProps + )(TestComponent); + + const verify = ; +} + +function MapDispatch() { + interface OwnProps { foo: string; } + interface DispatchProps { onClick: () => void; } + + class TestComponent extends React.Component {} + + const mapDispatchToProps = () => ({ + onClick: () => {} + }); + + const TestNull = connect( + null, + mapDispatchToProps, + )(TestComponent); + + const verifyNull = ; + + const TestUndefined = connect( + undefined, + mapDispatchToProps, + )(TestComponent); + + const verifyUndefined = ; +} + +function MapDispatchWithThunkActionCreators() { + const simpleAction = (payload: boolean) => ({ + type: 'SIMPLE_ACTION', + payload, + }); + const thunkAction = (param1: number, param2: string) => ( + async (dispatch: Dispatch, { foo }: OwnProps) => { + return foo; + } + ); + interface OwnProps { + foo: string; + } + interface TestComponentProps extends OwnProps { + simpleAction: typeof simpleAction; + thunkAction(param1: number, param2: string): Promise; + } + class TestComponent extends React.Component {} + + const mapStateToProps = ({ foo }: { foo: string }) => ({ foo }); + const mapDispatchToProps = { simpleAction, thunkAction }; + + const Test1 = connect(null, mapDispatchToProps)(TestComponent); + const Test2 = connect(mapStateToProps, mapDispatchToProps)(TestComponent); + const Test3 = connect( + null, mapDispatchToProps, null, { storeKey: 'somekey' } + )(TestComponent); + const Test4 = connect( + mapStateToProps, mapDispatchToProps, null, { storeKey: 'somekey' } + )(TestComponent); + const verify =
+ ; + + ; + +
; +} + +function MapManualDispatchThatLooksLikeThunk() { + interface OwnProps { + foo: string; + } + interface TestComponentProps extends OwnProps { + remove: (item: string) => () => object; + } + class TestComponent extends React.Component { + render() { + return
; + } + } + + const mapStateToProps = ({ foo }: { foo: string }) => ({ foo }); + function mapDispatchToProps(dispatch: Dispatch) { + return { + remove(item: string) { + return () => dispatch({ type: 'REMOVE_ITEM', item }); + } + }; + } + + const Test1 = connect(null, mapDispatchToProps)(TestComponent); + const Test2 = connect(mapStateToProps, mapDispatchToProps)(TestComponent); + const Test3 = connect( + null, mapDispatchToProps, null, { storeKey: 'somekey' } + )(TestComponent); + const Test4 = connect( + mapStateToProps, mapDispatchToProps, null, { storeKey: 'somekey' } + )(TestComponent); + const verify =
+ ; + + ; + +
; +} + +function MapStateAndDispatchObject() { + interface ClickPayload { count: number; } + const onClick: ActionCreator = () => ({ count: 1 }); + const dispatchToProps = { + onClick, + }; + + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + interface DispatchProps { onClick: ActionCreator; } + + const mapStateToProps = (_: any, __: OwnProps): StateProps => ({ + bar: 1 + }); + + class TestComponent extends React.Component {} + + const Test = connect( + mapStateToProps, + dispatchToProps, + )(TestComponent); + + const verify = ; +} + +function MapDispatchFactory() { + interface OwnProps { foo: string; } + interface DispatchProps { onClick: () => void; } + + class TestComponent extends React.Component {} + + const mapDispatchToPropsFactory = () => () => ({ + onClick: () => {} + }); + + const TestNull = connect( + null, + mapDispatchToPropsFactory, + )(TestComponent); + + const verifyNull = ; + + const TestUndefined = connect( + undefined, + mapDispatchToPropsFactory, + )(TestComponent); + + const verifyUndefined = ; +} + +function MapStateAndDispatch() { + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + interface DispatchProps { onClick: () => void; } + + class TestComponent extends React.Component {} + + const mapStateToProps = () => ({ + bar: 1 + }); + + const mapDispatchToProps = () => ({ + onClick: () => {} + }); + + const Test = connect( + mapStateToProps, + mapDispatchToProps, + )(TestComponent); + + const verify = ; +} + +function MapStateFactoryAndDispatch() { + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + interface DispatchProps { onClick: () => void; } + + const mapStateToPropsFactory = () => () => ({ + bar: 1 + }); + + const mapDispatchToProps = () => ({ + onClick: () => {} + }); + + class TestComponent extends React.Component {} + + const Test = connect( + mapStateToPropsFactory, + mapDispatchToProps, + )(TestComponent); + + const verify = ; +} + +function MapStateFactoryAndDispatchFactory() { + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + interface DispatchProps { onClick: () => void; } + + const mapStateToPropsFactory = () => () => ({ + bar: 1 + }); + + const mapDispatchToPropsFactory = () => () => ({ + onClick: () => {} + }); + + class TestComponent extends React.Component {} + + const Test = connect( + mapStateToPropsFactory, + mapDispatchToPropsFactory, + )(TestComponent); + + const verify = ; +} + +function MapStateAndDispatchAndMerge() { + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + interface DispatchProps { onClick: () => void; } + + class TestComponent extends React.Component {} + + const mapStateToProps = () => ({ + bar: 1 + }); + + const mapDispatchToProps = () => ({ + onClick: () => {} + }); + + const mergeProps = (stateProps: StateProps, dispatchProps: DispatchProps) => ( + { ...stateProps, ...dispatchProps } + ); + + const Test = connect( + mapStateToProps, + mapDispatchToProps, + mergeProps, + )(TestComponent); + + const verify = ; +} + +function MapStateAndOptions() { + interface State { state: string; } + interface OwnProps { foo: string; } + interface StateProps { bar: number; } + interface DispatchProps { dispatch: Dispatch; } + + class TestComponent extends React.Component {} + + const mapStateToProps = (state: State) => ({ + bar: 1 + }); + + const areStatePropsEqual = (next: StateProps, current: StateProps) => true; + + const Test = connect( + mapStateToProps, + null, + null, + { + pure: true, + areStatePropsEqual, + } + )(TestComponent); + + const verify = ; +} + +interface CounterState { + counter: number; +} +declare var increment: () => { type: string }; + +class Counter extends React.Component { + render() { + return ( + + ); + } +} + +function mapStateToProps(state: CounterState) { + return { + value: state.counter + }; +} + +// Which action creators does it want to receive by props? +function mapDispatchToProps(dispatch: Dispatch) { + return { + onIncrement: () => dispatch(increment()) + }; +} + +connect( + mapStateToProps, + mapDispatchToProps +)(Counter); + +@connect(mapStateToProps) +class CounterContainer extends React.Component { +} + +// Ensure connect's first two arguments can be replaced by wrapper functions +interface CounterStateProps { + value: number; +} +interface CounterDispatchProps { + onIncrement: () => void; +} +// with higher order functions +connect( + () => mapStateToProps, + () => mapDispatchToProps +)(Counter); +// with higher order functions using parameters +connect( + (initialState: CounterState, ownProps) => mapStateToProps, + (dispatch: Dispatch, ownProps) => mapDispatchToProps +)(Counter); +// only first argument +connect( + () => mapStateToProps +)(Counter); +// wrap only one argument +connect( + mapStateToProps, + () => mapDispatchToProps +)(Counter); +// with extra arguments +connect( + () => mapStateToProps, + () => mapDispatchToProps, + (s: CounterStateProps, d: CounterDispatchProps) => + objectAssign({}, s, d), + { pure: true } +)(Counter); + +class App extends React.Component { + render() { + return null; + } +} + +const targetEl = document.getElementById('root'); + +ReactDOM.render(( + + {() => } + +), targetEl); + +// +// API +// https://github.com/rackt/react-redux/blob/master/docs/api.md +// +declare var store: Store; +class MyRootComponent extends React.Component { +} +class TodoApp extends React.Component {} +interface TodoState { + todos: string[]|string; +} +interface TodoProps { + userId: number; +} +interface DispatchProps { + addTodo(userId: number, text: string): void; + action: () => any; +} +declare var actionCreators: () => { + action: () => any; +}; +declare var dispatchActionCreators: () => DispatchProps; +declare var addTodo: () => { type: string; }; +declare var todoActionCreators: { [type: string]: (...args: any[]) => any; }; +declare var counterActionCreators: { [type: string]: (...args: any[]) => any; }; + +ReactDOM.render( + + {() => } + , + document.body +); + +// Inject just dispatch and don't listen to store + +const AppWrap = (props: DispatchProp & { children?: React.ReactNode }) =>
; +const WrappedApp = connect()(AppWrap); + +; + +// Inject dispatch and every field in the global state + +connect((state: TodoState) => state)(TodoApp); + +// Inject dispatch and todos + +function mapStateToProps2(state: TodoState) { + return { todos: state.todos }; +} + +export default connect(mapStateToProps2)(TodoApp); + +connect(mapStateToProps2, actionCreators)(TodoApp); + +function mapDispatchToProps2(dispatch: Dispatch) { + return { actions: bindActionCreators(actionCreators, dispatch) }; +} + +connect(mapStateToProps2, mapDispatchToProps2)(TodoApp); + +// Inject todos and a specific action creator (addTodo) + +function mapDispatchToProps3(dispatch: Dispatch) { + return bindActionCreators({ addTodo }, dispatch); +} + +connect(mapStateToProps2, mapDispatchToProps3)(TodoApp); + +// Inject todos, todoActionCreators as todoActions, and counterActionCreators as counterActions + +function mapDispatchToProps4(dispatch: Dispatch) { + return { + todoActions: bindActionCreators(todoActionCreators, dispatch), + counterActions: bindActionCreators(counterActionCreators, dispatch) + }; +} + +connect(mapStateToProps2, mapDispatchToProps4)(TodoApp); + +// Inject todos, and todoActionCreators and counterActionCreators together as actions + +function mapDispatchToProps5(dispatch: Dispatch) { + return { + actions: bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch) + }; +} + +connect(mapStateToProps2, mapDispatchToProps5)(TodoApp); + +// Inject todos, and all todoActionCreators and counterActionCreators directly as props + +function mapDispatchToProps6(dispatch: Dispatch) { + return bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch); +} + +connect(mapStateToProps2, mapDispatchToProps6)(TodoApp); + +// Inject todos of a specific user depending on props + +function mapStateToProps3(state: TodoState, ownProps: TodoProps): TodoState { + return { todos: state.todos[ownProps.userId] }; +} + +connect(mapStateToProps3)(TodoApp); + +// Inject todos of a specific user depending on props, and inject props.userId into the action + +function mergeProps(stateProps: TodoState, dispatchProps: DispatchProps, ownProps: TodoProps): DispatchProps & TodoState & TodoProps { + return objectAssign({}, ownProps, dispatchProps, { + todos: stateProps.todos[ownProps.userId], + addTodo: (text: string) => dispatchProps.addTodo(ownProps.userId, text) + }); +} + +connect(mapStateToProps2, dispatchActionCreators, mergeProps)(MyRootComponent); + +// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14622#issuecomment-279820358 +// Allow for undefined mapStateToProps +connect(undefined, mapDispatchToProps6)(TodoApp); + +interface TestProp { + property1: number; + someOtherProperty?: string; +} +interface TestState { + isLoaded: boolean; + state1: number; +} +class TestComponent extends React.Component { } +const WrappedTestComponent = connect()(TestComponent); + +// return value of the connect()(TestComponent) is assignable to a ComponentClass +// ie: DispatchProp has been removed through decoration +const ADecoratedTestComponent: React.ComponentClass = WrappedTestComponent; +; + +const ATestComponent: React.ComponentClass = TestComponent; // $ExpectError + +// stateless functions +interface HelloMessageProps { + dispatch: Dispatch; + name: string; +} +const HelloMessage: React.StatelessComponent = (props) => { + return
Hello {props.name}
; +}; +const ConnectedHelloMessage = connect()(HelloMessage); +ReactDOM.render(, document.getElementById('content')); + +// stateless functions that uses mapStateToProps and mapDispatchToProps +function TestStatelessFunctionWithMapArguments() { + interface GreetingProps { + name: string; + onClick: () => void; + } + + function Greeting(props: GreetingProps) { + return
Hello {props.name}
; + } + + const mapStateToProps = (state: any, ownProps: GreetingProps) => { + return { + name: 'Connected! ' + ownProps.name + }; + }; + + const mapDispatchToProps = (dispatch: Dispatch, ownProps: GreetingProps) => { + return { + onClick: () => { + dispatch({ type: 'GREETING', name: ownProps.name }); + } + }; + }; + + const ConnectedGreeting = connect( + mapStateToProps, + mapDispatchToProps + )(Greeting); +} + +// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/8787 +function TestTOwnPropsInference() { + interface OwnProps { + own: string; + } + + interface StateProps { + state: string; + } + + class OwnPropsComponent extends React.Component { + render() { + return
; + } + } + + function mapStateToPropsWithoutOwnProps(state: any): StateProps { + return { state: 'string' }; + } + + function mapStateToPropsWithOwnProps(state: any, ownProps: OwnProps): StateProps { + return { state: 'string' }; + } + + const ConnectedWithoutOwnProps = connect(mapStateToPropsWithoutOwnProps)(OwnPropsComponent); + const ConnectedWithOwnProps = connect(mapStateToPropsWithOwnProps)(OwnPropsComponent); + const ConnectedWithTypeHint = connect(mapStateToPropsWithoutOwnProps)(OwnPropsComponent); + + // This should not compile, which is good. + // React.createElement(ConnectedWithoutOwnProps, { anything: 'goes!' }); + + // This compiles, as expected. + React.createElement(ConnectedWithOwnProps, { own: 'string' }); + + // This should not compile, which is good. + // React.createElement(ConnectedWithOwnProps, { anything: 'goes!' }); + + // This compiles, as expected. + React.createElement(ConnectedWithTypeHint, { own: 'string' }); + + // This should not compile, which is good. + // React.createElement(ConnectedWithTypeHint, { anything: 'goes!' }); + + interface AllProps { + own: string; + state: string; + } + + class AllPropsComponent extends React.Component { + render() { + return
; + } + } + + type PickedOwnProps = Pick; + type PickedStateProps = Pick; + + const mapStateToPropsForPicked: MapStateToProps = (state: any): PickedStateProps => { + return { state: "string" }; + }; + const ConnectedWithPickedOwnProps = connect(mapStateToPropsForPicked)(AllPropsComponent); + ; +} + +// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16021 +function TestMergedPropsInference() { + interface StateProps { + state: string; + } + + interface DispatchProps { + dispatch: string; + } + + interface OwnProps { + own: string; + } + + interface MergedProps { + merged: string; + } + + class MergedPropsComponent extends React.Component { + render() { + return
; + } + } + + function mapStateToProps(state: any): StateProps { + return { state: 'string' }; + } + + function mapDispatchToProps(dispatch: Dispatch): DispatchProps { + return { dispatch: 'string' }; + } + + const ConnectedWithOwnAndState: React.ComponentClass = connect( + mapStateToProps, + undefined, + (stateProps: StateProps) => ({ + merged: "merged", + }), + )(MergedPropsComponent); + + const ConnectedWithOwnAndDispatch: React.ComponentClass = connect( + undefined, + mapDispatchToProps, + (stateProps: undefined, dispatchProps: DispatchProps) => ({ + merged: "merged", + }), + )(MergedPropsComponent); + + const ConnectedWithOwn: React.ComponentClass = connect( + undefined, + undefined, + () => ({ + merged: "merged", + }), + )(MergedPropsComponent); +} + +function Issue16652() { + interface PassedProps { + commentIds: string[]; + } + + interface GeneratedStateProps { + comments: Array<({ id: string } | undefined)>; + } + + class CommentList extends React.Component {} + + const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { + return { + comments: ownProps.commentIds.map(id => ({ id })), + }; + }; + + const ConnectedCommentList = connect(mapStateToProps)( + CommentList + ); + + ; +} + +function Issue15463() { + interface SpinnerProps { + showGlobalSpinner: boolean; + } + + class SpinnerClass extends React.Component { + render() { + return (
); + } + } + + const Spinner = connect((state: any) => { + return { showGlobalSpinner: true }; + })(SpinnerClass); + + ; +} + +function RemoveInjectedAndPassOnRest() { + interface TProps { + showGlobalSpinner: boolean; + foo: string; + } + class SpinnerClass extends React.Component { + render() { + return (
); + } + } + + const Spinner = connect((state: any) => { + return { showGlobalSpinner: true }; + })(SpinnerClass); + + ; +} + +function TestControlledComponentWithoutDispatchProp() { + interface MyState { + count: number; + } + + interface MyProps { + label: string; + // `dispatch` is optional, but setting it to anything + // other than Dispatch will cause an error + // + // dispatch: Dispatch; // OK + // dispatch: number; // ERROR + } + + function mapStateToProps(state: MyState) { + return { + label: `The count is ${state.count}`, + }; + } + + class MyComponent extends React.Component { + render() { + return {this.props.label}; + } + } + + const MyFuncComponent = (props: MyProps) => ( + {props.label} + ); + + const MyControlledComponent = connect(mapStateToProps)(MyComponent); + const MyControlledFuncComponent = connect(mapStateToProps)(MyFuncComponent); +} + +function TestDispatchToPropsAsObject() { + const onClick: ActionCreator<{}> = () => ({}); + const mapStateToProps = (state: any) => { + return { + title: state.app.title as string, + }; + }; + const dispatchToProps = { + onClick, + }; + + type Props = { title: string; } & typeof dispatchToProps; + const HeaderComponent: React.StatelessComponent = (props) => { + return

{props.title}

; + }; + + const Header = connect(mapStateToProps, dispatchToProps)(HeaderComponent); +
; +} + +function TestInferredFunctionalComponentWithExplicitOwnProps() { + interface Props { + title: string; + extraText: string; + onClick: () => void; + } + + const Header = connect( + ( + { app: { title }}: { app: { title: string }}, + { extraText }: { extraText: string } + ) => ({ + title, + extraText + }), + (dispatch) => ({ + onClick: () => dispatch({ type: 'test' }) + }) + )(({ title, extraText, onClick }: Props) => { + return

{title} {extraText}

; + }); +
; +} + +function TestInferredFunctionalComponentWithImplicitOwnProps() { + interface Props { + title: string; + extraText: string; + onClick: () => void; + } + + const Header = connect( + ( + { app: { title }}: { app: { title: string }}, + ) => ({ + title, + }), + (dispatch) => ({ + onClick: () => dispatch({ type: 'test' }) + }) + )(({ title, extraText, onClick }: Props) => { + return

{title} {extraText}

; + }); +
; +} + +function TestWrappedComponent() { + interface InnerProps { + name: string; + } + const Inner: React.StatelessComponent = (props) => { + return

{props.name}

; + }; + + const mapStateToProps = (state: any) => { + return { + name: "Connected", + }; + }; + const Connected = connect(mapStateToProps)(Inner); + + // `Inner` and `Connected.WrappedComponent` require explicit `name` prop + const TestInner = (props: any) => ; + const TestWrapped = (props: any) => ; + // `Connected` does not require explicit `name` prop + const TestConnected = (props: any) => ; +} + +function TestCreateProvider() { + const STORE_KEY = 'myStore'; + + const MyStoreProvider = createProvider(STORE_KEY); + + const myStoreConnect: Connect = ( + mapStateToProps?: any, + mapDispatchToProps?: any, + mergeProps?: any, + options: Options = {}, + ) => { + options.storeKey = STORE_KEY; + return connect( + mapStateToProps, + mapDispatchToProps, + mergeProps, + options, + ); + }; + + interface State { a: number; } + const store = createStore(() => ({ a: 1 })); + const myStore = createStore(() => ({ a: 2 })); + + interface AProps { a: number; } + const A = (props: AProps) => (

A is {props.a}

); + const A1 = connect(state => state)(A); + const A2 = myStoreConnect(state => state)(A); + + const Combined = () => ( + + + + + + + ); + + // This renders: + //

A is 1

+ //

A is 2

+ ReactDOM.render(, document.body); +} + +function TestWithoutTOwnPropsDecoratedInference() { + interface ForwardedProps { + forwarded: string; + } + + interface OwnProps { + own: string; + } + + interface StateProps { + state: string; + } + + class WithoutOwnPropsComponentClass extends React.Component> { + render() { + return
; + } + } + + const WithoutOwnPropsComponentStateless: React.StatelessComponent> = () => (
); + + function mapStateToProps4(state: any, ownProps: OwnProps): StateProps { + return { state: 'string' }; + } + + // these decorations should compile, it is perfectly acceptable to receive props and ignore them + const ConnectedWithOwnPropsClass = connect(mapStateToProps4)(WithoutOwnPropsComponentClass); + const ConnectedWithOwnPropsStateless = connect(mapStateToProps4)(WithoutOwnPropsComponentStateless); + const ConnectedWithTypeHintClass = connect(mapStateToProps4)(WithoutOwnPropsComponentClass); + const ConnectedWithTypeHintStateless = connect(mapStateToProps4)(WithoutOwnPropsComponentStateless); + + // This should compile + React.createElement(ConnectedWithOwnPropsClass, { own: 'string', forwarded: 'string' }); + React.createElement(ConnectedWithOwnPropsClass, { own: 'string', forwarded: 'string' }); + + // This should not compile, it is missing ForwardedProps + React.createElement(ConnectedWithOwnPropsClass, { own: 'string' }); // $ExpectError + React.createElement(ConnectedWithOwnPropsStateless, { own: 'string' }); // $ExpectError + + // This should compile + React.createElement(ConnectedWithOwnPropsClass, { own: 'string', forwarded: 'string' }); + React.createElement(ConnectedWithOwnPropsStateless, { own: 'string', forwarded: 'string' }); + + // This should not compile, it is missing ForwardedProps + React.createElement(ConnectedWithTypeHintClass, { own: 'string' }); // $ExpectError + React.createElement(ConnectedWithTypeHintStateless, { own: 'string' }); // $ExpectError + + interface AllProps { + own: string; + state: string; + } + + class AllPropsComponent extends React.Component> { + render() { + return
; + } + } + + type PickedOwnProps = Pick; + type PickedStateProps = Pick; + + const mapStateToPropsForPicked: MapStateToProps = (state: any): PickedStateProps => { + return { state: "string" }; + }; + const ConnectedWithPickedOwnProps = connect(mapStateToPropsForPicked)(AllPropsComponent); + ; +} + +// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25321#issuecomment-387659500 +function ProviderAcceptsStoreWithCustomAction() { + const reducer: Reducer< + { foo: number } | undefined, + { type: "foo"; payload: number } + > = state => state; + + const store = createStore(reducer); + + const Whatever = () => ( + +
Whatever
+
+ ); +} + +function TestOptionalPropsMergedCorrectly() { + interface OptionalDecorationProps { + foo: string; + bar: number; + optionalProp?: boolean; + dependsOnDispatch?: () => void; + } + + class Component extends React.Component { + render() { + return
; + } + } + + interface MapStateProps { + foo: string; + bar: number; + optionalProp: boolean; + } + + interface MapDispatchProps { + dependsOnDispatch: () => void; + } + + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + optionalProp: true, + }; + } + + function mapDispatchToProps(dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } + + connect(mapStateToProps, mapDispatchToProps)(Component); +} + +function TestMoreGeneralDecorationProps() { + // connect() should support decoration props that are more permissive + // than the injected props, as long as the injected props can satisfy + // the decoration props. + interface MoreGeneralDecorationProps { + foo: string | number; + bar: number | 'foo'; + optionalProp?: boolean | object; + dependsOnDispatch?: () => void; + } + + class Component extends React.Component { + render() { + return
; + } + } + + interface MapStateProps { + foo: string; + bar: number; + optionalProp: boolean; + } + + interface MapDispatchProps { + dependsOnDispatch: () => void; + } + + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + optionalProp: true, + }; + } + + function mapDispatchToProps(dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } + + connect(mapStateToProps, mapDispatchToProps)(Component); +} + +function TestFailsMoreSpecificInjectedProps() { + interface MoreSpecificDecorationProps { + foo: string; + bar: number; + dependsOnDispatch: () => void; + } + + class Component extends React.Component { + render() { + return
; + } + } + + interface MapStateProps { + foo: string | number; + bar: number | 'foo'; + dependsOnDispatch?: () => void; + } + + interface MapDispatchProps { + dependsOnDispatch?: () => void; + } + + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + }; + } + + function mapDispatchToProps(dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } + + // Since it is possible the injected props could fail to satisfy the decoration props, + // the following line should fail to compile. + connect(mapStateToProps, mapDispatchToProps)(Component); // $ExpectError + + // Confirm that this also fails with functional components + const FunctionalComponent = (props: MoreSpecificDecorationProps) => null; + connect(mapStateToProps, mapDispatchToProps)(Component); // $ExpectError +} + +function TestLibraryManagedAttributes() { + interface OwnProps { + bar: number; + fn: () => void; + } + + interface MapStateProps { + foo: string; + } + + class Component extends React.Component { + static defaultProps = { + bar: 0, + }; + + render() { + return
; + } + } + + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + }; + } + + const ConnectedComponent = connect(mapStateToProps)(Component); + {}} />; + + const ConnectedComponent2 = connect(mapStateToProps)(Component); + {}} />; +} diff --git a/types/react-redux/v6/tsconfig.json b/types/react-redux/v6/tsconfig.json new file mode 100644 index 0000000000..5fa4508cd8 --- /dev/null +++ b/types/react-redux/v6/tsconfig.json @@ -0,0 +1,26 @@ +{ + "files": [ + "index.d.ts", + "react-redux-tests.tsx" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "experimentalDecorators": true, + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/types/react-redux/v6/tslint.json b/types/react-redux/v6/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-redux/v6/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From c3652f1370bbd035df63d43dfe6102b824f031ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Mon, 7 Jan 2019 12:10:27 +0100 Subject: [PATCH 140/646] Fixed path mapping for v6. --- types/react-redux/v6/tsconfig.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/types/react-redux/v6/tsconfig.json b/types/react-redux/v6/tsconfig.json index 5fa4508cd8..ad66941f90 100644 --- a/types/react-redux/v6/tsconfig.json +++ b/types/react-redux/v6/tsconfig.json @@ -11,16 +11,21 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, + "strictNullChecks": false, "strictFunctionTypes": true, - "baseUrl": "../", + "baseUrl": "../../", "jsx": "react", "experimentalDecorators": true, "typeRoots": [ - "../" + "../../" ], + "paths": { + "react-redux": [ + "react-redux/v6" + ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} From 37573444ef76fa53c88ebaab4a94c722d821fe71 Mon Sep 17 00:00:00 2001 From: MaikTizziani Date: Mon, 7 Jan 2019 12:23:54 +0100 Subject: [PATCH 141/646] added contributor name --- types/twig/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/twig/index.d.ts b/types/twig/index.d.ts index 1959b30a95..fcfb1806dd 100644 --- a/types/twig/index.d.ts +++ b/types/twig/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/twigjs/twig.js // Definitions by: Carlos Ballesteros Velasco // Tim Schumacher +// Maik Tizziani // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/twig.d.ts From 15c3901e688afed16c5dd300891b7c9710d08aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Mon, 7 Jan 2019 12:58:21 +0100 Subject: [PATCH 142/646] tsconfig. --- types/react-redux/v6/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-redux/v6/tsconfig.json b/types/react-redux/v6/tsconfig.json index ad66941f90..82085150da 100644 --- a/types/react-redux/v6/tsconfig.json +++ b/types/react-redux/v6/tsconfig.json @@ -11,7 +11,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../../", "jsx": "react", From ca9a09cf6434a37a69dd7dcfd3dc40c53d9d5a29 Mon Sep 17 00:00:00 2001 From: ryuuji3 Date: Mon, 7 Jan 2019 13:11:39 +0000 Subject: [PATCH 143/646] Removed unnededed import 'AnySchema' from Joi --- types/hapi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index dec96e0c6c..e5d4905057 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -29,7 +29,7 @@ import * as zlib from 'zlib'; import { MimosOptions } from 'mimos'; import { SealOptions, SealOptionsSub } from 'iron'; -import { AnySchema, ValidationOptions, SchemaMap, Schema } from 'joi'; +import { ValidationOptions, SchemaMap, Schema } from 'joi'; import Podium = require('podium'); import { PolicyOptionVariants, EnginePrototypeOrObject, PolicyOptions, EnginePrototype, Policy } from 'catbox'; From 62448ddf78d61bb9f2db512529eb0f0ca6ddd2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Mon, 7 Jan 2019 15:19:19 +0200 Subject: [PATCH 144/646] fix(Operation): default to wide type --- types/stellar-sdk/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 82ee2f583e..2663704322 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -311,7 +311,7 @@ export namespace StellarBase { } type SignerOptions = SignerEd25519PublicKeyOptions | SignerSha256HashOptions | SignerPreAuthTxOptions; type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; - interface SetOptions extends Operation { + interface SetOptions extends Operation { inflationDest?: string; clearFlags?: AuthFlags; setFlags?: AuthFlags; From 4fd0ffd900369f307b49177a316fe596c08aa97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Mon, 7 Jan 2019 15:20:21 +0200 Subject: [PATCH 145/646] fix: add default type argument everywhere --- types/stellar-sdk/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 2663704322..14d3b1d30e 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -347,7 +347,7 @@ export namespace StellarBase { } function bumpSequence(options: BumpSequenceOptions): xdr.Operation; - function fromXDRObject(xdrOperation: xdr.Operation): T; + function fromXDRObject(xdrOperation: xdr.Operation): T; } namespace StrKey { @@ -384,7 +384,7 @@ export namespace StellarBase { class TransactionBuilder { constructor(sourceAccount: Account, options?: TransactionBuilder.TransactionBuilderOptions) - addOperation(operation: xdr.Operation): this; + addOperation(operation: xdr.Operation): this; addMemo(memo: Memo): this; build(): Transaction; } @@ -407,8 +407,8 @@ export namespace StellarBase { toXDR(base?: string): Buffer; toXDR(encoding: string): string; } - class Operation extends XDRStruct { - static fromXDR(xdr: Buffer): Operation; + class Operation extends XDRStruct { + static fromXDR(xdr: Buffer): Operation; } class Asset extends XDRStruct { static fromXDR(xdr: Buffer): Asset; @@ -512,7 +512,7 @@ export class Server { } export namespace Server { - abstract class CallBuilder { + abstract class CallBuilder { constructor(serverUrl: string) call(): Promise>; cursor(cursor: string): this; @@ -521,7 +521,7 @@ export namespace Server { stream(options?: { onmessage?: (record: T) => void, onerror?: (error: Error) => void }): () => void; } - interface CollectionPage { + interface CollectionPage { records: T[]; next: () => Promise>; prev: () => Promise>; @@ -539,7 +539,7 @@ export namespace Server { } /* Due to a bug with the recursive function requests */ - interface CollectionRecord { + interface CollectionRecord { _links: { next: RecordLink prev: RecordLink @@ -556,8 +556,8 @@ export namespace Server { order?: 'asc' | 'desc'; } - type CallFunction = () => Promise; - type CallCollectionFunction = + type CallFunction = () => Promise; + type CallCollectionFunction = (options?: CallFunctionTemplateOptions) => Promise>; interface BalanceLineNative { From 327548b8300ff2c930bc42bc9d60f7205b569147 Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Mon, 7 Jan 2019 11:34:22 -0200 Subject: [PATCH 146/646] feat(graphql): add tsource and tcontext type parameters to graphql, fix #31941 --- types/graphql/execution/execute.d.ts | 6 ++-- types/graphql/type/definition.d.ts | 32 +++++++++---------- types/graphql/type/introspection.d.ts | 12 +++---- types/graphql/type/schema.d.ts | 16 +++++----- .../utilities/getOperationRootType.d.ts | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index fc6ad898d1..aff0cc0dd3 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -136,7 +136,7 @@ export function buildExecutionContext( */ export function collectFields( exeContext: ExecutionContext, - runtimeType: GraphQLObjectType, + runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode, fields: { [key: string]: Array }, visitedFragmentNames: { [key: string]: boolean } @@ -146,7 +146,7 @@ export function buildResolveInfo( exeContext: ExecutionContext, fieldDef: GraphQLField, fieldNodes: ReadonlyArray, - parentType: GraphQLObjectType, + parentType: GraphQLObjectType, path: ResponsePath ): GraphQLResolveInfo; @@ -180,6 +180,6 @@ export const defaultFieldResolver: GraphQLFieldResolver; */ export function getFieldDef( schema: GraphQLSchema, - parentType: GraphQLObjectType, + parentType: GraphQLObjectType, fieldName: string ): Maybe>; diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index 1df7c85690..a33c81cd3b 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -28,7 +28,7 @@ import { GraphQLSchema } from "./schema"; */ export type GraphQLType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -44,9 +44,9 @@ export function isScalarType(type: any): type is GraphQLScalarType; export function assertScalarType(type: any): GraphQLScalarType; -export function isObjectType(type: any): type is GraphQLObjectType; +export function isObjectType(type: any): type is GraphQLObjectType; -export function assertObjectType(type: any): GraphQLObjectType; +export function assertObjectType(type: any): GraphQLObjectType; export function isInterfaceType(type: any): type is GraphQLInterfaceType; @@ -91,14 +91,14 @@ export function assertInputType(type: any): GraphQLInputType; */ export type GraphQLOutputType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType | GraphQLList | GraphQLNonNull< | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -121,7 +121,7 @@ export function assertLeafType(type: any): GraphQLLeafType; /** * These types may describe the parent context of a selection set. */ -export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; +export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; export function isCompositeType(type: any): type is GraphQLCompositeType; @@ -214,7 +214,7 @@ export function assertWrappingType(type: any): GraphQLWrappingType; */ export type GraphQLNullableType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -234,7 +234,7 @@ export function getNullableType(type: GraphQLNonN */ export type GraphQLNamedType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -342,15 +342,15 @@ export interface GraphQLScalarTypeConfig { * }); * */ -export class GraphQLObjectType { +export class GraphQLObjectType { name: string; description: Maybe; astNode: Maybe; extensionASTNodes: Maybe>; - isTypeOf: Maybe>; + isTypeOf: Maybe>; - constructor(config: GraphQLObjectTypeConfig); - getFields(): GraphQLFieldMap; + constructor(config: GraphQLObjectTypeConfig); + getFields(): GraphQLFieldMap; getInterfaces(): GraphQLInterfaceType[]; toString(): string; toJSON(): string; @@ -371,7 +371,7 @@ export type GraphQLTypeResolver = ( value: TSource, context: TContext, info: GraphQLResolveInfo -) => MaybePromise>; +) => MaybePromise | string>>; export type GraphQLIsTypeOfFn = ( source: TSource, @@ -390,7 +390,7 @@ export interface GraphQLResolveInfo { readonly fieldName: string; readonly fieldNodes: ReadonlyArray; readonly returnType: GraphQLOutputType; - readonly parentType: GraphQLObjectType; + readonly parentType: GraphQLObjectType; readonly path: ResponsePath; readonly schema: GraphQLSchema; readonly fragments: { [key: string]: FragmentDefinitionNode }; @@ -533,7 +533,7 @@ export class GraphQLUnionType { constructor(config: GraphQLUnionTypeConfig); - getTypes(): GraphQLObjectType[]; + getTypes(): GraphQLObjectType[]; toString(): string; toJSON(): string; @@ -542,7 +542,7 @@ export class GraphQLUnionType { export interface GraphQLUnionTypeConfig { name: string; - types: Thunk; + types: Thunk[]>; /** * Optionally provide a custom type resolver function. If one is not provided, * the default implementation will call `isTypeOf` on each implementing diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index beed0ebeb2..6047f7a3bd 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -10,13 +10,13 @@ import { } from "./definition"; import { GraphQLField } from "./definition"; -export const __Schema: GraphQLObjectType; -export const __Directive: GraphQLObjectType; +export const __Schema: GraphQLObjectType; +export const __Directive: GraphQLObjectType; export const __DirectiveLocation: GraphQLEnumType; -export const __Type: GraphQLObjectType; -export const __Field: GraphQLObjectType; -export const __InputValue: GraphQLObjectType; -export const __EnumValue: GraphQLObjectType; +export const __Type: GraphQLObjectType; +export const __Field: GraphQLObjectType; +export const __InputValue: GraphQLObjectType; +export const __EnumValue: GraphQLObjectType; export const TypeKind: { SCALAR: "SCALAR"; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index 7ccb390dbe..5d5a409af2 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -41,14 +41,14 @@ export class GraphQLSchema { constructor(config: GraphQLSchemaConfig); - getQueryType(): Maybe; - getMutationType(): Maybe; - getSubscriptionType(): Maybe; + getQueryType(): Maybe>; + getMutationType(): Maybe>; + getSubscriptionType(): Maybe>; getTypeMap(): TypeMap; getType(name: string): Maybe; - getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray; + getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray>; - isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; + isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; getDirectives(): ReadonlyArray; getDirective(name: string): Maybe; @@ -77,9 +77,9 @@ export interface GraphQLSchemaValidationOptions { } export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { - query: Maybe; - mutation?: Maybe; - subscription?: Maybe; + query: Maybe>; + mutation?: Maybe>; + subscription?: Maybe>; types?: Maybe; directives?: Maybe; astNode?: Maybe; diff --git a/types/graphql/utilities/getOperationRootType.d.ts b/types/graphql/utilities/getOperationRootType.d.ts index e1f88e7e13..b1ec93d02e 100644 --- a/types/graphql/utilities/getOperationRootType.d.ts +++ b/types/graphql/utilities/getOperationRootType.d.ts @@ -8,4 +8,4 @@ import { GraphQLObjectType } from "../type/definition"; export function getOperationRootType( schema: GraphQLSchema, operation: OperationDefinitionNode | OperationTypeDefinitionNode -): GraphQLObjectType; +): GraphQLObjectType; From 55870c87c816dfb2b9d74f85f1518089c1b15459 Mon Sep 17 00:00:00 2001 From: nasik Date: Mon, 7 Jan 2019 19:11:57 +0530 Subject: [PATCH 147/646] Added domcontentloaded event to page events --- types/puppeteer/index.d.ts | 4 ++++ types/puppeteer/puppeteer-tests.ts | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 2051603f69..c209316e03 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -1272,6 +1272,10 @@ export interface PageEventObj { * Puppeteer can respond to the dialog via Dialog's accept or dismiss methods. */ dialog: Dialog; + /** + * + */ + domcontentloaded: undefined; /** Emitted when the page crashes. */ error: Error; /** Emitted when a frame is attached. */ diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index e2a559d8e6..8232020c97 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -502,3 +502,20 @@ puppeteer.launch().then(async browser => { console.log(err instanceof TimeoutError); } }); + +// domcontentloaded page event test +(async () => { + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + page.on('domcontentloaded', async () => { + page.evaluate(() => { + console.log('dom changed'); + }); + }); + + try { + await page.goto('https://www.google.com'); + } catch (e) { + console.log("DOM CONTENT LOADED EVENT ERROR", e); + } +}); From 20a3ba3a8e90e05f8110f2cf0d190624ecfd8865 Mon Sep 17 00:00:00 2001 From: nasik Date: Mon, 7 Jan 2019 19:19:01 +0530 Subject: [PATCH 148/646] Added comments for the domcontentloaded event type. --- types/puppeteer/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index c209316e03..741c240744 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -1273,7 +1273,8 @@ export interface PageEventObj { */ dialog: Dialog; /** - * + * Emitted when the initial HTML document has been completely loaded and parsed, + * without waiting for stylesheets, images, and subframes to finish loading. */ domcontentloaded: undefined; /** Emitted when the page crashes. */ From 2950e9c28d11fb82802e07cb8f31996c499492ca Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Mon, 7 Jan 2019 12:46:42 -0200 Subject: [PATCH 149/646] feat(types): make graphql type parameters not required --- .../graphql-query-complexity/dist/QueryComplexity.d.ts | 2 +- types/graphql-relay/graphql-relay-tests.ts | 4 ++-- types/graphql-relay/index.d.ts | 10 +++++----- types/graphql/type/definition.d.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/types/graphql-query-complexity/dist/QueryComplexity.d.ts b/types/graphql-query-complexity/dist/QueryComplexity.d.ts index 898e2023bb..d092151f91 100644 --- a/types/graphql-query-complexity/dist/QueryComplexity.d.ts +++ b/types/graphql-query-complexity/dist/QueryComplexity.d.ts @@ -20,7 +20,7 @@ export default class QueryComplexity { onOperationDefinitionEnter(operation: OperationDefinitionNode): void; onOperationDefinitionLeave(): GraphQLError | undefined; nodeComplexity(node: FieldNode | FragmentDefinitionNode | InlineFragmentNode | - OperationDefinitionNode, typeDef: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, complexity?: number): number; + OperationDefinitionNode, typeDef: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, complexity?: number): number; createError(): GraphQLError; getDefaultComplexity(args: object, childScore: number): number; } diff --git a/types/graphql-relay/graphql-relay-tests.ts b/types/graphql-relay/graphql-relay-tests.ts index e490329b65..860fe1075f 100644 --- a/types/graphql-relay/graphql-relay-tests.ts +++ b/types/graphql-relay/graphql-relay-tests.ts @@ -49,8 +49,8 @@ const resolve: GraphQLFieldResolver = (source, args, context, info) => context.flag = "f"; }; const fields: GraphQLFieldConfigMap = {}; -let t: GraphQLObjectType; -let e: GraphQLObjectType; +let t: GraphQLObjectType; +let e: GraphQLObjectType; const def = connectionDefinitions({ connectionFields: fields, edgeFields: fields, diff --git a/types/graphql-relay/index.d.ts b/types/graphql-relay/index.d.ts index 67edfa3df0..a484429ed7 100644 --- a/types/graphql-relay/index.d.ts +++ b/types/graphql-relay/index.d.ts @@ -56,7 +56,7 @@ export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionAr export type ConnectionConfigNodeTypeNullable = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType; @@ -75,8 +75,8 @@ export interface ConnectionConfig { } export interface GraphQLConnectionDefinitions { - edgeType: GraphQLObjectType; - connectionType: GraphQLObjectType; + edgeType: GraphQLObjectType; + connectionType: GraphQLObjectType; } /** @@ -256,8 +256,8 @@ export interface GraphQLNodeDefinitions { nodesField: GraphQLFieldConfig; } -export type typeResolverFn = ((any: any) => GraphQLObjectType) | - ((any: any) => Promise); +export type typeResolverFn = ((any: any) => GraphQLObjectType) | + ((any: any) => Promise>); /** * Given a function to map from an ID to an underlying object, and a function diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index a33c81cd3b..42851d2f56 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -342,7 +342,7 @@ export interface GraphQLScalarTypeConfig { * }); * */ -export class GraphQLObjectType { +export class GraphQLObjectType { name: string; description: Maybe; astNode: Maybe; From 80a57fc00a05230db44460f3a241d14664e53476 Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Mon, 7 Jan 2019 12:56:09 -0200 Subject: [PATCH 150/646] feat(types): simplify types --- .../dist/QueryComplexity.d.ts | 2 +- types/graphql-relay/graphql-relay-tests.ts | 4 ++-- types/graphql-relay/index.d.ts | 10 ++++----- types/graphql/execution/execute.d.ts | 6 ++--- types/graphql/type/definition.d.ts | 22 +++++++++---------- types/graphql/type/introspection.d.ts | 12 +++++----- types/graphql/type/schema.d.ts | 16 +++++++------- .../utilities/getOperationRootType.d.ts | 2 +- 8 files changed, 37 insertions(+), 37 deletions(-) diff --git a/types/graphql-query-complexity/dist/QueryComplexity.d.ts b/types/graphql-query-complexity/dist/QueryComplexity.d.ts index d092151f91..898e2023bb 100644 --- a/types/graphql-query-complexity/dist/QueryComplexity.d.ts +++ b/types/graphql-query-complexity/dist/QueryComplexity.d.ts @@ -20,7 +20,7 @@ export default class QueryComplexity { onOperationDefinitionEnter(operation: OperationDefinitionNode): void; onOperationDefinitionLeave(): GraphQLError | undefined; nodeComplexity(node: FieldNode | FragmentDefinitionNode | InlineFragmentNode | - OperationDefinitionNode, typeDef: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, complexity?: number): number; + OperationDefinitionNode, typeDef: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, complexity?: number): number; createError(): GraphQLError; getDefaultComplexity(args: object, childScore: number): number; } diff --git a/types/graphql-relay/graphql-relay-tests.ts b/types/graphql-relay/graphql-relay-tests.ts index 860fe1075f..e490329b65 100644 --- a/types/graphql-relay/graphql-relay-tests.ts +++ b/types/graphql-relay/graphql-relay-tests.ts @@ -49,8 +49,8 @@ const resolve: GraphQLFieldResolver = (source, args, context, info) => context.flag = "f"; }; const fields: GraphQLFieldConfigMap = {}; -let t: GraphQLObjectType; -let e: GraphQLObjectType; +let t: GraphQLObjectType; +let e: GraphQLObjectType; const def = connectionDefinitions({ connectionFields: fields, edgeFields: fields, diff --git a/types/graphql-relay/index.d.ts b/types/graphql-relay/index.d.ts index a484429ed7..67edfa3df0 100644 --- a/types/graphql-relay/index.d.ts +++ b/types/graphql-relay/index.d.ts @@ -56,7 +56,7 @@ export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionAr export type ConnectionConfigNodeTypeNullable = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType; @@ -75,8 +75,8 @@ export interface ConnectionConfig { } export interface GraphQLConnectionDefinitions { - edgeType: GraphQLObjectType; - connectionType: GraphQLObjectType; + edgeType: GraphQLObjectType; + connectionType: GraphQLObjectType; } /** @@ -256,8 +256,8 @@ export interface GraphQLNodeDefinitions { nodesField: GraphQLFieldConfig; } -export type typeResolverFn = ((any: any) => GraphQLObjectType) | - ((any: any) => Promise>); +export type typeResolverFn = ((any: any) => GraphQLObjectType) | + ((any: any) => Promise); /** * Given a function to map from an ID to an underlying object, and a function diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index aff0cc0dd3..fc6ad898d1 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -136,7 +136,7 @@ export function buildExecutionContext( */ export function collectFields( exeContext: ExecutionContext, - runtimeType: GraphQLObjectType, + runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode, fields: { [key: string]: Array }, visitedFragmentNames: { [key: string]: boolean } @@ -146,7 +146,7 @@ export function buildResolveInfo( exeContext: ExecutionContext, fieldDef: GraphQLField, fieldNodes: ReadonlyArray, - parentType: GraphQLObjectType, + parentType: GraphQLObjectType, path: ResponsePath ): GraphQLResolveInfo; @@ -180,6 +180,6 @@ export const defaultFieldResolver: GraphQLFieldResolver; */ export function getFieldDef( schema: GraphQLSchema, - parentType: GraphQLObjectType, + parentType: GraphQLObjectType, fieldName: string ): Maybe>; diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index 42851d2f56..97c16f305c 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -28,7 +28,7 @@ import { GraphQLSchema } from "./schema"; */ export type GraphQLType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -44,9 +44,9 @@ export function isScalarType(type: any): type is GraphQLScalarType; export function assertScalarType(type: any): GraphQLScalarType; -export function isObjectType(type: any): type is GraphQLObjectType; +export function isObjectType(type: any): type is GraphQLObjectType; -export function assertObjectType(type: any): GraphQLObjectType; +export function assertObjectType(type: any): GraphQLObjectType; export function isInterfaceType(type: any): type is GraphQLInterfaceType; @@ -91,14 +91,14 @@ export function assertInputType(type: any): GraphQLInputType; */ export type GraphQLOutputType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType | GraphQLList | GraphQLNonNull< | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -121,7 +121,7 @@ export function assertLeafType(type: any): GraphQLLeafType; /** * These types may describe the parent context of a selection set. */ -export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; +export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; export function isCompositeType(type: any): type is GraphQLCompositeType; @@ -214,7 +214,7 @@ export function assertWrappingType(type: any): GraphQLWrappingType; */ export type GraphQLNullableType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -234,7 +234,7 @@ export function getNullableType(type: GraphQLNonN */ export type GraphQLNamedType = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType @@ -390,7 +390,7 @@ export interface GraphQLResolveInfo { readonly fieldName: string; readonly fieldNodes: ReadonlyArray; readonly returnType: GraphQLOutputType; - readonly parentType: GraphQLObjectType; + readonly parentType: GraphQLObjectType; readonly path: ResponsePath; readonly schema: GraphQLSchema; readonly fragments: { [key: string]: FragmentDefinitionNode }; @@ -533,7 +533,7 @@ export class GraphQLUnionType { constructor(config: GraphQLUnionTypeConfig); - getTypes(): GraphQLObjectType[]; + getTypes(): GraphQLObjectType[]; toString(): string; toJSON(): string; @@ -542,7 +542,7 @@ export class GraphQLUnionType { export interface GraphQLUnionTypeConfig { name: string; - types: Thunk[]>; + types: Thunk; /** * Optionally provide a custom type resolver function. If one is not provided, * the default implementation will call `isTypeOf` on each implementing diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index 6047f7a3bd..beed0ebeb2 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -10,13 +10,13 @@ import { } from "./definition"; import { GraphQLField } from "./definition"; -export const __Schema: GraphQLObjectType; -export const __Directive: GraphQLObjectType; +export const __Schema: GraphQLObjectType; +export const __Directive: GraphQLObjectType; export const __DirectiveLocation: GraphQLEnumType; -export const __Type: GraphQLObjectType; -export const __Field: GraphQLObjectType; -export const __InputValue: GraphQLObjectType; -export const __EnumValue: GraphQLObjectType; +export const __Type: GraphQLObjectType; +export const __Field: GraphQLObjectType; +export const __InputValue: GraphQLObjectType; +export const __EnumValue: GraphQLObjectType; export const TypeKind: { SCALAR: "SCALAR"; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index 5d5a409af2..7ccb390dbe 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -41,14 +41,14 @@ export class GraphQLSchema { constructor(config: GraphQLSchemaConfig); - getQueryType(): Maybe>; - getMutationType(): Maybe>; - getSubscriptionType(): Maybe>; + getQueryType(): Maybe; + getMutationType(): Maybe; + getSubscriptionType(): Maybe; getTypeMap(): TypeMap; getType(name: string): Maybe; - getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray>; + getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray; - isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; + isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; getDirectives(): ReadonlyArray; getDirective(name: string): Maybe; @@ -77,9 +77,9 @@ export interface GraphQLSchemaValidationOptions { } export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { - query: Maybe>; - mutation?: Maybe>; - subscription?: Maybe>; + query: Maybe; + mutation?: Maybe; + subscription?: Maybe; types?: Maybe; directives?: Maybe; astNode?: Maybe; diff --git a/types/graphql/utilities/getOperationRootType.d.ts b/types/graphql/utilities/getOperationRootType.d.ts index b1ec93d02e..e1f88e7e13 100644 --- a/types/graphql/utilities/getOperationRootType.d.ts +++ b/types/graphql/utilities/getOperationRootType.d.ts @@ -8,4 +8,4 @@ import { GraphQLObjectType } from "../type/definition"; export function getOperationRootType( schema: GraphQLSchema, operation: OperationDefinitionNode | OperationTypeDefinitionNode -): GraphQLObjectType; +): GraphQLObjectType; From 778c0d97712d3275f89eb03b7cc851b3ed44dc19 Mon Sep 17 00:00:00 2001 From: Ari Seyhun Date: Tue, 8 Jan 2019 03:00:21 +1030 Subject: [PATCH 151/646] Add typings for BdApi (BetterDiscordApi) (#31895) * Add types for bdapi * Fix typings for bdapi * Fix typings and project url * Add documentation link to index.d.ts * Add bandagedbd scope to bdapi * Fix bandagedbd_bdapi version * Rename test file for bandagedbd__bdapi * Add scope to comment in bandagedbd__bdapi * Update tsconfig file list for bdapi --- .../bandagedbd__bdapi-tests.ts | 6 + types/bandagedbd__bdapi/index.d.ts | 176 ++++++++++++++++++ types/bandagedbd__bdapi/tsconfig.json | 25 +++ types/bandagedbd__bdapi/tslint.json | 1 + 4 files changed, 208 insertions(+) create mode 100644 types/bandagedbd__bdapi/bandagedbd__bdapi-tests.ts create mode 100644 types/bandagedbd__bdapi/index.d.ts create mode 100644 types/bandagedbd__bdapi/tsconfig.json create mode 100644 types/bandagedbd__bdapi/tslint.json diff --git a/types/bandagedbd__bdapi/bandagedbd__bdapi-tests.ts b/types/bandagedbd__bdapi/bandagedbd__bdapi-tests.ts new file mode 100644 index 0000000000..3966aa3d1e --- /dev/null +++ b/types/bandagedbd__bdapi/bandagedbd__bdapi-tests.ts @@ -0,0 +1,6 @@ +import { BdApi } from 'bandagedbd__bdapi'; + +BdApi.React; // $ExpectType typeof React +BdApi.ReactDOM.render; // $ExpectType Renderer +BdApi.alert('foo', 'bar'); // $ExpectType void +BdApi.showToast('hello', { timeout: 2000 }); // $ExpectType void diff --git a/types/bandagedbd__bdapi/index.d.ts b/types/bandagedbd__bdapi/index.d.ts new file mode 100644 index 0000000000..4792992374 --- /dev/null +++ b/types/bandagedbd__bdapi/index.d.ts @@ -0,0 +1,176 @@ +// Type definitions for bdapi 0.2 +// Project: https://github.com/rauenzi/BetterDiscordApp +// Definitions by: Ari Seyhun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 +// Documentation: https://github.com/rauenzi/BetterDiscordApp/wiki/Creating-Plugins#bdapi + +import * as ReactInstance from 'react'; +import * as ReactDOMInstance from 'react-dom'; + +export const BdApi: typeof BdApiModule; + +/** + * Function with no arguments and no return value that may be called to revert changes made by monkeyPatch method, + * restoring (unpatching) original method. + */ +export type CancelPatch = () => void; + +/** + * A callback that modifies method logic. + * This callback is called on each call of the original method and is provided all data about original call. + * Any of the data can be modified if necessary, but do so wisely. + */ +export type PatchFunction = (data: PatchData) => any; + +/** + * A callback that modifies method logic. + * This callback is called on each call of the original method and is provided all data about original call. + * Any of the data can be modified if necessary, but do so wisely. + */ +export interface PatchData { + thisObject: object; + methodArguments: any[]; + CancelPatch: CancelPatch; + originalMethod: () => void; + callOriginalMethod: () => void; + returnValue: any; +} + +export interface MonkeyPatchOptions { + once?: boolean; + silent?: boolean; + displayName?: string; + before?: PatchFunction; + after?: PatchFunction; + instead?: PatchFunction; +} + +export interface ToastOptions { + type?: string; + icon?: boolean; + timeout?: number; +} + +export namespace BdApiModule { + /** + * The React module being used inside Discord. + */ + const React: typeof ReactInstance; + + /** + * The ReactDOM module being used inside Discord. + */ + const ReactDOM: typeof ReactDOMInstance; + + /** + * Creates an shows an alert modal to the user. A preview of how it may look can be found [here](https://i.zackrauen.com/7qnnNC.png). + */ + function alert(title: string, content: string): void; + + /** + * Removes a style added with [`injectCSS`](#injectcssid-css) below. + */ + function clearCSS(id: string): void; + + /** + * Deletes some saved data for plugin `pluginName` with key `key`. + */ + function deleteData(pluginName: string, key: string): void; + + /** + * Searches for an internal Discord webpack module based on `filter`. + */ + function findModule(filter: () => void): any; + + /** + * Searches for multiple internal Discord webpack module based on `filter`. It's the same as [`findModule`](#findmodulefilter) but will return all matches + */ + function findAllModules(filter: () => void): any[]; + + /** + * Searches for an internal Discord webpack module that has every property passed. + */ + function findModuleByProps(...props: string[]): any; + + /** + * Returns BandagedBD's instance of the core module. Only use this if you know what you are doing. + */ + function getCore(): any; // TODO: This should not return 'any' but instead 'Core' + + /** + * Alias for [loadData(pluginName, key)](#loaddatapluginname-key) + */ + function getData(pluginName: string, key: string): any; + + /** + * Gets the internal react instance for a particular node. + */ + function getInternalInstance(node: HTMLElement): object|undefined; + + /** + * Gets the instance of another plugin with the name `name`. + */ + function getPlugin(name: string): object|null; + + /** + * Adds a block of css to the current document's `head`. + */ + function injectCSS(id: string, css: string): object|null; + + /** + * Links some remote JavaScript to be added to the page. Useful for libraries like `Sortable.js`. + */ + function linkJS(id: string, url: string): void; + + /** + * Gets some saved data for plugin `pluginName` with key `key`. Data can be saved with [`saveData`](#savedatapluginname-key-data). + */ + function loadData(pluginName: string, key: string): any; + + /** + * This function monkey-patches a method on an object. The patching callback may be run before, after or instead of target method. + * - Be careful when monkey-patching. Think not only about original functionality of target method and your changes, + * but also about developers of other plugins, who may also patch this method before or after you. + * Try to change target method behaviour as little as possible, and avoid changing method signatures. + * - Display name of patched method is changed, so you can see if a function has been patched (and how many times) while debugging or in the stack trace. + * Also, patched methods have property `__monkeyPatched` set to `true`, in case you want to check something programmatically. + */ + function monkeyPatch(module: object, methodName: string, options: MonkeyPatchOptions): CancelPatch; + + /** + * Adds a listener for when the node is removed from the document body. + */ + function onRemoved(node: HTMLElement, callback: () => void): void; + + /** + * Saved some `data` for plugin `pluginName` under `key` key. Gets saved in the plugins folder under `pluginName.config.json`. Data can be saved with [`loadData`](#loaddatapluginname-key). + */ + function saveData(pluginName: string, key: string, data: any): void; + + /** + * Alias for [saveData(pluginName, key, data)](#savedatapluginname-key-data) + * + */ + function setData(pluginName: string, key: string, data: any): void; + + /** + * Shows a simple toast message similar to on Android. An example of the `success` toast can be seen [here](https://i.zackrauen.com/zIagVa.png). + */ + function showToast(content: string, options?: ToastOptions): void; + + /** + * Wraps a function in a try catch block. + */ + function suppressErrors(method: () => void, message?: string): () => void; + + /** + * Determines if the input is valid and parseable JSON. + */ + function testJSON(data: string): boolean; + + /** + * Removes some previously linked JS by [`linkJS`](#linkjsid-url). + */ + function unlinkJS(id: string): void; +} diff --git a/types/bandagedbd__bdapi/tsconfig.json b/types/bandagedbd__bdapi/tsconfig.json new file mode 100644 index 0000000000..7e35378a67 --- /dev/null +++ b/types/bandagedbd__bdapi/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "bandagedbd__bdapi-tests.ts" + ] +} diff --git a/types/bandagedbd__bdapi/tslint.json b/types/bandagedbd__bdapi/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bandagedbd__bdapi/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6dbe9483fcd068cfedc10c452a17de6f53ecb37b Mon Sep 17 00:00:00 2001 From: kimcoder Date: Tue, 8 Jan 2019 01:31:28 +0900 Subject: [PATCH 152/646] types for 'urlencode' package (#31715) * first commit * fixed tsconfig, modify lint error * declare urlencode function ad namespace * [@types/urlencode] modify export export default urlencode -> exrpot = urlencode; * esModuleInterop, allowSyntheticDefaultImports add to tsconfig * exprot default urlencode * modify export = --- types/urlencode/index.d.ts | 46 ++++++++++++++++++++++++++++++ types/urlencode/tsconfig.json | 25 ++++++++++++++++ types/urlencode/tslint.json | 1 + types/urlencode/urlencode-tests.ts | 15 ++++++++++ 4 files changed, 87 insertions(+) create mode 100644 types/urlencode/index.d.ts create mode 100644 types/urlencode/tsconfig.json create mode 100644 types/urlencode/tslint.json create mode 100644 types/urlencode/urlencode-tests.ts diff --git a/types/urlencode/index.d.ts b/types/urlencode/index.d.ts new file mode 100644 index 0000000000..451626cb79 --- /dev/null +++ b/types/urlencode/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for urlencode 1.1 +// Project: https://github.com/node-modules/urlencode +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface charsetParam { + charset: string; +} + +/** + * Encode string + * @param str The string for encoding. + */ +declare function urlencode(str: string, charset?: string): string; + +declare namespace urlencode { + /** + * Encode string + * @param str The string for encoding. + */ + function encode(str: string, charset?: string): string; + + /** + * Decode string + * @param encodedString The encoded string. + */ + function decode(encodedString: string, charset?: string): string; + + /** + * Parse querystring + * @param queryString Querystring + * @param charsetParam The charset for parsing + */ + function parse(queryString: string, charsetParam: charsetParam): any; + interface charsetParam { + charset: string; + } + /** + * Stringify object + * @param obj Query Object + * @param charsetParam The charset for parsing + */ + function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): string; +} + +export = urlencode; diff --git a/types/urlencode/tsconfig.json b/types/urlencode/tsconfig.json new file mode 100644 index 0000000000..062ab3224d --- /dev/null +++ b/types/urlencode/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "urlencode-tests.ts" + ] +} diff --git a/types/urlencode/tslint.json b/types/urlencode/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/urlencode/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/urlencode/urlencode-tests.ts b/types/urlencode/urlencode-tests.ts new file mode 100644 index 0000000000..2008ed3283 --- /dev/null +++ b/types/urlencode/urlencode-tests.ts @@ -0,0 +1,15 @@ +import urlencode from 'urlencode'; + +urlencode('苏千'); // default is utf8 +urlencode('苏千', 'gbk'); // '%CB%D5%C7%A7' + +// decode gbk +urlencode.decode('%CB%D5%C7%A7', 'gbk'); // '苏千' + +// parse gbk querystring +urlencode.parse('nick=%CB%D5%C7%A7', {charset: 'gbk'}); // {nick: '苏千'} + +// stringify obj with gbk encoding +const str = 'x[y][0][v][w]=' + urlencode('雾空', 'gbk'); // x[y][0][v][w]=%CE%ED%BF%D5 +const obj = {x: {y : [{v : {w : '雾空'}}]}}; +urlencode.stringify(obj, {charset: 'gbk'}); From 2d72e749a3414fc830df2072cf9cd1b850453c4a Mon Sep 17 00:00:00 2001 From: Wouter R Date: Mon, 7 Jan 2019 17:11:58 +0100 Subject: [PATCH 153/646] mongoose-paginate-v2: fix export causing errors. --- types/mongoose-paginate-v2/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/mongoose-paginate-v2/index.d.ts b/types/mongoose-paginate-v2/index.d.ts index ca8b7eac91..df4c1f7419 100644 --- a/types/mongoose-paginate-v2/index.d.ts +++ b/types/mongoose-paginate-v2/index.d.ts @@ -57,4 +57,5 @@ declare module 'mongoose' { } import mongoose = require('mongoose'); -export function _(schema: mongoose.Schema): void; +declare function _(schema: mongoose.Schema): void; +export = _; From 8bc60d4de59ef475240509c96e5f1b181702f29f Mon Sep 17 00:00:00 2001 From: chenc Date: Tue, 8 Jan 2019 01:11:47 +0800 Subject: [PATCH 154/646] add node-xlsx .d.ts --- types/node-xlsx/index.d.ts | 31 ++++++++++++++++++++++++++++++ types/node-xlsx/node-xlsx-tests.ts | 8 ++++++++ types/node-xlsx/tsconfig.json | 22 +++++++++++++++++++++ types/node-xlsx/tslint.json | 1 + 4 files changed, 62 insertions(+) create mode 100644 types/node-xlsx/index.d.ts create mode 100644 types/node-xlsx/node-xlsx-tests.ts create mode 100644 types/node-xlsx/tsconfig.json create mode 100644 types/node-xlsx/tslint.json diff --git a/types/node-xlsx/index.d.ts b/types/node-xlsx/index.d.ts new file mode 100644 index 0000000000..6840f90592 --- /dev/null +++ b/types/node-xlsx/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for node-xlsx 0.12 +// Project: https://github.com/mgcrea/node-xlsx#readme +// Definitions by: chenc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * parsing a xlsx from file/buffer, outputs an object of worksheets + * @param mixed file or buffer + * @param options options is for xlsx + * @returns worksheets data, like: [{ name, data: [] }] + */ +export declare function parse( + mixed: any, + options?: {} + ): { + name: string; + data: {}[]; + }[]; + + /** + * building a xlsx + * @param worksheets worksheets data, like:[[1,2,3],['1', '2','word']] + * @param options spannig multiple rows A1:A4 + * @returns returns a buffer of worksheets + */ + export declare function build(worksheets: any, options?: {}): any; + declare const _default: { + parse: typeof parse; + build: typeof build; + }; + export default _default; diff --git a/types/node-xlsx/node-xlsx-tests.ts b/types/node-xlsx/node-xlsx-tests.ts new file mode 100644 index 0000000000..f9dffcad47 --- /dev/null +++ b/types/node-xlsx/node-xlsx-tests.ts @@ -0,0 +1,8 @@ +import { build } from 'node-xlsx'; +const data = [ + [1, 2, 3], + [true, false, null, 'sheetjs'], + ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'], + ['baz', null, 'qux'], +]; +const buffer = build([{ name: 'mySheetName', data }]); diff --git a/types/node-xlsx/tsconfig.json b/types/node-xlsx/tsconfig.json new file mode 100644 index 0000000000..355898caaf --- /dev/null +++ b/types/node-xlsx/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-xlsx-tests.ts" + ] +} diff --git a/types/node-xlsx/tslint.json b/types/node-xlsx/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/node-xlsx/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 75a42d225ed54157a90278e62359501ed68792ec Mon Sep 17 00:00:00 2001 From: chenc Date: Tue, 8 Jan 2019 01:52:47 +0800 Subject: [PATCH 155/646] change tsconfig.js --- types/node-xlsx/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/node-xlsx/tsconfig.json b/types/node-xlsx/tsconfig.json index 355898caaf..168c454276 100644 --- a/types/node-xlsx/tsconfig.json +++ b/types/node-xlsx/tsconfig.json @@ -13,7 +13,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false }, "files": [ "index.d.ts", From 517fcb3e2d464ac7961007988b6bffcce5686779 Mon Sep 17 00:00:00 2001 From: chenc Date: Tue, 8 Jan 2019 01:55:07 +0800 Subject: [PATCH 156/646] Use 'Array' to instead T[] --- types/node-xlsx/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/node-xlsx/index.d.ts b/types/node-xlsx/index.d.ts index 6840f90592..9f447202bf 100644 --- a/types/node-xlsx/index.d.ts +++ b/types/node-xlsx/index.d.ts @@ -12,10 +12,10 @@ export declare function parse( mixed: any, options?: {} - ): { + ): Array<{ name: string; data: {}[]; - }[]; + }>; /** * building a xlsx From bfc5ff013be07248bd779ad4b04542a965e1b0d9 Mon Sep 17 00:00:00 2001 From: chenc Date: Tue, 8 Jan 2019 01:59:30 +0800 Subject: [PATCH 157/646] fix lint error --- types/node-xlsx/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/node-xlsx/index.d.ts b/types/node-xlsx/index.d.ts index 9f447202bf..1262be153b 100644 --- a/types/node-xlsx/index.d.ts +++ b/types/node-xlsx/index.d.ts @@ -2,19 +2,20 @@ // Project: https://github.com/mgcrea/node-xlsx#readme // Definitions by: chenc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 /** * parsing a xlsx from file/buffer, outputs an object of worksheets * @param mixed file or buffer * @param options options is for xlsx - * @returns worksheets data, like: [{ name, data: [] }] + * @returns worksheets data, like: [{ name, data: [[]] }] */ export declare function parse( mixed: any, options?: {} ): Array<{ name: string; - data: {}[]; + data: Array<[]>; }>; /** From 61b4e9d8537c8baaccf6c6100f4e2843dee0d3d2 Mon Sep 17 00:00:00 2001 From: chenc Date: Tue, 8 Jan 2019 02:06:01 +0800 Subject: [PATCH 158/646] set strictFunctionTypes to true --- types/node-xlsx/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-xlsx/tsconfig.json b/types/node-xlsx/tsconfig.json index 168c454276..915d266284 100644 --- a/types/node-xlsx/tsconfig.json +++ b/types/node-xlsx/tsconfig.json @@ -14,7 +14,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": false + "strictFunctionTypes": true }, "files": [ "index.d.ts", From f6d46c5dac36366f90e3ca7e199f0bd2214070ad Mon Sep 17 00:00:00 2001 From: chenc Date: Tue, 8 Jan 2019 02:23:24 +0800 Subject: [PATCH 159/646] Add comments and improve return values --- types/node-xlsx/index.d.ts | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/types/node-xlsx/index.d.ts b/types/node-xlsx/index.d.ts index 1262be153b..45c1173be3 100644 --- a/types/node-xlsx/index.d.ts +++ b/types/node-xlsx/index.d.ts @@ -6,27 +6,30 @@ /** * parsing a xlsx from file/buffer, outputs an object of worksheets - * @param mixed file or buffer + * @param mixed file path or buffer * @param options options is for xlsx - * @returns worksheets data, like: [{ name, data: [[]] }] + * @returns worksheets data, like: { name: 'worksheets', data: [[1,2,3],['1', '2','word']] } */ export declare function parse( - mixed: any, + mixed: string | ArrayBuffer, options?: {} - ): Array<{ +): Array<{ name: string; data: Array<[]>; - }>; +}>; - /** - * building a xlsx - * @param worksheets worksheets data, like:[[1,2,3],['1', '2','word']] - * @param options spannig multiple rows A1:A4 - * @returns returns a buffer of worksheets - */ - export declare function build(worksheets: any, options?: {}): any; - declare const _default: { +/** + * building a xlsx + * @param worksheets worksheets data, like:{ name: 'worksheets', data: [[1,2,3],['1', '2','word']] } + * @param options spannig multiple rows A1:A4 + * @returns returns a buffer of worksheets + */ +export declare function build( + worksheets: Array<{ name: string; data: Array }>, + options?: {} +): ArrayBuffer; +declare const _default: { parse: typeof parse; build: typeof build; - }; - export default _default; +}; +export default _default; From 1aba60e3f7b2b3209ab6b7fbae7b0ef64d3f76e4 Mon Sep 17 00:00:00 2001 From: chenc Date: Tue, 8 Jan 2019 02:25:35 +0800 Subject: [PATCH 160/646] fix lint err --- types/node-xlsx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-xlsx/index.d.ts b/types/node-xlsx/index.d.ts index 45c1173be3..bd500d8a4e 100644 --- a/types/node-xlsx/index.d.ts +++ b/types/node-xlsx/index.d.ts @@ -25,7 +25,7 @@ export declare function parse( * @returns returns a buffer of worksheets */ export declare function build( - worksheets: Array<{ name: string; data: Array }>, + worksheets: Array<{ name: string; data: any[][] }>, options?: {} ): ArrayBuffer; declare const _default: { From 8abd27b8840167fbd77141b4b9fd9988f97c79e5 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Mon, 7 Jan 2019 10:53:55 -0800 Subject: [PATCH 161/646] Address feedback --- types/styled-components/index.d.ts | 5 +++-- types/styled-components/test/index.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index 6c3ec7b1de..b940965ace 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -144,8 +144,6 @@ export interface StyledComponentBase< // props: StyledComponentPropsWithAs // ): React.ReactElement> - defaultProps: ReactDefaultProps; - // TODO (TypeScript 3.2): delete this overload ( props: StyledComponentProps & { @@ -157,6 +155,9 @@ export interface StyledComponentBase< as?: keyof JSX.IntrinsicElements | React.ComponentType; } ): React.ReactElement>; + + readonly defaultProps: ReactDefaultProps; + withComponent( component: WithC ): StyledComponent< diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index 138e941c4f..96867cf288 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -270,7 +270,7 @@ const MyOtherComponentWithProps = () => ( // Create a react component that renders an // which takes extra props passed as a generic type argument -const LinkFromStringWithPropsAndGenerics = styled("a") ` +const LinkFromStringWithPropsAndGenerics = styled("a")` font-size: 1.5em; text-align: center; color: ${a => (a.canClick ? "palevioletred" : "gray")}; From 3ca0032c6aa4bc2ebe6a9386feaaab070c2ad41a Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Mon, 7 Jan 2019 22:09:30 +0100 Subject: [PATCH 162/646] Add types for exif --- types/exif/exif-tests.ts | 18 +++++ types/exif/index.d.ts | 143 +++++++++++++++++++++++++++++++++++++++ types/exif/tsconfig.json | 23 +++++++ types/exif/tslint.json | 1 + 4 files changed, 185 insertions(+) create mode 100644 types/exif/exif-tests.ts create mode 100644 types/exif/index.d.ts create mode 100644 types/exif/tsconfig.json create mode 100644 types/exif/tslint.json diff --git a/types/exif/exif-tests.ts b/types/exif/exif-tests.ts new file mode 100644 index 0000000000..57d29fc80b --- /dev/null +++ b/types/exif/exif-tests.ts @@ -0,0 +1,18 @@ +import Exif = require('exif'); +const ExifImage = Exif.ExifImage; + +new ExifImage({ image: 'myImage.jpg' }, (error, exifData) => { + if (error) { + console.log(`Error: ${error.message}`); + } else { + console.log(exifData); + } +}); + +Exif('myImage.jpg', (error, exifData, dataPath) => { + if (error) { + console.log(`Error: ${error.message}`); + } else { + console.log(exifData, dataPath); + } +}); diff --git a/types/exif/index.d.ts b/types/exif/index.d.ts new file mode 100644 index 0000000000..78a1859517 --- /dev/null +++ b/types/exif/index.d.ts @@ -0,0 +1,143 @@ +// Type definitions for exif 0.6 +// Project: https://github.com/gomfunkel/node-exif#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace Exif { + interface ExifData { + image: { + Copyright?: string; + ExifOffset?: number; + ImageHeight?: number; + ImageWidth?: number; + Make?: string; + Model?: string; + ModifyDate?: string; + Orientation?: number; + ResolutionUnit?: number; + Software?: string; + XResolution?: number; + YCbCrPositioning?: number; + YResolution?: number; + }; + thumbnail: { + Compression?: number; + Orientation?: number; + ResolutionUnit?: number; + ThumbnailLength?: number; + ThumbnailOffset?: number; + XResolution?: number; + YCbCrPositioning?: number; + YResolution?: number; + }; + exif: { + ApertureValue?: number; + BrightnessValue?: number; + ColorSpace?: number; + ComponentsConfiguration?: Buffer; + CompressedBitsPerPixel?: number; + CreateDate?: string; + DateTimeOriginal?: string; + ExifImageHeight?: number; + ExifImageWidth?: number; + ExifVersion?: Buffer; + ExposureCompensation?: number; + ExposureMode?: number; + ExposureProgram?: number; + ExposureTime?: number; + FileSource?: Buffer; + Flash?: number; + FlashpixVersion?: Buffer; + FNumber?: number; + FocalLength?: number; + FocalLengthIn35mmFormat?: number; + FocalPlaneResolutionUnit?: number; + FocalPlaneXResolution?: number; + FocalPlaneYResolution?: number; + ImageUniqueID?: string; + InteropOffset?: number; + ISO?: number; + MakerNote?: Buffer; + MaxApertureValue?: number; + MeteringMode?: number; + SceneCaptureType?: number; + SceneType?: Buffer; + SensingMethod?: number; + ShutterSpeedValue?: number; + UserComment?: Buffer; + WhiteBalance?: number; + }; + gps: { + GPSAltitude?: number; + GPSAltitudeRef?: number; + GPSDateStamp?: string; + GPSLatitude?: number[]; + GPSLatitudeRef?: string; + GPSLongitude?: number[]; + GPSLongitudeRef?: string; + GPSTimeStamp?: number[]; + GPSVersionId?: number[]; + }; + interoperability: { + InteropIndex?: string; + InteropVersion?: Buffer; + }; + makernote: { + AutoBracketing?: number; + BlurWarning?: number; + ExposureWarning?: number; + error?: string; + FlashExposureComp?: number; + FocusMode?: number; + FocusWarning?: number; + FujiFlashMode?: number; + Macro?: number; + Quality?: string; + Sharpness?: number; + SlowSync?: number; + Version?: Buffer; + WhiteBalance?: number; + }; + } + + interface ExifOptions { + agfaMaxEntries?: number; + epsonMaxEntries?: number; + /** node-exif corrects the thumbnail offset in order to have an offset from the start of the buffer/file. */ + fixThumbnailOffset?: boolean; + fujifilmMaxEntries?: number; + ifd0MaxEntries?: number; + ifd1MaxEntries?: number; + /** + * The image to get Exif data from can be either a filesystem path or a Buffer. + * + * If `image` is not specified, the developer must call `loadImage()` to parse the image. + */ + image?: string | Buffer; + /** Specifies the maximum entries to be parsed */ + maxEntries?: number; + maxGpsEntries?: number; + maxInteroperabilityEntries?: number; + noPadding?: boolean; + olympusMaxEntries?: number; + panasonicMaxEntries?: number; + sanyoMaxEntries?: number; + /** An object named "offsets" is added to exifData and contains lot of offsets needed to get thumbnail and other things. */ + tiffOffsets?: number; + } + + type ExifImageCallback = (error: Error | null, data: ExifData) => void; + type ExifCallback = (error: Error | null, data: ExifData, dataPath: string) => void; + + class ExifImage { + constructor(options: ExifOptions | string | Buffer, callback: ExifImageCallback); + constructor(); + loadImage(file: string | Buffer, callback: ExifImageCallback): void; + } +} + +declare function Exif(path: string, callback: Exif.ExifCallback): void; + +export = Exif; diff --git a/types/exif/tsconfig.json b/types/exif/tsconfig.json new file mode 100644 index 0000000000..4c0c12d69a --- /dev/null +++ b/types/exif/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", + "exif-tests.ts" + ] +} diff --git a/types/exif/tslint.json b/types/exif/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/exif/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 838a4ccb8122e160b5e9b1b0f70122b09cdb8451 Mon Sep 17 00:00:00 2001 From: Nicholas Steicke Date: Tue, 8 Jan 2019 08:46:22 +1030 Subject: [PATCH 163/646] Add lunr.Query.presence constants --- types/lunr/index.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/types/lunr/index.d.ts b/types/lunr/index.d.ts index 415c7c1d8f..f542280df3 100644 --- a/types/lunr/index.d.ts +++ b/types/lunr/index.d.ts @@ -535,6 +535,24 @@ declare namespace lunr { } namespace Query { + /** + * Constants for indicating what kind of presence a term must have in matching documents. + */ + enum presence { + /** + * Term's presence in a document is optional, this is the default value. + */ + OPTIONAL = 1, + /** + * Term's presence in a document is required, documents that do not contain this term will not be returned. + */ + REQUIRED = 2, + /** + * Term's presence in a document is prohibited, documents that do contain this term will not be returned. + */ + PROHIBITED = 3 + } + enum wildcard { NONE = 0, LEADING = 1 << 0, From 3f322082f0ab2373af8199e473b259a380c06358 Mon Sep 17 00:00:00 2001 From: Nicholas Steicke Date: Tue, 8 Jan 2019 08:47:39 +1030 Subject: [PATCH 164/646] Update lunr.Query.prototype.term to accept arrays and Token objects --- types/lunr/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/lunr/index.d.ts b/types/lunr/index.d.ts index f542280df3..ab59d556f6 100644 --- a/types/lunr/index.d.ts +++ b/types/lunr/index.d.ts @@ -616,6 +616,12 @@ declare namespace lunr { * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} * to the list of clauses that make up this query. * + * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion + * to a token or token-like string should be done before calling this method. + * + * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an + * array, each term in the array will share the same options. + * * @param term - The term to add to the query. * @param [options] - Any additional properties to add to the query clause. * @see lunr.Query#clause @@ -629,7 +635,7 @@ declare namespace lunr { * wildcard: lunr.Query.wildcard.TRAILING * }) */ - term(term: string, options: object): Query; + term(term: string | string[] | Token | Token[], options: object): Query; } class QueryParseError extends Error { From 314a93b409d40f27ca6ad26021966e8a5f8b5cf2 Mon Sep 17 00:00:00 2001 From: Nicholas Steicke Date: Tue, 8 Jan 2019 09:57:42 +1030 Subject: [PATCH 165/646] Update tests to verify term and Query changes --- types/lunr/lunr-tests.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/lunr/lunr-tests.ts b/types/lunr/lunr-tests.ts index a14fd1947f..4d3fa57461 100644 --- a/types/lunr/lunr-tests.ts +++ b/types/lunr/lunr-tests.ts @@ -25,6 +25,16 @@ function basic_test() { }); index.search("foo"); + + index.query(q => { + q.term( + lunr.tokenizer('search terms'), + { + wildcard: lunr.Query.wildcard.TRAILING, + presence: lunr.Query.presence.REQUIRED + } + ); + }); } function pipeline_test() { From 694bcf0030747a08b0701a56f82296de371a903c Mon Sep 17 00:00:00 2001 From: Chives Date: Mon, 7 Jan 2019 17:41:38 -0800 Subject: [PATCH 166/646] Add definitions for CustomEvent in jQuery --- types/jquery/v2/index.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/jquery/v2/index.d.ts b/types/jquery/v2/index.d.ts index 2643960e6d..068bbfc991 100644 --- a/types/jquery/v2/index.d.ts +++ b/types/jquery/v2/index.d.ts @@ -603,6 +603,14 @@ interface BaseJQueryEventObject extends Event { metaKey: boolean; } +interface JQueryCustomEventObject extends BaseJQueryEventObject { + /** + * @see {@link https://api.jquery.com/category/events/event-object/} + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent} + */ + detail?: any; +} + interface JQueryInputEventObject extends BaseJQueryEventObject { altKey: boolean; ctrlKey: boolean; @@ -632,7 +640,7 @@ interface JQueryKeyEventObject extends JQueryInputEventObject { keyCode: number; } -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +interface JQueryEventObject extends BaseJQueryEventObject, JQueryCustomEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } /** From 009ff6e86be96fe5c8b9f8300e6359351a847637 Mon Sep 17 00:00:00 2001 From: Benjamin Makus Date: Tue, 8 Jan 2019 02:46:49 +0100 Subject: [PATCH 167/646] add typings for spected --- types/spected/index.d.ts | 26 ++++++++++++++++++++++++++ types/spected/spected-tests.ts | 0 types/spected/tsconfig.json | 22 ++++++++++++++++++++++ types/spected/tslint.json | 1 + 4 files changed, 49 insertions(+) create mode 100644 types/spected/index.d.ts create mode 100644 types/spected/spected-tests.ts create mode 100644 types/spected/tsconfig.json create mode 100644 types/spected/tslint.json diff --git a/types/spected/index.d.ts b/types/spected/index.d.ts new file mode 100644 index 0000000000..3c97ed98b4 --- /dev/null +++ b/types/spected/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for yup 0.26 +// Project: https://github.com/25th-floor/spected +// Definitions by: Benjamin Makus , +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2 + +declare var spected: Spected; + +export type Spected = (spec: Spec, input: any) => Result + +export type Predicate = (value: any, inputs: any) => boolean + +export type ErrorMsg = + | string + | ((value: any, field: string) => string) + +export type Spec = {[key: string]: SpecValue } + +export type SpecValue = + | ReadonlyArray<[Predicate, ErrorMsg]> + | ((value: any) => any) + | Spec + +export type Result = {[key: string]: true | Array | Result} + +export default spected; \ No newline at end of file diff --git a/types/spected/spected-tests.ts b/types/spected/spected-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/spected/tsconfig.json b/types/spected/tsconfig.json new file mode 100644 index 0000000000..637a75fb12 --- /dev/null +++ b/types/spected/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spected-tests.ts" + ] +} diff --git a/types/spected/tslint.json b/types/spected/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/spected/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a98d67071b66c7606975888aeb60c41aee2a7657 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Tue, 8 Jan 2019 02:56:44 +0100 Subject: [PATCH 168/646] [loopbench] Add types --- types/loopbench/index.d.ts | 71 ++++++++++++++++++++++++++++++ types/loopbench/loopbench-tests.ts | 11 +++++ types/loopbench/tsconfig.json | 23 ++++++++++ types/loopbench/tslint.json | 1 + 4 files changed, 106 insertions(+) create mode 100644 types/loopbench/index.d.ts create mode 100644 types/loopbench/loopbench-tests.ts create mode 100644 types/loopbench/tsconfig.json create mode 100644 types/loopbench/tslint.json diff --git a/types/loopbench/index.d.ts b/types/loopbench/index.d.ts new file mode 100644 index 0000000000..bd5e61d3e2 --- /dev/null +++ b/types/loopbench/index.d.ts @@ -0,0 +1,71 @@ +// Type definitions for loopbench 1.2 +// Project: https://github.com/mcollina/loopbench#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'events'; + +export = loopbench; + +/** + * Creates a new instance of loopbench. + */ +declare function loopbench(options?: loopbench.Options): loopbench.LoopBench; + +declare namespace loopbench { + interface Options { + /** + * The interval at which the eventLoop should be sampled, defaults to `5`. + */ + sampleInterval?: number; + /** + * The maximum amount of delay that is tolerated before `overLimit` becomes true, + * and the `load` event is emitted, defaults to `42`. + */ + limit?: number; + } + + /** + * Events: + * - `load`, emitted when `instance.delay > instance.limit` + * - `unload`, emitted when `overLimit` goes from `true` and `false` + */ + interface LoopBench extends EventEmitter { + /** + * The delay in milliseconds (and fractions) from the expected run. It might be negative (in older nodes). + */ + readonly delay: number; + + /** + * The maximum amount of delay that is tolerated before `overLimit` becomes true, + * and the `load` event is emitted. + */ + readonly limit: number; + + /** + * Is `true` if the `instance.delay > instance.limit`. + */ + readonly overLimit: boolean; + + /** + * Stops the sampling. + */ + stop(): void; + + addListener(event: 'load' | 'unload', listener: () => void): this; + on(event: 'load' | 'unload', listener: () => void): this; + once(event: 'load' | 'unload', listener: () => void): this; + removeListener(event: 'load' | 'unload', listener: () => void): this; + off(event: 'load' | 'unload', listener: () => void): this; + removeAllListeners(event?: 'load' | 'unload'): this; + listeners(event: 'load' | 'unload'): Array<() => void>; + rawListeners(event: 'load' | 'unload'): Array<() => void>; + emit(event: 'load' | 'unload'): boolean; + listenerCount(type: 'load' | 'unload'): number; + prependListener(event: 'load' | 'unload', listener: () => void): this; + prependOnceListener(event: 'load' | 'unload', listener: () => void): this; + eventNames(): Array<'load' | 'unload'>; + } +} diff --git a/types/loopbench/loopbench-tests.ts b/types/loopbench/loopbench-tests.ts new file mode 100644 index 0000000000..e78a22e08a --- /dev/null +++ b/types/loopbench/loopbench-tests.ts @@ -0,0 +1,11 @@ +import loopbench = require('loopbench'); + +const inst = loopbench(); +inst; // $ExpectType LoopBench +loopbench({ sampleInterval: 1 }); // $ExpectType LoopBench +loopbench({ limit: 1 }); // $ExpectType LoopBench + +inst.delay; // $ExpectType number +inst.limit; // $ExpectType number +inst.overLimit; // $ExpectType boolean +inst.stop(); diff --git a/types/loopbench/tsconfig.json b/types/loopbench/tsconfig.json new file mode 100644 index 0000000000..05e37ab0fa --- /dev/null +++ b/types/loopbench/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", + "loopbench-tests.ts" + ] +} diff --git a/types/loopbench/tslint.json b/types/loopbench/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/loopbench/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 7c8b923faac7b2df41ef407988d487a302849fcf Mon Sep 17 00:00:00 2001 From: Benjamin Makus Date: Tue, 8 Jan 2019 03:09:00 +0100 Subject: [PATCH 169/646] add typings for spected --- types/spected/index.d.ts | 26 +++++++++++++++----------- types/spected/spected-tests.ts | 0 types/spected/tsconfig.json | 4 ++-- 3 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 types/spected/spected-tests.ts diff --git a/types/spected/index.d.ts b/types/spected/index.d.ts index 3c97ed98b4..13b46ddd22 100644 --- a/types/spected/index.d.ts +++ b/types/spected/index.d.ts @@ -1,26 +1,30 @@ -// Type definitions for yup 0.26 +// Type definitions for spected 0.26 // Project: https://github.com/25th-floor/spected -// Definitions by: Benjamin Makus , +// Definitions by: Benjamin Makus // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.2 +// TypeScript Version: 2.1 declare var spected: Spected; -export type Spected = (spec: Spec, input: any) => Result +export type Spected = (spec: Spec, input: any) => Result; -export type Predicate = (value: any, inputs: any) => boolean +export type Predicate = (value: any, inputs: any) => boolean; export type ErrorMsg = | string - | ((value: any, field: string) => string) + | ((value: any, field: string) => string); -export type Spec = {[key: string]: SpecValue } +export interface Spec { + [key: string]: SpecValue; +} -export type SpecValue = +export type SpecValue = | ReadonlyArray<[Predicate, ErrorMsg]> | ((value: any) => any) - | Spec + | Spec; -export type Result = {[key: string]: true | Array | Result} +export interface Result { + [key: string]: true | string[] | Result; +} -export default spected; \ No newline at end of file +export default spected; diff --git a/types/spected/spected-tests.ts b/types/spected/spected-tests.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/types/spected/tsconfig.json b/types/spected/tsconfig.json index 637a75fb12..ecc22c8314 100644 --- a/types/spected/tsconfig.json +++ b/types/spected/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,7 +17,6 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts", - "spected-tests.ts" + "index.d.ts" ] } From 576a33bd654ed5985c297124568044d9c542ab2a Mon Sep 17 00:00:00 2001 From: Anton Astashov Date: Mon, 7 Jan 2019 21:58:24 -0600 Subject: [PATCH 170/646] Make `IRouterContext` backwards compatible --- types/koa-router/index.d.ts | 24 ++++++++++++++++++------ types/koa-router/koa-router-tests.ts | 9 ++++++++- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index 6c17c2f3c1..ad34695d2c 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -43,7 +43,19 @@ declare namespace Router { strict?: boolean; } - export interface IRouterContext { + // Deprecated - please use IRouterParamContext + export interface IRouterContext extends Koa.ParameterizedContext { + /** + * url params + */ + params: any; + /** + * the router instance + */ + router: Router; + } + + export interface IRouterParamContext { /** * url params */ @@ -56,13 +68,13 @@ declare namespace Router { export interface IMiddleware { ( - ctx: Koa.ParameterizedContext & CustomT>, + ctx: Koa.ParameterizedContext & CustomT>, next: () => Promise ): void; } export interface IParamMiddleware { - (param: string, ctx: Koa.ParameterizedContext<{}, IRouterContext>, next: () => Promise): any; + (param: string, ctx: Koa.ParameterizedContext<{}, IRouterParamContext>, next: () => Promise): any; } export interface IRouterAllowedMethodsOptions { @@ -324,12 +336,12 @@ declare class Router { /** * Returns router middleware which dispatches a route matching the request. */ - routes(): Koa.Middleware>; + routes(): Koa.Middleware>; /** * Returns router middleware which dispatches a route matching the request. */ - middleware(): Koa.Middleware>; + middleware(): Koa.Middleware>; /** * Returns separate middleware for responding to `OPTIONS` requests with @@ -338,7 +350,7 @@ declare class Router { */ allowedMethods( options?: Router.IRouterAllowedMethodsOptions - ): Koa.Middleware>; + ): Koa.Middleware>; /** * Redirect `source` to `destination` URL with optional 30x status `code`. diff --git a/types/koa-router/koa-router-tests.ts b/types/koa-router/koa-router-tests.ts index 186d253409..96fa0d1751 100644 --- a/types/koa-router/koa-router-tests.ts +++ b/types/koa-router/koa-router-tests.ts @@ -56,7 +56,11 @@ const match = router.match('/users/:id', 'GET'); let layer: Router.Layer let layerOptions: Router.ILayerOptions -const mw: Router.IMiddleware = (ctx: Koa.ParameterizedContext, next: () => Promise) => { +const mw: Router.IMiddleware = (ctx: Koa.ParameterizedContext, next: () => Promise) => { + ctx.body = "Ok"; +}; + +const mw2: Router.IMiddleware = (ctx: Router.IRouterContext, next: () => Promise) => { ctx.body = "Ok"; }; @@ -78,6 +82,9 @@ router3.get('/', (ctx) => { console.log(ctx.router.params); ctx.body = "Hello World!"; }); +router3.get('/foo', (ctx: Router.IRouterContext) => { + ctx.body = "Yup"; +}) new Koa() .use(async (ctx, next) => next()) .use(router3.routes()) From b74e03576d2c4ec88ac78d9371ed0520b34b4b47 Mon Sep 17 00:00:00 2001 From: Tomas Carnecky Date: Tue, 8 Jan 2019 05:19:47 +0100 Subject: [PATCH 171/646] next-server: dynamic() can be passed a AsyncComponentLoader This is actually the preferred form of the basic usage according to the next.js documentation. See https://nextjs.org/docs/#dynamic-import. --- types/next-server/dynamic.d.ts | 2 +- types/next-server/test/next-server-dynamic-tests.tsx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/next-server/dynamic.d.ts b/types/next-server/dynamic.d.ts index 38a85bf77e..2d06273bd5 100644 --- a/types/next-server/dynamic.d.ts +++ b/types/next-server/dynamic.d.ts @@ -31,7 +31,7 @@ type DynamicComponent

= React.ComponentType

& LoadableComponent; * https://github.com/zeit/next.js/blob/7.0.0/lib/dynamic.js#L55 */ declare function dynamic

( - options: AsyncComponent

| NextDynamicOptions

+ options: AsyncComponentLoader

| AsyncComponent

| NextDynamicOptions

): DynamicComponent

; declare function dynamic

( asyncModule: AsyncComponent

, diff --git a/types/next-server/test/next-server-dynamic-tests.tsx b/types/next-server/test/next-server-dynamic-tests.tsx index b6e0b86fe6..07844cad08 100644 --- a/types/next-server/test/next-server-dynamic-tests.tsx +++ b/types/next-server/test/next-server-dynamic-tests.tsx @@ -20,6 +20,10 @@ const LoadingComponent: React.StatelessComponent = ({ const DynamicComponent = dynamic(asyncComponent); const dynamicComponentJSX = ; +// 1.1 Basic Usage (Loader function) +const DynamicComponent2 = dynamic(() => asyncComponent); +const dynamicComponent2JSX = ; + // 2. With Custom Loading Component const DynamicComponentWithCustomLoading = dynamic(asyncComponent, { loading: LoadingComponent From 7d60e899640b1b0e1ea496ebce3ad465cff98ae8 Mon Sep 17 00:00:00 2001 From: Malash Date: Tue, 8 Jan 2019 12:44:45 +0800 Subject: [PATCH 172/646] remove unsupported functional data --- types/weixin-app/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index 2e2eb35481..89910bd9ba 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -3756,7 +3756,7 @@ declare namespace wx { Methods, Props > = object & - ComponentOptions Data), Methods, Props> & + ComponentOptions & ThisType>>; interface ComponentRelation { From a930d7bc3ae2126485fae2169c2f23e2db005bf1 Mon Sep 17 00:00:00 2001 From: Garth Kidd Date: Tue, 8 Jan 2019 16:13:44 +1100 Subject: [PATCH 173/646] h2o2: fix response toolkit decoration `h.proxy` returns a `Promise`, not `undefined`. --- types/h2o2/h2o2-tests.ts | 12 ++++++++++++ types/h2o2/index.d.ts | 12 ++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/types/h2o2/h2o2-tests.ts b/types/h2o2/h2o2-tests.ts index 9d0a590fa8..9da2899258 100644 --- a/types/h2o2/h2o2-tests.ts +++ b/types/h2o2/h2o2-tests.ts @@ -140,6 +140,18 @@ const badProtocolDemo: hapi.ServerRoute = { } }; +const replyViaToolkit: hapi.ServerRoute = { + method: 'GET', + path: '/', + async handler(req, h): Promise { + return h.proxy({ + host: '10.33.33.1', + port: '443', + protocol: 'https' + }); + } +}; + if (!module.parent) { main().then(() => console.log('done'), err => console.error(err.stack)); } diff --git a/types/h2o2/index.d.ts b/types/h2o2/index.d.ts index b6e5145eb6..58be5eb271 100644 --- a/types/h2o2/index.d.ts +++ b/types/h2o2/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for h2o2 8.1 // Project: https://github.com/hapijs/h2o2 -// Definitions by: Jason Swearingen , AJP +// Definitions by: Jason Swearingen , AJP , Garth Kidd // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -83,13 +83,17 @@ declare namespace h2o2 { declare module 'hapi' { interface HandlerDecorations { - /** Proxies the request to an upstream endpoint */ + /** + * Proxies the request to an upstream endpoint. + */ proxy?: h2o2.ProxyHandlerOptions; } interface ResponseToolkit { - /** Proxies the request to an upstream endpoint */ - proxy(options: h2o2.ProxyHandlerOptions): void; + /** + * Proxies the request to an upstream endpoint. `async`, so you'll need to `await` the `ResponseObject` to work on it before returning it. + */ + proxy(options: h2o2.ProxyHandlerOptions): Promise; } } From 0249264be7687e2971ff09cf26456c1f7e3623a0 Mon Sep 17 00:00:00 2001 From: Nitesh Phadatare Date: Tue, 8 Jan 2019 11:40:20 +0530 Subject: [PATCH 174/646] [Ramda] Added innerJoin definition --- types/ramda/es/innerJoin.d.ts | 2 ++ types/ramda/index.d.ts | 19 +++++++++++++++++++ types/ramda/ramda-tests.ts | 20 ++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 types/ramda/es/innerJoin.d.ts diff --git a/types/ramda/es/innerJoin.d.ts b/types/ramda/es/innerJoin.d.ts new file mode 100644 index 0000000000..de01332837 --- /dev/null +++ b/types/ramda/es/innerJoin.d.ts @@ -0,0 +1,2 @@ +import { innerJoin } from '../index'; +export default innerJoin; diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 4832a13fdd..d84c148d96 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -25,6 +25,7 @@ // Ryan McCuaig // Drew Wyatt // John Ottenlips +// Nitesh Phadatare // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -110,6 +111,7 @@ /// /// /// +/// /// /// /// @@ -1167,6 +1169,23 @@ declare namespace R { init(list: ReadonlyArray): T[]; init(list: string): string; + /** + * Takes a predicate `pred`, a list `xs`, and a list `ys`, and returns a list + * `xs'` comprising each of the elements of `xs` which is equal to one or more + * elements of `ys` according to `pred`. + * + * `pred` must be a binary function expecting an element from each list. + * + * `xs`, `ys`, and `xs'` are treated as sets, semantically, so ordering should + * not be significant, but since `xs'` is ordered the implementation guarantees + * that its values are in the same order as they appear in `xs`. Duplicates are + * not removed, so `xs'` may contain duplicates if `xs` contains duplicates. + */ + + innerJoin(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray, list2: ReadonlyArray): T1[]; + innerJoin(pred: (a: T1, b: T2) => boolean): (list1: ReadonlyArray, list2: ReadonlyArray) => T1[]; + innerJoin(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray): (list2: ReadonlyArray) => T1[]; + /** * Inserts the supplied element into the list, at index index. Note that * this is not destructive: it returns a copy of the list with the changes. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 362948adda..b1c0a43b39 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -2521,6 +2521,26 @@ class Rectangle { R.symmetricDifferenceWith(eqL)(l1, l2); // => ['dddd', 'c'] }; +() => { + const list1 = [ + {id: 1, name: 'One'}, + {id: 2, name: 'Two'}, + {id: 3, name: 'Three'}, + {id: 4, name: 'Four'}, + {id: 5, name: 'Five'} + ]; + + const list2 = [5, 4, 6]; + function matchId(record: any, id: number): boolean { + return record.id === id; + } + + R.innerJoin(matchId, list1, list2); // [{"id": 4, "name": "Four"}, {"id": 5, "name": "Five"}] + + const innerJoinCurried = R.innerJoin(matchId); + innerJoinCurried(list1, list2); // [{"id": 4, "name": "Four"}, {"id": 5, "name": "Five"}] +}; + /***************************************************************** * String category */ From d72dedd472fd773d9abc03d0f64802a79cc1b996 Mon Sep 17 00:00:00 2001 From: Malash Date: Tue, 8 Jan 2019 14:14:18 +0800 Subject: [PATCH 175/646] fix data type is never bug --- types/weixin-app/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index 2e2eb35481..31b4f7880a 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -3898,7 +3898,7 @@ declare namespace wx { * Note this is different from PropOptions as it is the definitions you passed to Component function * whereas this type is for call-site. */ - type DataValueType = Def extends { + type PropValueType = Def extends { type: (...args: any[]) => infer T; value?: infer T; } @@ -3926,12 +3926,12 @@ declare namespace wx { /** * 组件数据,包括内部数据和属性值 */ - data: { [key in keyof (D & P)]: DataValueType<(D & P)[key]> }; + data: D & { [key in keyof P]: PropValueType }; /** * 组件数据,包括内部数据和属性值(与 data 一致) */ - properties: { [key in keyof (D & P)]: DataValueType<(D & P)[key]> }; + properties: D & { [key in keyof P]: PropValueType }; /** * 将数据从逻辑层发送到视图层,同时改变对应的 this.data 的值 * 1. 直接修改 this.data 而不调用 this.setData 是无法改变页面的状态的,还会造成数据不一致。 From a827d39967141a9b4515300f3f7b98a4db7f151c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Tue, 8 Jan 2019 07:33:48 +0100 Subject: [PATCH 176/646] Added to list of authors. --- types/react-redux/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index ef39b6d87c..667d6ee2f8 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -12,6 +12,7 @@ // Johann Rakotoharisoa // Anatoli Papirovski // Boris Sergeyev +// Søren Bruus Frank // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 From bb53a7d08d2577f62b1b6b2097d04eaacd0dda08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:08:35 +0800 Subject: [PATCH 177/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=9C=B0=E5=9B=BE=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 160 ++++++++++++++++++++++++++++++++++++- 1 file changed, 159 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0882745c2f..6fdf7df480 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -574,7 +574,62 @@ declare namespace wx { function clearStorageSync(): void; // 媒体 - // 地图 TODO + // 地图 + interface LocationBaseOptions { + // 纬度,浮点数,范围为-90~90,负数表示南纬 + latitude: number; + // 经度,浮点数,范围为-180~180,负数表示西经 + longitude: number; + } + interface GetCenterLocationSuccCbOptions extends CommonCallbackOptions{ + success(res: LocationBaseOptions): void; + } + interface translateMarkerOptions extends CommonCallbackOptions{ + // 指定 marker + markerId: number; + // 指定 marker 移动到的目标点 + destination: LocationBaseOptions; + // 移动过程中是否自动旋转 marker + autoRotate: boolean; + // marker 的旋转角度 + rotate: number; + // 动画持续时长,平移与旋转分别计算 + duration?: number; + // 动画结束回调函数 + animationEnd?(): void; + } + interface zoomPointsOptions extends CommonCallbackOptions { + // 要显示在可视区域内的坐标点列表 + points: Array; + // 坐标点形成的矩形边缘到地图边缘的距离,单位像素。格式为[上,右,下,左],安卓上只能识别数组第一项,上下左右的padding一致。开发者工具暂不支持padding参数。 + padding?: Array; + } + interface GetReginSuccessCallbackOptions { + // 西南角经纬度 + southwest: number, + // 东北角经纬度 + northeast: number; + } + interface GetReginOptions extends CommonCallbackOptions{ + success?(callback: (res: GetReginSuccessCallbackOptions) => void): void; + } + interface GetScaleOptions extends CommonCallbackOptions{ + success?(callback: (res: {scale: number}) => void): void; + } + interface MapContext { + // 获取当前地图中心的经纬度。返回的是 gcj02 坐标系,可以用于 wx.openLocation() + getCenterLocation(options: GetCenterLocationSuccCbOptions): void; + // 将地图中心移动到当前定位点。需要配合map组件的show-location使用 + moveToLocation(): void; + // 平移marker,带动画 + translateMarker(options: translateMarkerOptions): void; + // 缩放视野展示所有经纬度 + includePoints(options: zoomPointsOptions): void; + // 获取当前地图的视野范围 + getRegion(options: GetReginOptions): void; + // 获取当前地图的缩放级别 + getScale(options: GetScaleOptions): void; + } interface LocationData { /** 纬度,浮点数,范围为-90~90,负数表示南纬 */ @@ -1440,6 +1495,8 @@ declare namespace wx { */ function hideKeyboard(): void; + // 开放接口 + // 登录 interface LoginResponse { /** 调用结果 */ errMsg: string; @@ -1458,6 +1515,10 @@ declare namespace wx { complete?: ResponseCallback; } + /** + * 检查登录态是否过期。 + */ + function checkSession(options: CommonCallbackOptions): void; /** * 调用接口获取登录凭证(code)进而换取用户登录态信息, * 包括用户的唯一标识(openid) 及本次登录的 会话密钥(session_key)。 @@ -1465,6 +1526,51 @@ declare namespace wx { */ function login(option: LoginOptions): void; + type envVersion = 'develop' | 'trial' | 'release'; + interface NavigateToMiniProgramOptions extends CommonCallbackOptions { + // 要打开的小程序 appId + appId: string; + // 打开的页面路径,如果为空则打开首页 + path?: string; + // 需要传递给目标小程序的数据,目标小程序可在 App.onLaunch,App.onShow 中获取到这份数据。 + extraData?: object; + // 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 + envVersion?: envVersion; + } + /** + * 打开另一个小程序 + */ + function navigateToMiniProgram(options: NavigateToMiniProgramOptions): void; + interface NavigateBackMiniProgramOptions extends CommonCallbackOptions { + // 需要返回给上一个小程序的数据,上一个小程序可在 App.onShow 中获取到这份数据。 + extraData: object; + } + /** + * 返回到上一个小程序。只有在当前小程序是被其他小程序打开时可以调用成功 + */ + function navigateBackMiniProgram(options: NavigateBackMiniProgramOptions): void; + + // 帐号信息 + interface AccountInfo { + // 小程序帐号信息 + miniProgram: { + // 小程序appId + appId: string; + }; + // 插件帐号信息(仅在插件中调用时包含这一项) + Plugin: { + // 插件appId + appId: string; + // 插件版本号 + vetsion: string + }; + } + /** + * 获取当前账号信息 + */ + function getAccountInfoSync(): AccountInfo; + + // 帐号信息 interface UserInfo { nickName: string; avatarUrl: string; @@ -1515,11 +1621,63 @@ declare namespace wx { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ResponseCallback; } + // 支付 /** * 发起微信支付。 */ function requestPayment(options: RequestPaymentOptions): void; + + // 授权 + /** + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html + * 用户信息 wx.getUserInfo、 + * 地理位置 wx.getLocation,wx.chooseLocation、 + * 通讯地址 wx.chooseAddress、 + * 发票抬头 wx.chooseInvoiceTitle、 + * 获取发票 wx.chooseInvoice、 + * 微信运动步数 wx.getWeRunData、 + * 录音功能 wx.startRecord、 + * 保存到相册 wx.saveImageToPhotosAlbum, wx.saveVideoToPhotosAlbum、 + * 摄像头 组件 + */ + type Scope = 'userInfo' | 'userLocation' | 'address' | 'invoiceTitle' | 'invoice' | 'werun' | 'record' | 'writePhotosAlbum' | 'camera'; + interface AuthorizeOptions extends CommonCallbackOptions { + // 需要获取权限的 scope,详见 scope 列表 + scope: Scope; + } + /** + * 提前向用户发起授权请求。调用后会立刻弹窗询问用户是否同意授权小程序使用某项功能或获取用户的某些数据,但不会实际调用对应接口。如果用户之前已经同意授权,则不会出现弹窗,直接返回成功。 + */ + function authorize(options: AuthorizeOptions): void; + + // 设置 + interface SettingOptions extends CommonCallbackOptions{ + success?(res: AuthSetting): void; + } + /** + * 调起客户端小程序设置界面,返回用户设置的操作结果。设置界面只会出现小程序已经向用户请求过的权限。 + */ + function openSetting(options: SettingOptions): void; + /** + * 获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。 + */ + function getSetting(options: SettingOptions): void; + /** + * 用户授权结果,参考 type Scope + */ + interface AuthSetting { + 'scope.userInfo': boolean; + 'scope.userLocation': boolean; + 'scope.address': boolean; + 'scope.invoiceTitle': boolean; + 'scope.invoice': boolean; + 'scope.werun': boolean; + 'scope.record': boolean; + 'scope.writePhotosAlbum': boolean; + 'scope.camera': boolean; + } } +// end of wx namespace interface Page { From df704ca70e81f456349b25ebfa36e37284e50a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:16:37 +0800 Subject: [PATCH 178/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0author=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 6fdf7df480..0cbaf8b97b 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for weapp // Project: https://mp.weixin.qq.com/debug/wxadoc/dev/index.html -// Definitions by: vargeek +// Definitions by: vargeek & pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace wx { From 5704e7c110997b20a8712a69014987715c2864d3 Mon Sep 17 00:00:00 2001 From: Krzysztof Grzybek Date: Tue, 8 Jan 2019 09:35:40 +0100 Subject: [PATCH 179/646] [aframe] component definition improvement --- types/aframe/index.d.ts | 2 +- types/aframe/test/aframe-io-tests.ts | 38 ++++++++++++++-------------- types/aframe/test/aframe-tests.ts | 1 + 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts index 0a3ba3c133..67257c6f65 100644 --- a/types/aframe/index.d.ts +++ b/types/aframe/index.d.ts @@ -358,7 +358,7 @@ export interface Utils { // Definitions // used as mixins to register functions to create classes (newable functions) in A-Frame -export type ComponentDefinition = T & Partial; +export type ComponentDefinition = T & Partial & ThisType; export type GeometryDefinition = T & Partial>; export type NodeDefinition = T & Partial; export interface PrimitiveDefinition { diff --git a/types/aframe/test/aframe-io-tests.ts b/types/aframe/test/aframe-io-tests.ts index 1120b50be8..a846976b80 100644 --- a/types/aframe/test/aframe-io-tests.ts +++ b/types/aframe/test/aframe-io-tests.ts @@ -30,7 +30,7 @@ AFRAME.registerComponent('set-image', { init: function() { var data = this.data; - var el = this.el!; + var el = this.el; this.setupFadeAnimation(); @@ -133,14 +133,14 @@ AFRAME.registerComponent('arrow-key-rotation', { if (!this.data.enabled) { return; } - var rotation = this.el!.getAttribute('rotation'); + var rotation = this.el.getAttribute('rotation'); if (!rotation) { return; } if (this.directionX || this.directionY) { rotation.x += this.data.dx * this.directionY; rotation.y += this.data.dy * this.directionX; - this.el!.setAttribute('rotation', rotation); + this.el.setAttribute('rotation', rotation); } } }); @@ -164,10 +164,10 @@ AFRAME.registerComponent('hide-once-playing', { } }, onPlaying: function() { - this.el!.setAttribute('visible', false); + this.el.setAttribute('visible', false); }, onPause: function() { - this.el!.setAttribute('visible', true); + this.el.setAttribute('visible', true); } }); @@ -178,10 +178,10 @@ AFRAME.registerComponent('play-on-vrdisplayactivate-or-enter-vr', { }, play: function() { window.addEventListener('vrdisplayactivate', this.playVideo); - this.el!.sceneEl!.addEventListener('enter-vr', this.playVideoNextTick); + this.el.sceneEl!.addEventListener('enter-vr', this.playVideoNextTick); }, pause: function() { - this.el!.sceneEl!.removeEventListener('enter-vr', this.playVideoNextTick); + this.el.sceneEl!.removeEventListener('enter-vr', this.playVideoNextTick); window.removeEventListener('vrdisplayactivate', this.playVideo); }, playVideoNextTick: function() { @@ -189,7 +189,7 @@ AFRAME.registerComponent('play-on-vrdisplayactivate-or-enter-vr', { }, playVideo: function() { // TODO improve type - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -208,7 +208,7 @@ AFRAME.registerComponent('play-on-window-click', { window.removeEventListener('click', this.onClick); }, onClick: function() { - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -227,7 +227,7 @@ AFRAME.registerComponent('toggle-play-on-window-click', { window.removeEventListener('click', this.onClick); }, onClick: function() { - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -359,7 +359,7 @@ AFRAME.registerComponent('audioanalyser-levels-scale', { return; } - children = this.el!.children; + children = this.el.children; for (var i = 0; i < children.length; i++) { (children[i] as ANode).setAttribute('scale', { x: 1, @@ -382,7 +382,7 @@ AFRAME.registerComponent('audioanalyser-volume-bind', { tick: function() { var analyserComponent; var data = this.data; - var el = this.el!; + var el = this.el; var value; analyserComponent = data.analyserEl.components.audioanalyser; @@ -404,7 +404,7 @@ AFRAME.registerComponent('audioanalyser-volume-scale', { tick: function() { var analyserEl = this.data.analyserEl || this.el; var analyserComponent; - var el = this.el!; + var el = this.el; var volume; analyserComponent = analyserEl.components.audioanalyser; @@ -542,7 +542,7 @@ AFRAME.registerComponent('audioanalyser-waveform', { }, remove: function() { - this.el!.removeObject3D('waveformContainer'); + this.el.removeObject3D('waveformContainer'); } }); @@ -874,7 +874,7 @@ AFRAME.registerComponent('color-on-beat', { init: function() { var analyserEl = this.data.analyserEl || this.el; - var el = this.el!; + var el = this.el; analyserEl.addEventListener('audioanalyser-beat', function() { el.setAttribute( @@ -909,12 +909,12 @@ AFRAME.registerComponent('remove-on-event', { removeEventListener: function() { var data = this.data; - var el = this.el!; + var el = this.el; el.removeEventListener(data.event, this._removeEntity); }, _removeEntity: function() { - var el = this.el!; + var el = this.el; if ((el as any).parentEl) { (el as any).parentEl.removeChild(el); } @@ -1016,7 +1016,7 @@ function rgbToHex(r: number, g: number, b: number) { AFRAME.registerComponent('random-material', { init: function() { - this.el!.setAttribute('material', { + this.el.setAttribute('material', { color: this.getRandomColor(), metalness: Math.random(), roughness: Math.random() @@ -1034,7 +1034,7 @@ AFRAME.registerComponent('random-material', { AFRAME.registerComponent('random-torus-knot', { init: function() { - this.el!.setAttribute('geometry', { + this.el.setAttribute('geometry', { primitive: 'torusKnot', radius: Math.random() * 10, radiusTubular: Math.random() * 0.75, diff --git a/types/aframe/test/aframe-tests.ts b/types/aframe/test/aframe-tests.ts index 2d6ff5bb7e..ac61f7f806 100644 --- a/types/aframe/test/aframe-tests.ts +++ b/types/aframe/test/aframe-tests.ts @@ -75,6 +75,7 @@ const Component = registerComponent('test-component', { }, init() { this.data.num = 0; + this.el.setAttribute('custom-attribute', 'custom-value'); }, update() {}, tick() {}, From af503c0c11e282af711655dee39f315f4a857df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:59:03 +0800 Subject: [PATCH 180/646] add author and TypeScript version --- types/weapp-api/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0cbaf8b97b..4350eb1d25 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for weapp // Project: https://mp.weixin.qq.com/debug/wxadoc/dev/index.html -// Definitions by: vargeek & pbestz +// Definitions by: vargeek +// pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2.1 declare namespace wx { // import startPullDownRefresh = swan.startPullDownRefresh; From 397470e63d5b6346fb22aeece72ee307ae017d1c Mon Sep 17 00:00:00 2001 From: bocai Date: Tue, 1 Jan 2019 23:26:42 +0800 Subject: [PATCH 181/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UpdateManager?= =?UTF-8?q?=E3=80=81onLaunch=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/weapp-api-tests.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 82a5b8d91d..e13f3766d5 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -347,6 +347,30 @@ wx.getSystemInfo({ } }) +const updateManager = wx.getUpdateManager() + +// updateManager.onCheckForUpdate(function (res) { +// //请求完新版本信息的回调 +// console.log(res.hasUpdate) +// }) + +updateManager.onUpdateReady(function () { + // wx.showModal({ + // title: '更新提示', + // content: '新版本已经准备好,是否重启应用?', + // success(res) { + // if (res.confirm) { + // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + // updateManager.applyUpdate() + // } + // } + // }) +}) + +updateManager.onUpdateFailed(function () { + // 新版本下载失败 +}) + wx.onAccelerometerChange(function(res) { console.log(res.x) console.log(res.y) @@ -673,3 +697,9 @@ wx.requestPayment({ 'fail':function(res){ } }) + +App({ + onLaunch(options){ + console.log(options.query) + } +}) From 71219ace4fdccd537643ad440e709ce2feeddbb1 Mon Sep 17 00:00:00 2001 From: bocai Date: Tue, 1 Jan 2019 23:28:51 +0800 Subject: [PATCH 182/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UpdateManager?= =?UTF-8?q?=E3=80=81onLaunch=E7=9B=B8=E5=85=B3=E5=A3=B0=E6=98=8E=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E4=BD=BF=E7=94=A8type=20aliases/interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 51 +++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index f22ed51765..c3b85a658a 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -37,12 +37,33 @@ declare namespace wx { [key: string]: any; } + interface referrerInfo { + /** 来源小程序、公众号或 App 的 appId */ + appId: string, + /** 来源小程序传过来的数据,scene=1037或1038时支持 */ + extraData: Object + } + + interface LaunchOptions { + /** 启动小程序的路径 */ + path: string, + /** 启动小程序的场景值 */ + scene: number, + /** 启动小程序的query参数 */ + query: Object, + shareTicket: string, + /** 来源信息。从另一个小程序、公众号或App进入小程序时返回。范泽返回{} */ + referrerInfo: referrerInfo + } + + type LaunchCallback = (options: LaunchOptions) => void; + interface AppOptions { /** * 生命周期函数--监听小程序初始化 * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) */ - onLaunch?: NoneParamCallback; + onLaunch?: LaunchCallback; /** * 生命周期函数--监听小程序显示 * 当小程序启动,或从后台进入前台显示,会触发 onShow @@ -561,6 +582,34 @@ declare namespace wx { */ function getSystemInfo(options: GetSystemInfoOptions): void; + interface UpdateManager { + /** + * 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 onUpdateReady 回调)调用。 + */ + applyUpdate(callback: DataResponseCallback): void; + /** + * 监听向微信后台请求检查更新结果事件。微信在小程序冷启动时自动检查更新,不需由开发者主动触发。 + */ + onCheckForUpdate(): void; + /** + * 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调 + */ + onUpdateReady(callback: NoneParamCallback): void; + /** + * 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调 + */ + onUpdateFailed(callback: NoneParamCallback): void; + } + /** + * 获取全局唯一的版本更新管理器,用于管理小程序更新。关于小程序的更新机制,可以查看运行机制文档。 + */ + function getUpdateManager(): UpdateManager; + + /** + * 获取小程序启动时的参数。与 App.onLaunch 的回调参数一致。 + */ + function getLaunchOptionsSync(): LaunchCallback; + interface AccelerometerData { /** X 轴 */ x: number; From 4c2a32422d3cf0e01d4800c9dfd30749d88c7de3 Mon Sep 17 00:00:00 2001 From: bocai Date: Wed, 2 Jan 2019 01:40:37 +0800 Subject: [PATCH 183/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=BA=A7=E4=BA=8B=E4=BB=B6=E3=80=81=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E3=80=81=E8=B7=AF=E7=94=B1=E3=80=81=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 131 +++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 5 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index c3b85a658a..0e06bd8357 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: vargeek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import functions from "../react-icons/md/functions"; + declare namespace wx { type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; @@ -44,7 +46,7 @@ declare namespace wx { extraData: Object } - interface LaunchOptions { + interface onLaunchOptions { /** 启动小程序的路径 */ path: string, /** 启动小程序的场景值 */ @@ -56,24 +58,34 @@ declare namespace wx { referrerInfo: referrerInfo } - type LaunchCallback = (options: LaunchOptions) => void; + type onLaunchCallback = (options: onLaunchOptions) => void; + type onShowOptions = onLaunchOptions; interface AppOptions { /** * 生命周期函数--监听小程序初始化 * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) */ - onLaunch?: LaunchCallback; + onLaunch?: onLaunchCallback; /** * 生命周期函数--监听小程序显示 * 当小程序启动,或从后台进入前台显示,会触发 onShow */ - onShow?: NoneParamCallback; + onShow?: (options: onShowOptions) => void; /** * 生命周期函数--监听小程序隐藏 * 当小程序从前台进入后台,会触发 onHide */ onHide?: NoneParamCallback; + /** 小程序发生脚本错误或 API 调用报错时触发。也可以使用 wx.onError 绑定监听。*/ + onError?: ErrorCallback; + /** + * 小程序要打开的页面不存在时触发 + * 1. 开发者可以在回调中进行页面重定向,但必须在回调中同步处理,异步处理(例如 setTimeout 异步执行)无效。 + * 2. 若开发者没有调用 wx.onPageNotFound 绑定监听,也没有声明 App.onPageNotFound,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。 + * 3. 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。 + */ + onPageNotFound?: NoneParamCallback; [key: string]: any } @@ -608,7 +620,87 @@ declare namespace wx { /** * 获取小程序启动时的参数。与 App.onLaunch 的回调参数一致。 */ - function getLaunchOptionsSync(): LaunchCallback; + function getLaunchOptionsSync(): onLaunchCallback; + + // 应用级事件 + /** + * 取消监听小程序要打开的页面不存在事件 + */ + function offPageNotFound(): NoneParamCallback; + /** + * 监听小程序要打开的页面不存在事件。该事件与 App.onPageNotFound 的回调时机一致。 + */ + function onPageNotFound(): NoneParamCallback; + /** + * 取消监听小程序错误事件。 + */ + function offError(): NoneParamCallback; + /** + * 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 App.onError 的回调时机与参数一致。 + */ + function onError(): ErrorCallback; + /** + * 取消监听小程序切前台事件 + */ + function offAppShow(): NoneParamCallback; + /** + * 监听小程序切前台事件。该事件与 App.onShow 的回调参数一致。 + * @param callback + */ + function onAppShow(callback: onShowOptions): void; + /** + * 取消监听小程序切后台事件 + */ + function offAppHide(): NoneParamCallback; + /** + * 监听小程序切后台事件。该事件与 App.onHide 的回调时机一致。 + */ + function onAppHide(): NoneParamCallback; + + // 调试 TODO + + // 路由 + interface routerOptions { + + } + /** + * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。 + */ + function navigateBack(): void; + function switchTab(): void; + function navigateTo(): void; + function reLaunch(): void; + function redirectTo(): void; + + // 界面 + // 交互 + // tapIndex为用户点击的按钮序号,从上到下的顺序,从0开始 + type ActionSheetSuccessCallback = (res: {tapIndex: number}) => void; + + interface ActionSheetOptions { + // 必填,按钮的文字数组,数组长度最大为 6 + itemList: Array; + // 按钮的文字颜色 + itemColor?: string; + success?: ActionSheetSuccessCallback; + fail?: ResponseCallback; + complete?: ResponseCallback; + } + /** + * 显示操作菜单 + */ + function showActionSheet(options: ActionSheetOptions): void; + function hideLoading(): void; + function showLoading(): void; + function hideToast(): void; + function showToast(): void; + function showModal(): void; + + // 导航栏 + function setNavigationBarColor(): void; + function hideNavigationBarLoading(): void; + function showNavigationBarLoading(): void; + function setNavigationBarTitle(): void; interface AccelerometerData { /** X 轴 */ @@ -1182,3 +1274,32 @@ declare var App: AppConstructor; * 我们提供了全局的 getApp() 函数,可以获取到小程序实例。 */ declare function getApp(): App; + +// 定时器 +/** + * 设定一个定时器。在定时到期以后执行注册的回调函数 + * @param callback + * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 + * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 + */ +declare function setTimeout(callback: functions, delay: number, rest: any): number; + +/** + * 取消由 setTimeout 设置的定时器。 + * @param timeoutID 要取消的定时器的ID + */ +declare function clearTimeout(timeoutID: number): number; + +/** + * 设定一个定时器。按照指定的周期(以毫秒计)来执行注册的回调函数 + * @param callback + * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 + * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 + */ +declare function setInterval(callback: functions, delay: number, rest: any): number; + +/** + * 取消由 setInterval 设置的定时器。 + * @param timeoutID 要取消的定时器的ID + */ +declare function clearInterval(timeoutID: number): number; From 0aadfcc335eb66021214ce86619b574c78b9fc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Wed, 2 Jan 2019 21:45:48 +0800 Subject: [PATCH 184/646] modify --- types/weapp-api/index.d.ts | 67 +++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0e06bd8357..fa328782ca 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -686,15 +686,72 @@ declare namespace wx { fail?: ResponseCallback; complete?: ResponseCallback; } + + interface CommonCallbackOptions { + success?: ResponseCallback; + fail?: ResponseCallback; + complete?: ResponseCallback; + } + + interface LoadingOptions extends CommonCallbackOptions{ + // must,提示的内容 + title: string; + // 默认false。是否显示透明蒙层,防止触摸穿透 + mask: boolean; + } + + type icon = 'success' | 'loading' | 'none'; + interface ToastOptions extends CommonCallbackOptions{ + // 提示的内容 + title: string; + // 图标,默认值'success' + icon?: icon; + // 自定义图标的本地路径,image 的优先级高于 icon + imgage?: string; + // 提示的延迟时间,默认值1500ms + duration?: number; + // 是否显示透明蒙层,防止触摸穿透,默认值false + mask: boolean; + } + + interface ModalOptions extends CommonCallbackOptions{ + // 提示的内容 + title: string; + // 提示的内容 + content: string; + // 是否显示取消按钮,默认值true + showCancel?: boolean; + // 取消按钮的文字,最多 4 个字符,默认值'取消' + cancelText?: string; + // 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串,默认值'#000000' + cancelColor?: string; + // 确认按钮的文字,最多 4 个字符 + confirmText?: string; + // 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串,默认值'#3cc51f' + confirmColor?: boolean; + } /** * 显示操作菜单 */ function showActionSheet(options: ActionSheetOptions): void; - function hideLoading(): void; - function showLoading(): void; - function hideToast(): void; - function showToast(): void; - function showModal(): void; + /** + * 隐藏 loading 提示框 + * @param options + */ + function hideLoading(options?: CommonCallbackOptions): void; + /** + * 显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框 + * @param options + */ + function showLoading(options: LoadingOptions): void; + function hideToast(options?: CommonCallbackOptions): void; + function showToast(options: ToastOptions): void; + + /** + * 显示模态对话框 + * @param options + */ + function showModal(options: ModalOptions): void; // 导航栏 function setNavigationBarColor(): void; From 9989c26e9226b18d4b8f94f1f16d559dba310dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 21:12:02 +0800 Subject: [PATCH 185/646] =?UTF-8?q?weapp-api,=E5=A2=9E=E5=8A=A0=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E9=83=A8=E5=88=86=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 51 ++++++++++++++++++++-- types/weapp-api/tsconfig.json | 5 ++- types/weapp-api/weapp-api-tests.ts | 69 +++++++++++++++--------------- 3 files changed, 84 insertions(+), 41 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index fa328782ca..fec6f90f14 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -687,6 +687,9 @@ declare namespace wx { complete?: ResponseCallback; } + /** + * 公共回调函数 + */ interface CommonCallbackOptions { success?: ResponseCallback; fail?: ResponseCallback; @@ -744,20 +747,60 @@ declare namespace wx { * @param options */ function showLoading(options: LoadingOptions): void; + /** + * 隐藏消息提示框 + * @param options + */ function hideToast(options?: CommonCallbackOptions): void; + /** + * 显示消息提示框 + * @param options + */ function showToast(options: ToastOptions): void; - /** * 显示模态对话框 * @param options */ function showModal(options: ModalOptions): void; + + interface NavigationBarColorAnimationOptions { + // 动画变化时间,单位 ms,默认0 + animation?: number; + // 动画变化方式.动画从头到尾的速度是相同的,动画以低速开始,动画以低速结束,动画以低速开始和结束 + timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' + } + interface NavigationBarColorOptions extends CommonCallbackOptions{ + // 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 + frontColor: string; + // 背景颜色值,有效值为十六进制颜色 + backgroundColor: string; + // 动画效果 + animation: NavigationBarColorAnimationOptions; + } + interface NavigationBarTitleOptions extends CommonCallbackOptions{ + // 动态设置当前页面的标题 + title: string; + } // 导航栏 function setNavigationBarColor(): void; - function hideNavigationBarLoading(): void; - function showNavigationBarLoading(): void; - function setNavigationBarTitle(): void; + /** + * 在当前页面隐藏导航条加载动画 + */ + function hideNavigationBarLoading(options?: CommonCallbackOptions): void; + /** + * 在当前页面显示导航条加载动画 + */ + function showNavigationBarLoading(options: CommonCallbackOptions): void; + /** + * 动态设置当前页面的标题 + * @param options + */ + function setNavigationBarTitle(options: NavigationBarTitleOptions): void; + + // 背景 + function setBackgroundTextStyle(): void; + function setBackgroundColor(): void; interface AccelerometerData { /** X 轴 */ diff --git a/types/weapp-api/tsconfig.json b/types/weapp-api/tsconfig.json index ef43ffab75..74812f3d05 100644 --- a/types/weapp-api/tsconfig.json +++ b/types/weapp-api/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "weapp-api-tests.ts" + "weapp-api-tests.ts", + "../baidu-app/index.d.ts" ] -} \ No newline at end of file +} diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index e13f3766d5..4363179c80 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -14,7 +14,7 @@ App({ wx.login({ success: function () { wx.getUserInfo({ - success: function (res) { + success: function (res: any) { that.globalData.userInfo = res.userInfo; typeof cb == "function" && cb(that.globalData.userInfo) } @@ -37,7 +37,6 @@ Page({ foo: 'bar' }, onLoad: function (options) { - console.log(options.title); } }) @@ -51,13 +50,13 @@ wx.request({ header: { 'Content-Type': 'application/json' }, - success: function (res) { + success: function (res: any) { console.log(res.data) } }) wx.chooseImage({ - success: function (res) { + success: function (res: any) { var tempFilePaths = res.tempFilePaths wx.uploadFile({ url: 'http://example.com/upload', @@ -73,7 +72,7 @@ wx.chooseImage({ wx.downloadFile({ url: 'http://example.com/audio/123', type: 'audio', - success: function (res) { + success: function (res: any) { wx.playVoice({ filePath: res.tempFilePath }) @@ -95,17 +94,17 @@ wx.connectSocket({ wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { console.log('WebSocket连接已打开!') }) wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { console.log('WebSocket连接已打开!') }) -wx.onSocketError(function (res) { +wx.onSocketError(function (res: any) { console.log('WebSocket连接打开失败,请检查!') }) @@ -115,7 +114,7 @@ wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { socketOpen = true for (var i = 0; i < socketMsgQueue.length; i++) { sendSocketMessage(socketMsgQueue[i]) @@ -137,7 +136,7 @@ wx.connectSocket({ url: 'test.php' }) -wx.onSocketMessage(function (res) { +wx.onSocketMessage(function (res: any) { console.log('收到服务器内容:' + res.data) }) @@ -152,7 +151,7 @@ wx.onSocketOpen(function () { wx.closeSocket() }) -wx.onSocketClose(function (res) { +wx.onSocketClose(function (res: any) { console.log('WebSocket 已关闭!') }) @@ -160,7 +159,7 @@ wx.chooseImage({ count: 1, // 默认9 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { + success: function (res: any) { // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 var tempFilePaths = res.tempFilePaths } @@ -172,10 +171,10 @@ wx.previewImage({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath }, - fail: function (res) { + fail: function (res: any) { //录音失败 } }) @@ -185,7 +184,7 @@ setTimeout(function () { }, 10000) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath, @@ -196,7 +195,7 @@ wx.startRecord({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath @@ -210,7 +209,7 @@ wx.startRecord({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath @@ -223,7 +222,7 @@ wx.startRecord({ }) wx.getBackgroundAudioPlayerState({ - success: function (res) { + success: function (res: any) { var status = res.status var dataUrl = res.dataUrl var currentPosition = res.currentPosition @@ -246,11 +245,11 @@ wx.seekBackgroundAudio({ wx.stopBackgroundAudio() wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.saveFile({ tempFilePath: tempFilePath, - success: function (res) { + success: function (res: any) { var savedFilePath = res.savedFilePath } }) @@ -265,7 +264,7 @@ Page({ sourceType: ['album', 'camera'], maxDuration: 60, camera: ['front', 'back'], - success: function (res) { + success: function (res: any) { that.setData({ src: res.tempFilePath }) @@ -286,7 +285,7 @@ try { wx.getStorage({ key: 'key', - success: function (res) { + success: function (res: any) { console.log(res.data) } }) @@ -309,7 +308,7 @@ try { wx.getLocation({ type: 'wgs84', - success: function (res) { + success: function (res: any) { var latitude = res.latitude var longitude = res.longitude var speed = res.speed @@ -319,7 +318,7 @@ wx.getLocation({ wx.getLocation({ type: 'gcj02', //返回可以用于wx.openLocation的经纬度 - success: function(res) { + success: function(res: any) { var latitude = res.latitude var longitude = res.longitude wx.openLocation({ @@ -331,13 +330,13 @@ wx.getLocation({ }) wx.getNetworkType({ - success: function(res) { + success: function(res: any) { var networkType = res.networkType // 返回网络类型2g,3g,4g,wifi } }) wx.getSystemInfo({ - success: function(res) { + success: function(res: any) { console.log(res.model) console.log(res.pixelRatio) console.log(res.windowWidth) @@ -349,7 +348,7 @@ wx.getSystemInfo({ const updateManager = wx.getUpdateManager() -// updateManager.onCheckForUpdate(function (res) { +// updateManager.onCheckForUpdate(function (res: any) { // //请求完新版本信息的回调 // console.log(res.hasUpdate) // }) @@ -358,7 +357,7 @@ updateManager.onUpdateReady(function () { // wx.showModal({ // title: '更新提示', // content: '新版本已经准备好,是否重启应用?', - // success(res) { + // success(res: any) { // if (res.confirm) { // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // updateManager.applyUpdate() @@ -371,13 +370,13 @@ updateManager.onUpdateFailed(function () { // 新版本下载失败 }) -wx.onAccelerometerChange(function(res) { +wx.onAccelerometerChange(function(res: any) { console.log(res.x) console.log(res.y) console.log(res.z) }) -wx.onCompassChange(function (res) { +wx.onCompassChange(function (res: any) { console.log(res.direction) }) @@ -543,7 +542,7 @@ Page({ onReady: function() { var context = wx.createContext() wx.chooseImage({ - success: function(res) { + success: function(res: any) { context.drawImage(res.tempFilePaths[0], 0, 0) wx.drawCanvas({ canvasId: 1, @@ -656,7 +655,7 @@ Page({ App({ onLaunch: function() { wx.login({ - success: function(res) { + success: function(res: any) { if (res.code) { //发起网络请求 wx.request({ @@ -675,7 +674,7 @@ App({ wx.getUserInfo({ - success: function(res) { + success: function(res: any) { var userInfo = res.userInfo var nickName = userInfo.nickName var avatarUrl = userInfo.avatarUrl @@ -692,9 +691,9 @@ wx.requestPayment({ 'package': '', 'signType': 'MD5', 'paySign': '', - 'success':function(res){ + 'success':function(res: any){ }, - 'fail':function(res){ + 'fail':function(res: any){ } }) From 537fd9a06d5bf3fbc1c73722585e7707181bb20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 22:02:56 +0800 Subject: [PATCH 186/646] weapp-api,export wx --- types/weapp-api/index.d.ts | 2 ++ types/weapp-api/weapp-api-tests.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index fec6f90f14..5eb9c36175 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1403,3 +1403,5 @@ declare function setInterval(callback: functions, delay: number, rest: any): num * @param timeoutID 要取消的定时器的ID */ declare function clearInterval(timeoutID: number): number; + +export default wx diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 4363179c80..5b2b0616a2 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -1,12 +1,13 @@ +import wx from './index' App({ onLaunch: function () { //调用API从本地缓存中获取数据 - var logs = wx.getStorageSync('logs') as Array || [] + let logs = wx.getStorageSync('logs') as Array || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) }, getUserInfo: function (cb: Function) { - var that = this; + let that = this; if (this.globalData.userInfo) { typeof cb == "function" && cb(this.globalData.userInfo) } else { From c2d2111a3a07444d3e6c0e2e4f9e20b5621ea41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 22:08:31 +0800 Subject: [PATCH 187/646] modify functions type --- types/weapp-api/index.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 5eb9c36175..dcc3cd3e16 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: vargeek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import functions from "../react-icons/md/functions"; - declare namespace wx { type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; @@ -1382,7 +1380,7 @@ declare function getApp(): App; * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ -declare function setTimeout(callback: functions, delay: number, rest: any): number; +declare function setTimeout(callback: any, delay: number, rest: any): number; /** * 取消由 setTimeout 设置的定时器。 @@ -1396,7 +1394,7 @@ declare function clearTimeout(timeoutID: number): number; * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ -declare function setInterval(callback: functions, delay: number, rest: any): number; +declare function setInterval(callback: any, delay: number, rest: any): number; /** * 取消由 setInterval 设置的定时器。 From 53b61db0513a8570fd15794ef80d071de8d48c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Mon, 7 Jan 2019 15:49:11 +0800 Subject: [PATCH 188/646] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=EF=BC=8C=E8=B7=AF=E7=94=B1=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 327 +++++++++++++++++++++++++++++-------- 1 file changed, 258 insertions(+), 69 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index dcc3cd3e16..0882745c2f 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace wx { + // import startPullDownRefresh = swan.startPullDownRefresh; type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; type ResponseCallback = (res: any) => void; @@ -87,6 +88,8 @@ declare namespace wx { [key: string]: any } + // 网络 + // 发起请求 interface RequestHeader { [key: string]: string; } @@ -109,9 +112,79 @@ declare namespace wx { /** * wx.request发起的是https请求。一个微信小程序,同时只能有5个网络请求连接。 */ - function request(options: RequestOptions): void; + function request(options: RequestOptions): RequestTask; + /** + * 网络请求任务对象 + */ + interface RequestTask { + // 中断请求任务 + abort(): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } + // 下载 + interface OnProgressCallbackOptions { + // 下载进度百分比 + progress: number; + // 已经下载的数据长度,单位 Bytes + totalBytesWritten: number; + // 预期需要下载的数据总长度,单位 Bytes + totalBytesExpectedToWrite: number; + } + /** + * 一个可以监听下载进度变化事件,以及取消下载任务的对象 + */ + interface DownloadTask { + // 中断下载任务 + abort(): void; + // 下载进度变化事件的回调函数 + onProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 取消监听下载进度变化事件 + offProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } + interface DownloadFileOptions { + /** 下载资源的 url */ + url: string; + /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ + type?: string; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ + success?: TempFileResponseCallback; + /** 接口调用失败的回调函数 */ + fail?: ResponseCallback; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ResponseCallback; + } + /** + * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, + * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 + */ + function downloadFile(options: DownloadFileOptions): DownloadTask; + // 上传 + /** + * 一个可以监听上传进度变化事件,以及取消上传任务的对象 + */ + interface UploadTask { + // 中断上传任务 + abort(): void; + // 上传进度变化事件的回调函数 + onProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 取消监听上传进度变化事件 + offProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } interface UploadFileOptions { /** 开发者服务器 url */ url: string; @@ -137,30 +210,9 @@ declare namespace wx { * 客户端发起一个 HTTPS POST 请求, * 其中 Content-Type 为 multipart/form-data 。 */ - function uploadFile(options: UploadFileOptions): void; - - - interface DownloadFileOptions { - /** 下载资源的 url */ - url: string; - /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ - type?: string; - /** HTTP 请求 Header */ - header?: RequestHeader; - /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ - success?: TempFileResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, - * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 - */ - function downloadFile(options: DownloadFileOptions): void; - + function uploadFile(options: UploadFileOptions): UploadTask; + // WebSocket interface ConnectSocketOptions { /** 开发者服务器接口地址,必须是 HTTPS 协议,且域名必须是后台配置的合法域名 */ url: string; @@ -440,6 +492,29 @@ declare namespace wx { */ function chooseVideo(options: ChooseVideoOptions): void; + // 数据缓存 + interface StorageInfo { + // 当前 storage 中所有的 key + keys: Array; + // 当前占用的空间大小, 单位 KB + currentSize: number; + // 限制的空间大小,单位 KB + limitSize: number; + } + type StorageInfoCallback = (res: StorageInfoOptions) => void; + interface StorageInfoOptions extends CommonCallbackOptions{ + success?: StorageInfoCallback; + } + /** + * getStorageInfo的同步版本 + */ + function getStorageInfoSync(): StorageInfo; + /** + * 异步获取当前storage的相关信息 + * @param options + */ + function getStorageInfo(options: StorageInfoOptions): void; + interface SetStorageOptions { /** 本地缓存中的指定的 key */ key: string; @@ -498,6 +573,9 @@ declare namespace wx { */ function clearStorageSync(): void; + // 媒体 + // 地图 TODO + interface LocationData { /** 纬度,浮点数,范围为-90~90,负数表示南纬 */ latitude: number; @@ -658,17 +736,36 @@ declare namespace wx { // 调试 TODO // 路由 - interface routerOptions { - + interface routerOptions extends CommonCallbackOptions{ + // 需要跳转的应用内非 tabBar 的页面的路径, 路径后可以带参数。参数与路径之间使用 ? 分隔,参数键与参数值用 = 相连,不同参数用 & 分隔;如 'path?key=value&key2=value2' + url: string; + } + interface NavigateBackOptions extends CommonCallbackOptions { + // 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 + delta: number; } /** * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。 */ - function navigateBack(): void; - function switchTab(): void; - function navigateTo(): void; - function reLaunch(): void; - function redirectTo(): void; + function navigateBack(options: NavigateBackOptions): void; + /** + * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 + * @param options + */ + function switchTab(options: routerOptions): void; + /** + * 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 wx.navigateBack 可以返回到原页面。 + * @param options + */ + function navigateTo(options: routerOptions): void; + /** + * 关闭所有页面,打开到应用内的某个页面 + */ + function reLaunch(options: routerOptions): void; + /** + * 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 + */ + function redirectTo(options: routerOptions): void; // 界面 // 交互 @@ -689,8 +786,11 @@ declare namespace wx { * 公共回调函数 */ interface CommonCallbackOptions { + // 接口调用成功回调函数 success?: ResponseCallback; + // 接口调用失败回调函数 fail?: ResponseCallback; + // 接口调用结束的回调函数 complete?: ResponseCallback; } @@ -798,7 +898,133 @@ declare namespace wx { // 背景 function setBackgroundTextStyle(): void; + interface BackgroundColorOptions extends CommonCallbackOptions{ + // 窗口的背景色,必须为十六进制颜色值 + backgroundColor?: string; + // 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 + backgroundColorTop?: string; + // 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 + backgroundColorBottom?: string; + } function setBackgroundColor(): void; + // Tab Bar + interface TabBarItemOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + // tab 上的按钮文字 + text?: string; + // 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效,不支持网络图片 + iconPath?: string; + // 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效 + selectedIconPath?: string; + } + /** + * 动态设置 tabBar 某一项的内容 + * @param options + */ + function setTabBarItem(options: TabBarItemOptions): void; + + interface TabBarStyleOptions extends CommonCallbackOptions{ + // tab 上的文字默认颜色,HexColor + color: string; + // tab 上的文字选中时的颜色,HexColor + selectedColor: string; + // tab 的背景色,HexColor + backgroundColor: string; + // tabBar上边框的颜色, 仅支持 black/white + borderStyle: string; + } + /** + * 动态设置tabBar的整体样式 + */ + function setTabBarStyle(options: TabBarItemOptions): void; + + interface TabBarAnimationOptions extends CommonCallbackOptions{ + // 是否需要动画效果 + animation: boolean; + } + /** + * 隐藏tabBar + */ + function hideTabBar(options: TabBarAnimationOptions): void; + /** + * 显示tabBar + */ + function showTabBar(options: TabBarAnimationOptions): void; + + interface TabBarRedDotOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + } + /** + * 隐藏 tabBar 某一项的右上角的红点 + * @param options + */ + function hideTabBarRedDot(options: TabBarBadgeOptions): void; + /** + * 显示 tabBar 某一项的右上角的红点 + * @param options + */ + function showTabBarRedDot(options: TabBarRedDotOptions): void; + + interface TabBarBadgeOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + // 显示的文本,超过 4 个字符则显示成 ... + text: string; + } + /** + * 移除 tabBar 某一项右上角的文本 + * @param options + */ + function removeTabBarBadge(options: TabBarRedDotOptions): void; + /** + * 为 tabBar 某一项的右上角添加文本 + * @param options + */ + function setTabBarBadge(options: TabBarBadgeOptions): void; + + interface FontDescOptions { + // 字体样式,可选值为 normal / italic / oblique + style?: string; + // 字体粗细,可选值为 normal / bold / 100 / 200../ 900 + weight?: string; + // 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit + variant?: string; + } + // 字体 + interface FontFaceOptions extends CommonCallbackOptions{ + // 定义的字体名称 + family: string; + // 字体资源的地址。建议格式为 TTF 和 WOFF,WOFF2 在低版本的iOS上会不兼容。 + source: string; + // 可选的字体描述符 + desc?: FontDescOptions; + } + function loadFontFace(options: FontFaceOptions): void; + + // 下拉刷新 + /** + * 停止当前页面下拉刷新。 + */ + function stopPullDownRefresh(options?: CommonCallbackOptions): void; + + /** + * 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 + */ + function startPullDownRefresh(options?: CommonCallbackOptions): void; + + // 滚动 + interface PageScrollToOptions extends CommonCallbackOptions{ + // 滚动到页面的目标位置,单位 px + scrollTop: number; + // 滚动动画的时长,单位 ms。默认300 + duration: number; + } + /** + * 将页面滚动到 + */ + function pageScrollTo(): void; interface AccelerometerData { /** X 轴 */ @@ -845,46 +1071,9 @@ declare namespace wx { */ function hideNavigationBarLoading(): void; - interface NavigateToOptions { - /** 需要跳转的应用内页面的路径 */ - url: string; - /** 成功获取系统信息的回调 */ - success?: ResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 保留当前页面,跳转到应用内的某个页面,使用wx.navigateBack可以返回到原页面。 - * - * 注意:为了不让用户在使用小程序时造成困扰, - * 我们规定页面路径只能是五层,请尽量避免多层级的交互方式。 - */ - function navigateTo(options: NavigateToOptions): void; - - interface RedirectToOptions { - /** 需要跳转的应用内页面的路径 */ - url: string; - /** 成功获取系统信息的回调 */ - success?: ResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 关闭当前页面,跳转到应用内的某个页面。 - */ - function redirectTo(options: RedirectToOptions): void; - - /** - * 关闭当前页面,回退前一页面。 - */ - function navigateBack(): void; - type TimingFunction = 'linear' | 'ease' | 'ease-in' | 'ease-in-out' | 'ease-out' | 'step-start' | 'step-end'; + // 动画 interface CreateAnimationOptions { /** 动画持续时间,单位ms,默认值 400 */ duration?: number; From 0ffb1d9d2b10010234e381510c7035c6749082b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:08:35 +0800 Subject: [PATCH 189/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=9C=B0=E5=9B=BE=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 160 ++++++++++++++++++++++++++++++++++++- 1 file changed, 159 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0882745c2f..6fdf7df480 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -574,7 +574,62 @@ declare namespace wx { function clearStorageSync(): void; // 媒体 - // 地图 TODO + // 地图 + interface LocationBaseOptions { + // 纬度,浮点数,范围为-90~90,负数表示南纬 + latitude: number; + // 经度,浮点数,范围为-180~180,负数表示西经 + longitude: number; + } + interface GetCenterLocationSuccCbOptions extends CommonCallbackOptions{ + success(res: LocationBaseOptions): void; + } + interface translateMarkerOptions extends CommonCallbackOptions{ + // 指定 marker + markerId: number; + // 指定 marker 移动到的目标点 + destination: LocationBaseOptions; + // 移动过程中是否自动旋转 marker + autoRotate: boolean; + // marker 的旋转角度 + rotate: number; + // 动画持续时长,平移与旋转分别计算 + duration?: number; + // 动画结束回调函数 + animationEnd?(): void; + } + interface zoomPointsOptions extends CommonCallbackOptions { + // 要显示在可视区域内的坐标点列表 + points: Array; + // 坐标点形成的矩形边缘到地图边缘的距离,单位像素。格式为[上,右,下,左],安卓上只能识别数组第一项,上下左右的padding一致。开发者工具暂不支持padding参数。 + padding?: Array; + } + interface GetReginSuccessCallbackOptions { + // 西南角经纬度 + southwest: number, + // 东北角经纬度 + northeast: number; + } + interface GetReginOptions extends CommonCallbackOptions{ + success?(callback: (res: GetReginSuccessCallbackOptions) => void): void; + } + interface GetScaleOptions extends CommonCallbackOptions{ + success?(callback: (res: {scale: number}) => void): void; + } + interface MapContext { + // 获取当前地图中心的经纬度。返回的是 gcj02 坐标系,可以用于 wx.openLocation() + getCenterLocation(options: GetCenterLocationSuccCbOptions): void; + // 将地图中心移动到当前定位点。需要配合map组件的show-location使用 + moveToLocation(): void; + // 平移marker,带动画 + translateMarker(options: translateMarkerOptions): void; + // 缩放视野展示所有经纬度 + includePoints(options: zoomPointsOptions): void; + // 获取当前地图的视野范围 + getRegion(options: GetReginOptions): void; + // 获取当前地图的缩放级别 + getScale(options: GetScaleOptions): void; + } interface LocationData { /** 纬度,浮点数,范围为-90~90,负数表示南纬 */ @@ -1440,6 +1495,8 @@ declare namespace wx { */ function hideKeyboard(): void; + // 开放接口 + // 登录 interface LoginResponse { /** 调用结果 */ errMsg: string; @@ -1458,6 +1515,10 @@ declare namespace wx { complete?: ResponseCallback; } + /** + * 检查登录态是否过期。 + */ + function checkSession(options: CommonCallbackOptions): void; /** * 调用接口获取登录凭证(code)进而换取用户登录态信息, * 包括用户的唯一标识(openid) 及本次登录的 会话密钥(session_key)。 @@ -1465,6 +1526,51 @@ declare namespace wx { */ function login(option: LoginOptions): void; + type envVersion = 'develop' | 'trial' | 'release'; + interface NavigateToMiniProgramOptions extends CommonCallbackOptions { + // 要打开的小程序 appId + appId: string; + // 打开的页面路径,如果为空则打开首页 + path?: string; + // 需要传递给目标小程序的数据,目标小程序可在 App.onLaunch,App.onShow 中获取到这份数据。 + extraData?: object; + // 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 + envVersion?: envVersion; + } + /** + * 打开另一个小程序 + */ + function navigateToMiniProgram(options: NavigateToMiniProgramOptions): void; + interface NavigateBackMiniProgramOptions extends CommonCallbackOptions { + // 需要返回给上一个小程序的数据,上一个小程序可在 App.onShow 中获取到这份数据。 + extraData: object; + } + /** + * 返回到上一个小程序。只有在当前小程序是被其他小程序打开时可以调用成功 + */ + function navigateBackMiniProgram(options: NavigateBackMiniProgramOptions): void; + + // 帐号信息 + interface AccountInfo { + // 小程序帐号信息 + miniProgram: { + // 小程序appId + appId: string; + }; + // 插件帐号信息(仅在插件中调用时包含这一项) + Plugin: { + // 插件appId + appId: string; + // 插件版本号 + vetsion: string + }; + } + /** + * 获取当前账号信息 + */ + function getAccountInfoSync(): AccountInfo; + + // 帐号信息 interface UserInfo { nickName: string; avatarUrl: string; @@ -1515,11 +1621,63 @@ declare namespace wx { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ResponseCallback; } + // 支付 /** * 发起微信支付。 */ function requestPayment(options: RequestPaymentOptions): void; + + // 授权 + /** + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html + * 用户信息 wx.getUserInfo、 + * 地理位置 wx.getLocation,wx.chooseLocation、 + * 通讯地址 wx.chooseAddress、 + * 发票抬头 wx.chooseInvoiceTitle、 + * 获取发票 wx.chooseInvoice、 + * 微信运动步数 wx.getWeRunData、 + * 录音功能 wx.startRecord、 + * 保存到相册 wx.saveImageToPhotosAlbum, wx.saveVideoToPhotosAlbum、 + * 摄像头 组件 + */ + type Scope = 'userInfo' | 'userLocation' | 'address' | 'invoiceTitle' | 'invoice' | 'werun' | 'record' | 'writePhotosAlbum' | 'camera'; + interface AuthorizeOptions extends CommonCallbackOptions { + // 需要获取权限的 scope,详见 scope 列表 + scope: Scope; + } + /** + * 提前向用户发起授权请求。调用后会立刻弹窗询问用户是否同意授权小程序使用某项功能或获取用户的某些数据,但不会实际调用对应接口。如果用户之前已经同意授权,则不会出现弹窗,直接返回成功。 + */ + function authorize(options: AuthorizeOptions): void; + + // 设置 + interface SettingOptions extends CommonCallbackOptions{ + success?(res: AuthSetting): void; + } + /** + * 调起客户端小程序设置界面,返回用户设置的操作结果。设置界面只会出现小程序已经向用户请求过的权限。 + */ + function openSetting(options: SettingOptions): void; + /** + * 获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。 + */ + function getSetting(options: SettingOptions): void; + /** + * 用户授权结果,参考 type Scope + */ + interface AuthSetting { + 'scope.userInfo': boolean; + 'scope.userLocation': boolean; + 'scope.address': boolean; + 'scope.invoiceTitle': boolean; + 'scope.invoice': boolean; + 'scope.werun': boolean; + 'scope.record': boolean; + 'scope.writePhotosAlbum': boolean; + 'scope.camera': boolean; + } } +// end of wx namespace interface Page { From d57069b7d7f9ea3ccde347f878a5594e06906e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:16:37 +0800 Subject: [PATCH 190/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0author=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 6fdf7df480..0cbaf8b97b 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for weapp // Project: https://mp.weixin.qq.com/debug/wxadoc/dev/index.html -// Definitions by: vargeek +// Definitions by: vargeek & pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace wx { From bddec1cc7ff388ea07b18261007c4fa20330d4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:59:03 +0800 Subject: [PATCH 191/646] add author and TypeScript version --- types/weapp-api/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0cbaf8b97b..4350eb1d25 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for weapp // Project: https://mp.weixin.qq.com/debug/wxadoc/dev/index.html -// Definitions by: vargeek & pbestz +// Definitions by: vargeek +// pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2.1 declare namespace wx { // import startPullDownRefresh = swan.startPullDownRefresh; From faaea9d6ab87da5db155cf42c9deb6e266c6e968 Mon Sep 17 00:00:00 2001 From: Malash Date: Tue, 8 Jan 2019 17:26:44 +0800 Subject: [PATCH 192/646] remove wx.ExtendedComponent --- types/weixin-app/index.d.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index 2e2eb35481..350a2969f6 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -3700,13 +3700,6 @@ declare namespace wx { type DefaultProps = object | Record; - type ExtendedComponent< - Instance extends Component, - Data, - Methods, - Props - > = CombinedInstance & Component; - // CombinedInstance models the `this`, i.e. instance type for (user defined) component type CombinedInstance< Instance extends Component, @@ -3870,7 +3863,7 @@ declare namespace wx { * 类似于mixins和traits的组件间代码复用机制 * 参见 [behaviors](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/custom-component/behaviors.html) */ - behaviors?: Array<(ComponentOptions>) | string>; + behaviors?: string[]; /** * 组件生命周期声明对象,组件的生命周期:created、attached、ready、moved、detached将收归到lifetimes字段内进行声明, @@ -4198,7 +4191,7 @@ declare function Component( M, P > -): wx.ExtendedComponent, D, M, P>; +): string; /** * behaviors 是用于组件间代码共享的特性 * 类似于一些编程语言中的“mixins”或“traits” @@ -4214,7 +4207,7 @@ declare function Behavior( M, P > -): wx.ExtendedComponent, D, M, P>; +): string; // #endregion // #region Page /** From dae946c356bc3606ae3503c62e3d7dd823b00590 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 8 Jan 2019 13:38:11 +0100 Subject: [PATCH 193/646] react-is: sort exports --- types/react-is/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-is/index.d.ts b/types/react-is/index.d.ts index 35d4b4db12..59de5135f0 100644 --- a/types/react-is/index.d.ts +++ b/types/react-is/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-is 16.5 +// Type definitions for react-is 16.7 // Project: https://reactjs.org/ // Definitions by: Avi Vahl // Christian Chown @@ -22,8 +22,8 @@ export function isPortal(value: any): value is ReactElement; export function isStrictMode(value: any): value is ReactElement; export const AsyncMode: symbol; -export const ContextProvider: symbol; export const ContextConsumer: symbol; +export const ContextProvider: symbol; export const Element: symbol; export const ForwardRef: symbol; export const Fragment: symbol; From 81d7d8b0335dd986be657b35cb4d803b5633439b Mon Sep 17 00:00:00 2001 From: Gertjan Reynaert Date: Tue, 8 Jan 2019 14:00:10 +0100 Subject: [PATCH 194/646] Add FlatList and SectionList to Animated Since [React-Native 57](https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#added-new-features-4) FlatList and SectionList are added to the exports of Animated. This pr reflects that addition in the type definitions. --- types/react-native/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 2c3922b89d..eb76314c26 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -8677,6 +8677,8 @@ export namespace Animated { export const Image: any; export const Text: any; export const ScrollView: any; + export const FlatList: any; + export const SectionList: any; } // tslint:disable-next-line:interface-name From 8347dc7f1586ca6b2c139a71160019512045be28 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 8 Jan 2019 14:00:46 +0100 Subject: [PATCH 195/646] react-is: fix forward ref test --- types/react-is/react-is-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-is/react-is-tests.tsx b/types/react-is/react-is-tests.tsx index 3b41e9d06f..3c8031e759 100644 --- a/types/react-is/react-is-tests.tsx +++ b/types/react-is/react-is-tests.tsx @@ -74,5 +74,5 @@ ReactIs.typeOf(null) === undefined; ReactIs.typeOf(undefined) === undefined; // ForwardRef -const forwardRef = React.forwardRef((props, ref) =>

); -ReactIs.isForwardRef(forwardRef); // true +ReactIs.isForwardRef(); // true +ReactIs.typeOf() === ReactIs.ForwardRef; // true From 6f270b40dea4480a4363a3a9c41bb514702d41b0 Mon Sep 17 00:00:00 2001 From: Vince Varga Date: Mon, 7 Jan 2019 15:32:05 +0100 Subject: [PATCH 196/646] Differentiate between acceptable revoke and query permission descriptors As pointed out in Microsoft/TypeScript#24923 (comment), the revoke and query methods accept different permission descriptors I also add more test examples for the navigator-permissions types and fix the indentation for interfaces and types to use 4 spaces instead of 2. --- types/navigator-permissions/index.d.ts | 99 ++++++++++--------- .../navigator-permissions-tests.ts | 46 +++++++++ 2 files changed, 99 insertions(+), 46 deletions(-) diff --git a/types/navigator-permissions/index.d.ts b/types/navigator-permissions/index.d.ts index a62c7f77ef..ba66b4cb46 100644 --- a/types/navigator-permissions/index.d.ts +++ b/types/navigator-permissions/index.d.ts @@ -21,9 +21,9 @@ declare namespace NavigatorPermissions { * Permission state values. */ type PermissionState = - 'granted' | - 'denied' | - 'prompt'; + 'granted' | + 'denied' | + 'prompt'; /** * The `PermissionStatus` interface of the Permissions API provides the state @@ -54,22 +54,22 @@ declare namespace NavigatorPermissions { * Permission name options. */ type PermissionName = - 'accelerometer' | - 'accessibility-events' | - 'ambient-light-sensor' | - 'background-sync' | - 'camera' | - 'clipboard-read' | - 'clipboard-write' | - 'geolocation' | - 'gyroscope' | - 'magnetometer' | - 'microphone' | - 'midi' | - 'notifications' | - 'payment-handler' | - 'persistent-storage' | - 'push'; + 'accelerometer' | + 'accessibility-events' | + 'ambient-light-sensor' | + 'background-sync' | + 'camera' | + 'clipboard-read' | + 'clipboard-write' | + 'geolocation' | + 'gyroscope' | + 'magnetometer' | + 'microphone' | + 'midi' | + 'notifications' | + 'payment-handler' | + 'persistent-storage' | + 'push'; /** * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query} @@ -103,31 +103,38 @@ declare namespace NavigatorPermissions { } // Map permission names to correctly typed descriptors. - interface NameDescriptorMap { - // ??? Question ???: - // Is there a better way to handle this case and remove repeated code, - // something like - // > { - // [n in N]: D; // this line to cover all basic cases - // // and the custom permission descriptors for midi and push - // } - 'accelerometer': PermissionDescriptor<'accelerometer'>; - 'accessibility-events': PermissionDescriptor<'accessibility-events'>; - 'ambient-light-sensor': PermissionDescriptor<'ambient-light-sensor'>; - 'background-sync': PermissionDescriptor<'background-sync'>; - 'camera': PermissionDescriptor<'camera'>; - 'clipboard-read': PermissionDescriptor<'clipboard-read'>; - 'clipboard-write': PermissionDescriptor<'clipboard-write'>; - 'geolocation': PermissionDescriptor<'geolocation'>; - 'gyroscope': PermissionDescriptor<'gyroscope'>; - 'magnetometer': PermissionDescriptor<'magnetometer'>; - 'microphone': PermissionDescriptor<'microphone'>; - 'notifications': PermissionDescriptor<'notifications'>; - 'payment-handler': PermissionDescriptor<'payment-handler'>; - 'persistent-storage': PermissionDescriptor<'persistent-storage'>; - // These permission descriptors support extra properties - 'midi': MidiPermissionDescriptor; - 'push': PushPermissionDescriptor; + interface QueryNameDescriptorMap { + // ??? Question ???: + // Is there a better way to handle this case and remove repeated code, + // something like + // > { + // [n in N]: D; // this line to cover all basic cases + // // and the custom permission descriptors for midi and push + // } + 'accelerometer': PermissionDescriptor<'accelerometer'>; + 'accessibility-events': PermissionDescriptor<'accessibility-events'>; + 'ambient-light-sensor': PermissionDescriptor<'ambient-light-sensor'>; + 'background-sync': PermissionDescriptor<'background-sync'>; + 'camera': PermissionDescriptor<'camera'>; + 'clipboard-read': PermissionDescriptor<'clipboard-read'>; + 'clipboard-write': PermissionDescriptor<'clipboard-write'>; + 'geolocation': PermissionDescriptor<'geolocation'>; + 'gyroscope': PermissionDescriptor<'gyroscope'>; + 'magnetometer': PermissionDescriptor<'magnetometer'>; + 'microphone': PermissionDescriptor<'microphone'>; + 'notifications': PermissionDescriptor<'notifications'>; + 'payment-handler': PermissionDescriptor<'payment-handler'>; + 'persistent-storage': PermissionDescriptor<'persistent-storage'>; + // These permission descriptors support extra properties + 'midi': MidiPermissionDescriptor; + 'push': PushPermissionDescriptor; + } + + interface RevokeNameDescriptorMap { + 'geolocation': PermissionDescriptor<'geolocation'>; + 'notifications': PermissionDescriptor<'notifications'>; + 'midi': MidiPermissionDescriptor; + 'push': PushPermissionDescriptor; } /** @@ -153,14 +160,14 @@ declare namespace NavigatorPermissions { * unsupported (e.g. `midi`, or `push` with `userVisibleOnly`). * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query} */ - query(permissionDescriptor: NameDescriptorMap[keyof NameDescriptorMap]): Promise; + query(permissionDescriptor: QueryNameDescriptorMap[keyof QueryNameDescriptorMap]): Promise; /** * The `Permissions.revoke()` method of the `Permissions` interface reverts a * currently set permission back to its default state, which is usually `prompt`. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Permissions/revoke} */ - revoke(permissionDescriptor: NameDescriptorMap[keyof NameDescriptorMap]): Promise; + revoke(permissionDescriptor: RevokeNameDescriptorMap[keyof RevokeNameDescriptorMap]): Promise; } /** diff --git a/types/navigator-permissions/navigator-permissions-tests.ts b/types/navigator-permissions/navigator-permissions-tests.ts index 918726b23d..e8722d72f0 100644 --- a/types/navigator-permissions/navigator-permissions-tests.ts +++ b/types/navigator-permissions/navigator-permissions-tests.ts @@ -43,3 +43,49 @@ function exampleIgnoreUndefinedCheck() { // Using the ! after permissions will let you bypass the undefined-check nav.permissions!.query({ name: 'microphone' }); } + +function exampleRevokeDoesNotSupportTheSameDescriptorsAsQuery() { + const cameraQueryPromise: Promise = nav.permissions!.query({ name: 'camera' }); + // Revoke only supports a subset of descriptors + // nav.permissions!.revoke({ name: 'camera' }); + // For example name: 'notifications' + const notificationRevocalPromise: Promise = nav.permissions!.revoke({ name: 'notifications' }); +} + +function exampleFromMdnForQueryMethod() { + if (nav.permissions === undefined) { + console.error('Permissions API not supported'); + return; + } + + function showLocalNewsWithGeolocation() { /* Not implemented */ } + function showButtonToEnableLocalNews() { /* Not implemented */ } + // Using .then instead of async-await + nav.permissions.query({ name: 'geolocation' }).then((result) => { + if (result.state === 'granted') { + showLocalNewsWithGeolocation(); + } else if (result.state === 'prompt') { + showButtonToEnableLocalNews(); + } + // Don't do anything if the permission was denied. + }); +} + +function exampleFromMdnForRevokeMethod() { + // Just an example report function I made up + function report(state: NavigatorPermissions.PermissionState) { + switch (state) { + case 'denied': console.error('State: DENIED'); break; + case 'granted': console.log('State: GRANTED'); break; + case 'prompt': console.info('State: PROMPT'); break; + // Using a string that's an invalid state would result in an error from TypeScript + // case 'invalid': console.warn('Type "invalid" is not comparable to type "PermissionState".'); + } + } + // This is a slightly modified example from the MDN revoke method documentation + // https://developer.mozilla.org/en-US/docs/Web/API/Permissions/revoke#Example + // Using .then instead of async-await + nav.permissions!.revoke({ name: 'geolocation' }).then((result) => { + report(result.state); + }); +} From 1cad21f4ecc91406e4e763724fcf2fd4ded5dd4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Tue, 8 Jan 2019 15:22:44 +0200 Subject: [PATCH 197/646] feat: seperate out Horizon.*OperationResponse --- types/stellar-sdk/index.d.ts | 366 +++++++++++++++++++++++------------ 1 file changed, 240 insertions(+), 126 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 14d3b1d30e..ba22de39d3 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -673,137 +673,34 @@ export namespace Server { seller?: CallFunction; } - interface BaseOperationRecord extends Record { - id: string; - paging_token: string; - type: string; - type_i: number; - source_account: string; - - self: CallFunction; - succeeds: CallFunction; - precedes: CallFunction; - effects: CallCollectionFunction; - transaction: CallFunction; + import OperationResponseType = Horizon.OperationResponseType; + import OperationResponseTypeI = Horizon.OperationResponseTypeI; + interface BaseOperationRecord< + T extends OperationResponseType = OperationResponseType, + TI extends OperationResponseTypeI = OperationResponseTypeI, + > extends Horizon.BaseOperationResponse { + self: CallFunction; + succeeds: CallFunction; + precedes: CallFunction; + effects: CallCollectionFunction; + transaction: CallFunction; } - interface CreateAccountOperationRecord extends BaseOperationRecord { - type: 'create_account'; - account: string; - funder: string; - starting_balance: string; - } - - interface PaymentOperationRecord extends BaseOperationRecord { - type: 'payment'; - from: string; - to: string; - asset_type: string; - asset_code?: string; - asset_issuer?: string; - amount: string; - + interface CreateAccountOperationRecord extends BaseOperationRecord, Horizon.CreateAccountOperationResponse {} + interface PaymentOperationRecord extends BaseOperationRecord, Horizon.PaymentOperationResponse { sender: CallFunction; receiver: CallFunction; } - - interface PathPaymentOperationRecord extends BaseOperationRecord { - type: 'path_payment'; - from: string; - to: string; - asset_code?: string; - asset_issuer?: string; - asset_type: string; - amount: string; - source_asset_code?: string; - source_asset_issuer?: string; - source_asset_type: string; - source_max: string; - source_amount: string; - } - - interface ManageOfferOperationRecord extends BaseOperationRecord { - type: 'manage_offer'; - offer_id: number; - amount: string; - buying_asset_code?: string; - buying_asset_issuer?: string; - buying_asset_type: string; - price: string; - price_r: { numerator: number, denominator: number }; - selling_asset_code?: string; - selling_asset_issuer?: string; - selling_asset_type: string; - } - - interface PassiveOfferOperationRecord extends BaseOperationRecord { - type: 'create_passive_offer'; - offer_id: number; - amount: string; - buying_asset_code?: string; - buying_asset_issuer?: string; - buying_asset_type: string; - price: string; - price_r: { numerator: number, denominator: number }; - selling_asset_code?: string; - selling_asset_issuer?: string; - selling_asset_type: string; - } - - interface SetOptionsOperationRecord extends BaseOperationRecord { - type: 'set_options'; - signer_key?: string; - signer_weight?: number; - master_key_weight?: number; - low_threshold?: number; - med_threshold?: number; - high_threshold?: number; - home_domain?: string; - set_flags: Array<(1 | 2)>; - set_flags_s: Array<('auth_required_flag' | 'auth_revocable_flag')>; - clear_flags: Array<(1 | 2)>; - clear_flags_s: Array<('auth_required_flag' | 'auth_revocable_flag')>; - } - - interface ChangeTrustOperationRecord extends BaseOperationRecord { - type: 'change_trust'; - asset_code: string; - asset_issuer: string; - asset_type: string; - trustee: string; - trustor: string; - limit: string; - } - - interface AllowTrustOperationRecord extends BaseOperationRecord { - type: 'allow_trust'; - asset_code: string; - asset_issuer: string; - asset_type: string; - authorize: boolean; - trustee: string; - trustor: string; - } - - interface AccountMergeOperationRecord extends BaseOperationRecord { - type: 'account_merge'; - into: string; - } - - interface InflationOperationRecord extends BaseOperationRecord { - type: 'inflation'; - } - - interface ManageDataOperationRecord extends BaseOperationRecord { - type: 'manage_data'; - name: string; - value: Buffer; - } - - interface BumpSequenceOperationRecord extends BaseOperationRecord { - type: 'bump_sequence'; - bump_to: string; - } + interface PathPaymentOperationRecord extends BaseOperationRecord, Horizon.PathPaymentOperationResponse {} + interface ManageOfferOperationRecord extends BaseOperationRecord, Horizon.ManageOfferOperationResponse {} + interface PassiveOfferOperationRecord extends BaseOperationRecord, Horizon.PassiveOfferOperationResponse {} + interface SetOptionsOperationRecord extends BaseOperationRecord, Horizon.SetOptionsOperationResponse {} + interface ChangeTrustOperationRecord extends BaseOperationRecord, Horizon.ChangeTrustOperationResponse {} + interface AllowTrustOperationRecord extends BaseOperationRecord, Horizon.AllowTrustOperationResponse {} + interface AccountMergeOperationRecord extends BaseOperationRecord, Horizon.AccountMergeOperationResponse {} + interface InflationOperationRecord extends BaseOperationRecord, Horizon.InflationOperationResponse {} + interface ManageDataOperationRecord extends BaseOperationRecord, Horizon.ManageDataOperationResponse {} + interface BumpSequenceOperationRecord extends BaseOperationRecord, Horizon.BumpSequenceOperationResponse {} type OperationRecord = CreateAccountOperationRecord | PaymentOperationRecord @@ -1021,3 +918,220 @@ export namespace StellarTomlResolver { function resolve(domain: string, options?: StellarTomlResolveOptions): Promise<{ [key: string]: any }>; } + +export namespace Horizon { + interface ResponseLink { + href: string; + templated?: boolean; + } + interface BaseResponse { + _links: { + [key in T|'self']: ResponseLink + }; + } + interface TransactionResponse extends BaseResponse<'account'|'ledger'|'operations'|'effects'|'succeeds'|'precedes'> { + created_at: string; + envelope_xdr: string; + fee_meta_xdr: string; + fee_paid: number; + hash: string; + id: string; + ledger: number; + memo_type: string; + operation_count: number; + paging_token: string; + result_meta_xdr: string; + result_xdr: string; + signatures: string[]; + source_account: string; + source_account_sequence: string; + } + + interface BalanceLineNative { + balance: string; + asset_type: ASSET_TYPE.native; + } + interface BalanceLineAsset { + balance: string; + limit: string; + asset_type: T; + asset_code: string; + asset_issuer: string; + } + type BalanceLine = + T extends ASSET_TYPE.native ? BalanceLineNative : + T extends ASSET_TYPE.credit4 | ASSET_TYPE.credit12 ? BalanceLineAsset : + BalanceLineNative | BalanceLineAsset; + + interface AccountResponseThresholds { + low_threshold: number; + med_threshold: number; + high_threshold: number; + } + interface AccountResponseFlags { + auth_required: boolean; + auth_revocable: boolean; + } + interface AccountResponseSigner { + public_key: string; + weight: number; + } + interface AccountResponse extends BaseResponse<'transactions'|'operations'|'payments'|'effects'|'offers'|'trades'|'data'> { + id: string; + paging_token: string; + account_id: string; + sequence: string; + subentry_count: number; + thresholds: AccountResponseThresholds; + flags: AccountResponseFlags; + balances: BalanceLine[]; + signers: AccountResponseSigner[]; + data: { + [key: string]: string + }; + } + + enum OperationResponseType { + createAccount = 'create_account', + payment = 'payment', + pathPayment = 'path_payment', + createPassiveOffer = 'create_passive_offer', + manageOffer = 'manage_offer', + setOptions = 'set_options', + changeTrust = 'change_trust', + allowTrust = 'allow_trust', + accountMerge = 'account_merge', + inflation = 'inflation', + manageData = 'manage_data', + bumpSequence = 'bump_sequence', + } + enum OperationResponseTypeI { + createAccount = 0, + payment = 1, + pathPayment = 2, + createPassiveOffer = 3, + manageOffer = 4, + setOptions = 5, + changeTrust = 6, + allowTrust = 7, + accountMerge = 8, + inflation = 9, + manageData = 10, + bumpSequence = 11, + } + interface BaseOperationResponse< + T extends OperationResponseType = OperationResponseType, + TI extends OperationResponseTypeI = OperationResponseTypeI, + > extends BaseResponse<'succeeds'|'precedes'|'effects'|'transaction'> { + id: string; + paging_token: string; + source_account: string; + type: T; + type_i: TI; + created_at: string; + transaction_hash: string; + } + interface CreateAccountOperationResponse extends BaseOperationResponse { + account: string; + funder: string; + starting_balance: string; + } + interface PaymentOperationResponse extends BaseOperationResponse { + from: string; + to: string; + asset_type: ASSET_TYPE; + asset_code?: string; + asset_issuer?: string; + amount: string; + } + interface PathPaymentOperationResponse extends BaseOperationResponse { + from: string; + to: string; + asset_type: ASSET_TYPE; + asset_code?: string; + asset_issuer?: string; + amount: string; + source_asset_type: ASSET_TYPE; + source_asset_code?: string; + source_asset_issuer?: string; + source_max: string; + source_amount: string; + } + interface ManageOfferOperationResponse extends BaseOperationResponse { + offer_id: number; + amount: string; + buying_asset_type: ASSET_TYPE; + buying_asset_code?: string; + buying_asset_issuer?: string; + price: string; + price_r: { numerator: number, denominator: number }; + selling_asset_type: ASSET_TYPE; + selling_asset_code?: string; + selling_asset_issuer?: string; + } + interface PassiveOfferOperationResponse extends BaseOperationResponse { + offer_id: number; + amount: string; + buying_asset_type: ASSET_TYPE; + buying_asset_code?: string; + buying_asset_issuer?: string; + price: string; + price_r: { numerator: number, denominator: number }; + selling_asset_type: ASSET_TYPE; + selling_asset_code?: string; + selling_asset_issuer?: string; + } + interface SetOptionsOperationResponse extends BaseOperationResponse { + signer_key?: string; + signer_weight?: number; + master_key_weight?: number; + low_threshold?: number; + med_threshold?: number; + high_threshold?: number; + home_domain?: string; + set_flags: Array<(1 | 2)>; + set_flags_s: Array<('auth_required_flag' | 'auth_revocable_flag')>; + clear_flags: Array<(1 | 2)>; + clear_flags_s: Array<('auth_required_flag' | 'auth_revocable_flag')>; + } + interface ChangeTrustOperationResponse extends BaseOperationResponse { + asset_type: ASSET_TYPE.credit4 | ASSET_TYPE.credit12; + asset_code: string; + asset_issuer: string; + trustee: string; + trustor: string; + limit: string; + } + interface AllowTrustOperationResponse extends BaseOperationResponse { + asset_type: ASSET_TYPE; + asset_code: string; + asset_issuer: string; + authorize: boolean; + trustee: string; + trustor: string; + } + interface AccountMergeOperationResponse extends BaseOperationResponse { + into: string; + } + interface InflationOperationResponse extends BaseOperationResponse { + } + interface ManageDataOperationResponse extends BaseOperationResponse { + name: string; + value: Buffer; + } + interface BumpSequenceOperationResponse extends BaseOperationResponse { + bump_to: string; + } + + interface ResponseCollection { + _links: { + self: ResponseLink + next: ResponseLink + prev: ResponseLink + }; + _embedded: { + records: T[] + }; + } + interface TransactionResponseCollection extends ResponseCollection {} +} From b4994d69dea56edd8827f25decee5134cc531b9a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 8 Jan 2019 14:11:56 +0100 Subject: [PATCH 198/646] react-is: Add lazy, memo and suspsense types --- types/react-is/index.d.ts | 7 +++++++ types/react-is/react-is-tests.tsx | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/types/react-is/index.d.ts b/types/react-is/index.d.ts index 59de5135f0..b7cce65e18 100644 --- a/types/react-is/index.d.ts +++ b/types/react-is/index.d.ts @@ -2,6 +2,7 @@ // Project: https://reactjs.org/ // Definitions by: Avi Vahl // Christian Chown +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -17,9 +18,12 @@ export function isContextProvider(value: any): value is ReactElement; export function isElement(value: any): value is ReactElement; export function isForwardRef(value: any): value is ReactElement; export function isFragment(value: any): value is ReactElement; +export function isLazy(value: any): value is ReactElement; +export function isMemo(value: any): value is ReactElement; export function isProfiler(value: any): value is ReactElement; export function isPortal(value: any): value is ReactElement; export function isStrictMode(value: any): value is ReactElement; +export function isSuspense(value: any): value is ReactElement; export const AsyncMode: symbol; export const ContextConsumer: symbol; @@ -27,6 +31,9 @@ export const ContextProvider: symbol; export const Element: symbol; export const ForwardRef: symbol; export const Fragment: symbol; +export const Lazy: symbol; +export const Memo: symbol; export const Portal: symbol; export const Profiler: symbol; export const StrictMode: symbol; +export const Suspense: symbol; diff --git a/types/react-is/react-is-tests.tsx b/types/react-is/react-is-tests.tsx index 3c8031e759..f11ded70a6 100644 --- a/types/react-is/react-is-tests.tsx +++ b/types/react-is/react-is-tests.tsx @@ -22,6 +22,12 @@ const ForwardRefComponent = React.forwardRef((props, ref) => React.createElement(ClassComponent, { forwardedRef: ref, ...props }) ); +const LazyComponent = React.lazy(() => + Promise.resolve({ default: ForwardRefComponent }) +); + +const MemoComponent = React.memo(StatelessComponent); + const Context = React.createContext(false); ReactIs.isValidElementType('div'); // true @@ -31,6 +37,8 @@ ReactIs.isValidElementType(ForwardRefComponent); // true ReactIs.isValidElementType(Context.Provider); // true ReactIs.isValidElementType(Context.Consumer); // true ReactIs.isValidElementType(React.createFactory('div')); // true +ReactIs.isValidElementType(LazyComponent); +ReactIs.isValidElementType(MemoComponent); // Determining an Element's Type @@ -76,3 +84,15 @@ ReactIs.typeOf(undefined) === undefined; // ForwardRef ReactIs.isForwardRef(); // true ReactIs.typeOf() === ReactIs.ForwardRef; // true + +// Lazy +ReactIs.isLazy(); // true +ReactIs.typeOf() === ReactIs.Lazy; // true + +// Memo +ReactIs.isMemo(); // true +ReactIs.typeOf() === ReactIs.Memo; // true + +// Suspense +ReactIs.isForwardRef(); // true +ReactIs.typeOf() === ReactIs.Suspense; // true From 2606bbe34763b168850ba63fc3cfb674f0fa6a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Tue, 8 Jan 2019 15:28:39 +0200 Subject: [PATCH 199/646] refactor: consolidate dublicate types --- types/stellar-sdk/index.d.ts | 115 ++++++++++------------------------- 1 file changed, 33 insertions(+), 82 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index ba22de39d3..6bb8136e58 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -512,7 +512,7 @@ export class Server { } export namespace Server { - abstract class CallBuilder { + abstract class CallBuilder { constructor(serverUrl: string) call(): Promise>; cursor(cursor: string): this; @@ -521,29 +521,18 @@ export namespace Server { stream(options?: { onmessage?: (record: T) => void, onerror?: (error: Error) => void }): () => void; } - interface CollectionPage { + interface CollectionPage { records: T[]; next: () => Promise>; prev: () => Promise>; } - interface Record { - _links: { - [key: string]: RecordLink - }; - } - - interface RecordLink { - href: string; - templated?: boolean; - } - /* Due to a bug with the recursive function requests */ - interface CollectionRecord { + interface CollectionRecord { _links: { - next: RecordLink - prev: RecordLink - self: RecordLink + next: Horizon.ResponseLink + prev: Horizon.ResponseLink + self: Horizon.ResponseLink }; _embedded: { records: T[] @@ -556,42 +545,19 @@ export namespace Server { order?: 'asc' | 'desc'; } - type CallFunction = () => Promise; - type CallCollectionFunction = + type CallFunction = () => Promise; + type CallCollectionFunction = (options?: CallFunctionTemplateOptions) => Promise>; - interface BalanceLineNative { - balance: string; - asset_type: ASSET_TYPE.native; - } - interface BalanceLineAsset { - balance: string; - limit: string; - asset_type: T; - asset_code: string; - asset_issuer: string; - } - type BalanceLine = - T extends ASSET_TYPE.native ? BalanceLineNative : - T extends ASSET_TYPE.credit4 | ASSET_TYPE.credit12 ? BalanceLineAsset : - BalanceLineNative | BalanceLineAsset; - - interface AccountRecord extends Record { + interface AccountRecord extends Horizon.BaseResponse { id: string; paging_token: string; account_id: string; sequence: number; subentry_count: number; - thresholds: { - low_threshold: number - med_threshold: number - high_threshold: number - }; - flags: { - auth_required: boolean - auth_revocable: boolean - }; - balances: BalanceLine[]; + thresholds: Horizon.AccountThresholds; + flags: Horizon.Flags; + balances: Horizon.BalanceLine[]; signers: Array< { public_key: string @@ -609,20 +575,17 @@ export namespace Server { trades: CallCollectionFunction; } - interface AssetRecord extends Record { + interface AssetRecord extends Horizon.BaseResponse { asset_type: ASSET_TYPE.credit4 | ASSET_TYPE.credit12; asset_code: string; asset_issuer: string; paging_token: string; amount: string; num_accounts: number; - flags: { - auth_required: boolean - auth_revocable: boolean - }; + flags: Horizon.Flags; } - interface EffectRecord extends Record { + interface EffectRecord extends Horizon.BaseResponse { account: string; paging_token: string; starting_balance: string; @@ -635,7 +598,7 @@ export namespace Server { succeeds?: CallFunction; } - interface LedgerRecord extends Record { + interface LedgerRecord extends Horizon.BaseResponse { id: string; paging_token: string; hash: string; @@ -660,7 +623,7 @@ export namespace Server { transactions: CallCollectionFunction; } - interface OfferRecord extends Record { + interface OfferRecord extends Horizon.BaseResponse { id: string; paging_token: string; seller_attr: string; @@ -715,14 +678,14 @@ export namespace Server { | ManageDataOperationRecord | BumpSequenceOperationRecord; - interface OrderbookRecord extends Record { + interface OrderbookRecord extends Horizon.BaseResponse { bids: Array<{ price_r: {}, price: number, amount: string }>; asks: Array<{ price_r: {}, price: number, amount: string }>; selling: Asset; buying: Asset; } - interface PaymentPathRecord extends Record { + interface PaymentPathRecord extends Horizon.BaseResponse { path: Array<{ asset_code: string asset_issuer: string @@ -738,7 +701,7 @@ export namespace Server { destination_asset_issuer: string; } - interface TradeRecord extends Record { + interface TradeRecord extends Horizon.BaseResponse { id: string; paging_token: string; ledger_close_time: string; @@ -759,7 +722,7 @@ export namespace Server { operation: CallFunction; } - interface TradeAggregationRecord extends Record { + interface TradeAggregationRecord extends Horizon.BaseResponse { timestamp: string; trade_count: number; base_volume: string; @@ -771,7 +734,7 @@ export namespace Server { close: string; } - interface TransactionRecord extends Record { + interface TransactionRecord extends Horizon.BaseResponse { id: string; paging_token: string; hash: string; @@ -804,28 +767,16 @@ export namespace Server { accountId(id: string): this; } class AccountResponse implements AccountRecord { - _links: { [key: string]: { href: string } }; + _links: { [key in 'self']: Horizon.ResponseLink }; id: string; paging_token: string; account_id: string; sequence: number; subentry_count: number; - thresholds: { - low_threshold: number - med_threshold: number - high_threshold: number - }; - flags: { - auth_required: boolean - auth_revocable: boolean - }; - balances: BalanceLine[]; - signers: Array< - { - public_key: string - weight: number - } - >; + thresholds: Horizon.AccountThresholds; + flags: Horizon.Flags; + balances: Horizon.BalanceLine[]; + signers: Horizon.AccountSigner[]; data: (options: {value: string}) => Promise<{value: string}>; data_attr: { [key: string]: string @@ -963,16 +914,16 @@ export namespace Horizon { T extends ASSET_TYPE.credit4 | ASSET_TYPE.credit12 ? BalanceLineAsset : BalanceLineNative | BalanceLineAsset; - interface AccountResponseThresholds { + interface AccountThresholds { low_threshold: number; med_threshold: number; high_threshold: number; } - interface AccountResponseFlags { + interface Flags { auth_required: boolean; auth_revocable: boolean; } - interface AccountResponseSigner { + interface AccountSigner { public_key: string; weight: number; } @@ -982,10 +933,10 @@ export namespace Horizon { account_id: string; sequence: string; subentry_count: number; - thresholds: AccountResponseThresholds; - flags: AccountResponseFlags; + thresholds: AccountThresholds; + flags: Flags; balances: BalanceLine[]; - signers: AccountResponseSigner[]; + signers: AccountSigner[]; data: { [key: string]: string }; From 158a9090710870b620b3b9a76eb1b92b8a45b4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Tue, 8 Jan 2019 15:40:50 +0200 Subject: [PATCH 200/646] feat: interface PriceR --- types/stellar-sdk/index.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 6bb8136e58..5180c2e14d 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -630,7 +630,7 @@ export namespace Server { selling: Asset; buying: Asset; amount: string; - price_r: { numerator: number, denominator: number }; + price_r: Horizon.PriceR; price: string; seller?: CallFunction; @@ -914,6 +914,10 @@ export namespace Horizon { T extends ASSET_TYPE.credit4 | ASSET_TYPE.credit12 ? BalanceLineAsset : BalanceLineNative | BalanceLineAsset; + interface PriceR { + numerator: number; + denominator: number; + } interface AccountThresholds { low_threshold: number; med_threshold: number; @@ -1015,7 +1019,7 @@ export namespace Horizon { buying_asset_code?: string; buying_asset_issuer?: string; price: string; - price_r: { numerator: number, denominator: number }; + price_r: PriceR; selling_asset_type: ASSET_TYPE; selling_asset_code?: string; selling_asset_issuer?: string; @@ -1027,7 +1031,7 @@ export namespace Horizon { buying_asset_code?: string; buying_asset_issuer?: string; price: string; - price_r: { numerator: number, denominator: number }; + price_r: PriceR; selling_asset_type: ASSET_TYPE; selling_asset_code?: string; selling_asset_issuer?: string; From a762d4c1816f2ec6ba36273033a4eed00ff6860f Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 8 Jan 2019 15:14:21 +0100 Subject: [PATCH 201/646] react-is: fix lazy and memo tests --- types/react-is/react-is-tests.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-is/react-is-tests.tsx b/types/react-is/react-is-tests.tsx index f11ded70a6..afbf0aabb6 100644 --- a/types/react-is/react-is-tests.tsx +++ b/types/react-is/react-is-tests.tsx @@ -86,12 +86,12 @@ ReactIs.isForwardRef(); // true ReactIs.typeOf() === ReactIs.ForwardRef; // true // Lazy -ReactIs.isLazy(); // true -ReactIs.typeOf() === ReactIs.Lazy; // true +ReactIs.isLazy(LazyComponent); // true +ReactIs.typeOf(LazyComponent) === ReactIs.Lazy; // true // Memo -ReactIs.isMemo(); // true -ReactIs.typeOf() === ReactIs.Memo; // true +ReactIs.isMemo(MemoComponent); // true +ReactIs.typeOf(MemoComponent) === ReactIs.Memo; // true // Suspense ReactIs.isForwardRef(); // true From 953494550b1a144564ecc616f0204fcd9aa25802 Mon Sep 17 00:00:00 2001 From: Fabio Berta Date: Tue, 8 Jan 2019 15:34:44 +0100 Subject: [PATCH 202/646] add allowFloat parameter added in 0.4 --- types/mapbox__geo-viewport/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mapbox__geo-viewport/index.d.ts b/types/mapbox__geo-viewport/index.d.ts index 6cfa8638f8..d48321ffb8 100644 --- a/types/mapbox__geo-viewport/index.d.ts +++ b/types/mapbox__geo-viewport/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for @mapbox/geo-viewport 0.3 +// Type definitions for @mapbox/geo-viewport 0.4 // Project: https://github.com/mapbox/geo-viewport // Definitions by: Fabio Berta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,6 +10,6 @@ export interface GeoViewport { export type BoundingBox = [number, number, number, number]; -export function viewport(bounds: BoundingBox, dimensions: [number, number], minzoom?: number, maxzoom?: number, tileSize?: number): GeoViewport; +export function viewport(bounds: BoundingBox, dimensions: [number, number], minzoom?: number, maxzoom?: number, tileSize?: number, allowFloat?: boolean): GeoViewport; export function bounds(viewport: { lon: number; lat: number } | [number, number], zoom: number, dimensions: [number, number], tileSize?: number): BoundingBox; From f5a570b0394a8f6d1b9d5baf3b92d88d4e64865a Mon Sep 17 00:00:00 2001 From: Malthe Borch Date: Tue, 8 Jan 2019 17:08:29 +0100 Subject: [PATCH 203/646] Add exposed prototypes --- types/express/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/express/index.d.ts b/types/express/index.d.ts index 81821ca98c..ddc4509805 100644 --- a/types/express/index.d.ts +++ b/types/express/index.d.ts @@ -30,6 +30,13 @@ declare namespace e { */ var json: typeof bodyParser.json; + /** + * These are the exposed prototypes. + */ + var application: Application; + var request: Request; + var response: Response; + /** * This is a built-in middleware function in Express. It serves static files and is based on serve-static. */ From 788657acbe38b19f2356d7b1a4326fc5e9639b55 Mon Sep 17 00:00:00 2001 From: Corey Psoinos Date: Tue, 8 Jan 2019 10:50:31 -0500 Subject: [PATCH 204/646] fix typo: UsageRecordSummarys -> UsageRecordSummaries Changes the spelling of UsageRecordSummarys to UsageRecordSummaries ref: https://github.com/stripe/stripe-node/issues/503 docs: https://stripe.com/docs/api/usage_records/subscription_item_summary_list --- types/stripe/index.d.ts | 19 ++++++++++--------- types/stripe/stripe-tests.ts | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 93a9b13300..501a7255b3 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -15,6 +15,7 @@ // Ifiok Jr. // Simon Schick // Slava Yultyyev Schick +// Corey Psoinos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -76,7 +77,7 @@ declare class Stripe { webhooks: Stripe.resources.WebHooks; ephemeralKeys: Stripe.resources.EphemeralKeys; usageRecords: Stripe.resources.UsageRecords; - usageRecordSummarys: Stripe.resources.UsageRecordSummarys; + usageRecordSummaries: Stripe.resources.UsageRecordSummaries; setHost(host: string): void; setHost(host: string, port: string|number): void; @@ -5324,17 +5325,17 @@ declare namespace Stripe { } } - namespace usageRecordSummarys { + namespace usageRecordSummaries { /** * A object with a data property that contains an array of up to limit summaries, * starting after summary starting_after. Each entry in the array is a separate summary object. * If no more summaries are available, the resulting array is empty. */ - interface IUsageRecordSummarys extends IList { - object: 'list'; + interface IUsageRecordSummaries extends IList{ + object: 'list' } - interface IUsageRecordSummarysItem { + interface IUsageRecordSummariesItem { id: string; object: string; invoice: string; @@ -5344,7 +5345,7 @@ declare namespace Stripe { total_usage: number; } - interface IUsageRecordSummarysListOptions extends IListOptions { + interface IUsageRecordSummariesListOptions extends IListOptions{ /** * Only summary items for the given subscription item. */ @@ -5371,12 +5372,12 @@ declare namespace Stripe { create(subscription: string, data: usageRecords.IUsageRecordCreationOptions, response?: IResponseFn): Promise; } - class UsageRecordSummarys extends StripeResource { + class UsageRecordSummaries extends StripeResource { /** * Creates a usage record for a specified subscription item and date, and fills it with a quantity. */ - list(data: usageRecordSummarys.IUsageRecordSummarysListOptions, options: HeaderOptions, response?: IResponseFn): Promise; - list(data: usageRecordSummarys.IUsageRecordSummarysListOptions, response?: IResponseFn): Promise; + list(data: usageRecordSummaries.IUsageRecordSummariesListOptions, options: HeaderOptions, response?: IResponseFn): Promise; + list(data: usageRecordSummaries.IUsageRecordSummariesListOptions, response?: IResponseFn): Promise; } class Accounts extends StripeResource { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 30e454f6dc..627b6bb7bb 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1332,8 +1332,8 @@ stripe.ephemeralKeys.create({ customer: "cus_5rfJKDJkuxzh5Q" }, { stripe_version stripe.usageRecords.create('sub_8QwCiwZ9tmMSpt', { action: 'set', quantity: 10000, timestamp: 1537006853 }).then((usageRecord: Stripe.usageRecords.IUsageRecord) => {}); stripe.usageRecords.create('sub_8QwCiwZ9tmMSpt', { action: 'set', quantity: 10000, timestamp: 1537006853 }, (err, usageRecord: Stripe.usageRecords.IUsageRecord) => {}); -stripe.usageRecordSummarys.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }).then((usageRecordSummarys: Stripe.usageRecordSummarys.IUsageRecordSummarys) => {}); -stripe.usageRecordSummarys.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }, (err, usageRecordSummarys: Stripe.usageRecordSummarys.IUsageRecordSummarys) => {}); +stripe.usageRecordSummaries.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }).then((usageRecordSummaries: Stripe.usageRecordSummaries.IUsageRecordSummaries) => { }); +stripe.usageRecordSummaries.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }, (err, usageRecordSummaries: Stripe.usageRecordSummaries.IUsageRecordSummaries) => { }); //#region Errors // ################################################################################## From e1a1c48e45b5f4a3f84bc18ffa3a568cc5cc9e66 Mon Sep 17 00:00:00 2001 From: Anton Astashov Date: Tue, 8 Jan 2019 11:44:29 -0600 Subject: [PATCH 205/646] Reuse IRouterParamContext --- types/koa-router/index.d.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index ad34695d2c..ab94541a1e 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -44,15 +44,7 @@ declare namespace Router { } // Deprecated - please use IRouterParamContext - export interface IRouterContext extends Koa.ParameterizedContext { - /** - * url params - */ - params: any; - /** - * the router instance - */ - router: Router; + export interface IRouterContext extends Koa.ParameterizedContext { } export interface IRouterParamContext { From cc9a6a98f2995f68a96f742f3f22cf09f9bb765c Mon Sep 17 00:00:00 2001 From: Corey Psoinos Date: Tue, 8 Jan 2019 12:48:45 -0500 Subject: [PATCH 206/646] address missing spaces caught by travis --- types/stripe/index.d.ts | 4 ++-- types/stripe/stripe-tests.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 501a7255b3..81a1ffd78d 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -5331,7 +5331,7 @@ declare namespace Stripe { * starting after summary starting_after. Each entry in the array is a separate summary object. * If no more summaries are available, the resulting array is empty. */ - interface IUsageRecordSummaries extends IList{ + interface IUsageRecordSummaries extends IList { object: 'list' } @@ -5345,7 +5345,7 @@ declare namespace Stripe { total_usage: number; } - interface IUsageRecordSummariesListOptions extends IListOptions{ + interface IUsageRecordSummariesListOptions extends IListOptions { /** * Only summary items for the given subscription item. */ diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 627b6bb7bb..154a5e0a58 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1332,8 +1332,8 @@ stripe.ephemeralKeys.create({ customer: "cus_5rfJKDJkuxzh5Q" }, { stripe_version stripe.usageRecords.create('sub_8QwCiwZ9tmMSpt', { action: 'set', quantity: 10000, timestamp: 1537006853 }).then((usageRecord: Stripe.usageRecords.IUsageRecord) => {}); stripe.usageRecords.create('sub_8QwCiwZ9tmMSpt', { action: 'set', quantity: 10000, timestamp: 1537006853 }, (err, usageRecord: Stripe.usageRecords.IUsageRecord) => {}); -stripe.usageRecordSummaries.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }).then((usageRecordSummaries: Stripe.usageRecordSummaries.IUsageRecordSummaries) => { }); -stripe.usageRecordSummaries.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }, (err, usageRecordSummaries: Stripe.usageRecordSummaries.IUsageRecordSummaries) => { }); +stripe.usageRecordSummaries.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }).then((usageRecordSummaries: Stripe.usageRecordSummaries.IUsageRecordSummaries) => {}); +stripe.usageRecordSummaries.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }, (err, usageRecordSummaries: Stripe.usageRecordSummaries.IUsageRecordSummaries) => {}); //#region Errors // ################################################################################## From b9076f450477a4a72cb52c24355fa7819967df21 Mon Sep 17 00:00:00 2001 From: Anton Astashov Date: Tue, 8 Jan 2019 11:50:49 -0600 Subject: [PATCH 207/646] Add an alias RouterContext --- types/koa-router/index.d.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index ab94541a1e..27142453a6 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -58,15 +58,14 @@ declare namespace Router { router: Router; } + export type RouterContext = Koa.ParameterizedContext & U>; + export interface IMiddleware { - ( - ctx: Koa.ParameterizedContext & CustomT>, - next: () => Promise - ): void; + (ctx: RouterContext, next: () => Promise): void; } export interface IParamMiddleware { - (param: string, ctx: Koa.ParameterizedContext<{}, IRouterParamContext>, next: () => Promise): any; + (param: string, ctx: RouterContext, next: () => Promise): any; } export interface IRouterAllowedMethodsOptions { From a1653d1bea63d267613fd8a1191e1c11b893e1b2 Mon Sep 17 00:00:00 2001 From: Javon Harper Date: Tue, 8 Jan 2019 12:54:39 -0500 Subject: [PATCH 208/646] Add iopipe-js type declarations --- types/iopipe/index.d.ts | 22 ++++++++++++++++++++++ types/iopipe/iopipe-tests.ts | 17 +++++++++++++++++ types/iopipe/tsconfig.json | 22 ++++++++++++++++++++++ types/iopipe/tslint.json | 1 + 4 files changed, 62 insertions(+) create mode 100644 types/iopipe/index.d.ts create mode 100644 types/iopipe/iopipe-tests.ts create mode 100644 types/iopipe/tsconfig.json create mode 100644 types/iopipe/tslint.json diff --git a/types/iopipe/index.d.ts b/types/iopipe/index.d.ts new file mode 100644 index 0000000000..046736956c --- /dev/null +++ b/types/iopipe/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for iopipe +// Project: https://github.com/iopipe/iopipe-js + +interface IOPipeConfig { + debug?: boolean; + token?: string; + networkTimeout?: number; + timeoutWindow?: number; +} + +interface Mark { + start(label: string): void; + end(label: string): void; +} + +declare module "@iopipe/iopipe" { + export function label(label: string): void; + export function metric(label: string, number: number): void; + export let mark: Mark + + export default function iopipe(config?: IOPipeConfig): Function; +} \ No newline at end of file diff --git a/types/iopipe/iopipe-tests.ts b/types/iopipe/iopipe-tests.ts new file mode 100644 index 0000000000..01fce909e4 --- /dev/null +++ b/types/iopipe/iopipe-tests.ts @@ -0,0 +1,17 @@ +import iopipe, { label, mark, metric } from '@iopipe/iopipe' + +const configuredLib = iopipe({ + token: 'ABCDEFG' +}); + +const run = () => {} + +configuredLib(run) + +label('a label'); + +mark.start('trace'); +mark.end('trace'); + +metric('metric-label', 42); + diff --git a/types/iopipe/tsconfig.json b/types/iopipe/tsconfig.json new file mode 100644 index 0000000000..ed43f65a14 --- /dev/null +++ b/types/iopipe/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "iopipe-tests.ts" + ] +} diff --git a/types/iopipe/tslint.json b/types/iopipe/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/iopipe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 39aec29f6a2da81b1a8483dfadb1ccb78690bdf7 Mon Sep 17 00:00:00 2001 From: Javon Harper Date: Tue, 8 Jan 2019 13:09:49 -0500 Subject: [PATCH 209/646] Use 4 spaces --- types/iopipe/index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/types/iopipe/index.d.ts b/types/iopipe/index.d.ts index 046736956c..965787a49a 100644 --- a/types/iopipe/index.d.ts +++ b/types/iopipe/index.d.ts @@ -2,21 +2,21 @@ // Project: https://github.com/iopipe/iopipe-js interface IOPipeConfig { - debug?: boolean; - token?: string; - networkTimeout?: number; - timeoutWindow?: number; + debug?: boolean; + token?: string; + networkTimeout?: number; + timeoutWindow?: number; } interface Mark { - start(label: string): void; - end(label: string): void; + start(label: string): void; + end(label: string): void; } declare module "@iopipe/iopipe" { - export function label(label: string): void; - export function metric(label: string, number: number): void; - export let mark: Mark + export function label(label: string): void; + export function metric(label: string, number: number): void; + export let mark: Mark - export default function iopipe(config?: IOPipeConfig): Function; + export default function iopipe(config?: IOPipeConfig): Function; } \ No newline at end of file From c2f0bc3b78080d945c920517ea425fcd4342daaa Mon Sep 17 00:00:00 2001 From: Javon Harper Date: Tue, 8 Jan 2019 13:52:15 -0500 Subject: [PATCH 210/646] Clean up --- types/iopipe/iopipe-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/iopipe/iopipe-tests.ts b/types/iopipe/iopipe-tests.ts index 01fce909e4..4ebbf69f28 100644 --- a/types/iopipe/iopipe-tests.ts +++ b/types/iopipe/iopipe-tests.ts @@ -1,7 +1,7 @@ import iopipe, { label, mark, metric } from '@iopipe/iopipe' const configuredLib = iopipe({ - token: 'ABCDEFG' + token: 'ABCDEFG' }); const run = () => {} From c5d5694540637d5c9a108d9f800469a83a58f03d Mon Sep 17 00:00:00 2001 From: Anton Astashov Date: Tue, 8 Jan 2019 13:10:53 -0600 Subject: [PATCH 211/646] Use @Guillaume-Mayer code --- types/koa-router/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index 27142453a6..98666e0801 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -43,10 +43,6 @@ declare namespace Router { strict?: boolean; } - // Deprecated - please use IRouterParamContext - export interface IRouterContext extends Koa.ParameterizedContext { - } - export interface IRouterParamContext { /** * url params @@ -58,11 +54,15 @@ declare namespace Router { router: Router; } - export type RouterContext = Koa.ParameterizedContext & U>; + export type RouterContext = + Koa.ParameterizedContext>; - export interface IMiddleware { - (ctx: RouterContext, next: () => Promise): void; - } + // For backward compatibility IRouterContext needs to be an interface + // But it's deprecated - please use `RouterContext` instead + export interface IRouterContext extends RouterContext {} + + export type IMiddleware = + Koa.Middleware> export interface IParamMiddleware { (param: string, ctx: RouterContext, next: () => Promise): any; @@ -327,12 +327,12 @@ declare class Router { /** * Returns router middleware which dispatches a route matching the request. */ - routes(): Koa.Middleware>; + routes(): Router.IMiddleware; /** * Returns router middleware which dispatches a route matching the request. */ - middleware(): Koa.Middleware>; + middleware(): Router.IMiddleware; /** * Returns separate middleware for responding to `OPTIONS` requests with @@ -341,7 +341,7 @@ declare class Router { */ allowedMethods( options?: Router.IRouterAllowedMethodsOptions - ): Koa.Middleware>; + ): Router.IMiddleware; /** * Redirect `source` to `destination` URL with optional 30x status `code`. From b27342b1c6d5000da39fffd38b8231a294be682e Mon Sep 17 00:00:00 2001 From: Corey Psoinos Date: Tue, 8 Jan 2019 14:27:52 -0500 Subject: [PATCH 212/646] add missing semicolon --- types/stripe/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 81a1ffd78d..9f30067495 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -5332,7 +5332,7 @@ declare namespace Stripe { * If no more summaries are available, the resulting array is empty. */ interface IUsageRecordSummaries extends IList { - object: 'list' + object: 'list'; } interface IUsageRecordSummariesItem { From b50c01b40b141f9dea93b3e4cf8f37057ed38350 Mon Sep 17 00:00:00 2001 From: Miraj Patel Date: Tue, 8 Jan 2019 11:36:21 -0800 Subject: [PATCH 213/646] Update index.d.ts: add "disabled?" to FormProps --- types/react-jsonschema-form/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index c17bda1a94..b860fa3cd4 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -15,6 +15,7 @@ declare module "react-jsonschema-form" { export interface FormProps { schema: JSONSchema6; + disabled?: boolean; uiSchema?: UiSchema; formData?: T; formContext?: any; From 3635e0a8ecf28bcbc4d8df2c69ca6c281af064d0 Mon Sep 17 00:00:00 2001 From: ikokostya Date: Tue, 8 Jan 2019 23:08:40 +0300 Subject: [PATCH 214/646] [got] Add errorCodes to RetryOptions --- types/got/got-tests.ts | 21 ++++++++++++++++++++- types/got/index.d.ts | 6 +++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/types/got/got-tests.ts b/types/got/got-tests.ts index d80d0aadcf..b75155ee75 100644 --- a/types/got/got-tests.ts +++ b/types/got/got-tests.ts @@ -265,8 +265,27 @@ got('https://todomvc.com', { rejectUnauthorized: false }); got('/examples/angularjs', { baseUrl: 'http://todomvc.com' }); got('http://todomvc.com', { headers: { foo: 'bar'} }); got('http://todomvc.com', { cookieJar: new tough.CookieJar() }); + +// Test retry options. got('http://todomvc.com', { retry: 2 }); -got('http://todomvc.com', { retry: { retries: 2, methods: ['GET'], statusCodes: [408, 504], maxRetryAfter: 1 } }); +got('http://todomvc.com', { + retry: { + retries: 2, + methods: ['GET'], + statusCodes: [408, 504], + maxRetryAfter: 1, + errorCodes: ['ETIMEDOUT'] + } +}); +// Test custom retry error code. See https://github.com/sindresorhus/got/blob/9f3a09948ff80057b12af0af60846cc5b8f0372d/test/retry.js#L155 +got('http://todomvc.com', { + retry: { + retries: 1, + methods: ['GET'], + errorCodes: ['OH_SNAP'] + } +}); + got('http://todomvc.com', { throwHttpErrors: false }); got('http://todomvc.com', { hooks: { beforeRequest: [ () => 'foo']} }); diff --git a/types/got/index.d.ts b/types/got/index.d.ts index 09b451f4bb..0c847d6489 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for got 9.3 +// Type definitions for got 9.4 // Project: https://github.com/sindresorhus/got#readme // Definitions by: BendingBender // Linus Unnebäck @@ -226,6 +226,10 @@ declare namespace got { methods?: Array<'GET' | 'PUT' | 'HEAD' | 'DELETE' | 'OPTIONS' | 'TRACE'>; statusCodes?: Array<408 | 413 | 429 | 500 | 502 | 503 | 504>; maxRetryAfter?: number; + /** + * Allowed error codes. + */ + errorCodes?: string[]; } interface AgentOptions { From 642febdaee105892c8b42586d3e7c825dcc87c10 Mon Sep 17 00:00:00 2001 From: Domas Trijonis Date: Tue, 8 Jan 2019 21:22:41 +0100 Subject: [PATCH 215/646] fix: SpyObj and T union --- types/jasmine/index.d.ts | 2 +- types/jasmine/jasmine-tests.ts | 25 +++++++++++++++++-------- types/jasmine/v2/index.d.ts | 2 +- types/jasmine/v2/jasmine-tests.ts | 23 ++++++++++++++++------- 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index 2109645eef..fd053cf3d6 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -701,7 +701,7 @@ declare namespace jasmine { withArgs(...args: any[]): Spy; } - type SpyObj = { + type SpyObj = T & { [k in keyof T]: T[k] extends Function ? T[k] & Spy : T[k]; } diff --git a/types/jasmine/jasmine-tests.ts b/types/jasmine/jasmine-tests.ts index bf3598fda9..217a5463f0 100644 --- a/types/jasmine/jasmine-tests.ts +++ b/types/jasmine/jasmine-tests.ts @@ -723,19 +723,24 @@ describe("A spy, when created manually", () => { }); describe("Multiple spies, when created manually", () => { - interface Tape { - play(): void; - pause(): void; - rewind(pos: number): void; - stop(): void; + class Tape { + private rewindTo: number; + play(): void { }; + pause(): void { }; + rewind(pos: number): void { + this.rewindTo = pos; + }; + stop(): void { }; readonly isPlaying: boolean; // spy obj makes this writable } - var tape: jasmine.SpyObj; + var tape: Tape; + var tapeSpy: jasmine.SpyObj; var el: jasmine.SpyObj; beforeEach(() => { - tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tapeSpy = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tape = tapeSpy; (tape as { isPlaying: boolean }).isPlaying = false; el = jasmine.createSpyObj('Element', ['hasAttribute']); @@ -745,6 +750,10 @@ describe("Multiple spies, when created manually", () => { tape.play(); tape.pause(); tape.rewind(0); + + tapeSpy.play.and.callThrough(); + tapeSpy.pause.and.callThrough(); + tapeSpy.rewind.and.callThrough(); }); it("creates spies for each requested function", () => { @@ -767,7 +776,7 @@ describe("Multiple spies, when created manually", () => { it("read isPlaying property", () => { expect(tape.isPlaying).toBe(false); - }) + }); }); describe("multiple spies, when created with spyOnAllFunctions", () => { diff --git a/types/jasmine/v2/index.d.ts b/types/jasmine/v2/index.d.ts index 4211cf2ca0..a248093082 100644 --- a/types/jasmine/v2/index.d.ts +++ b/types/jasmine/v2/index.d.ts @@ -629,7 +629,7 @@ declare namespace jasmine { calls: Calls; } - type SpyObj = { + type SpyObj = T & { [k in keyof T]: T[k] extends Function ? T[k] & Spy : T[k]; } diff --git a/types/jasmine/v2/jasmine-tests.ts b/types/jasmine/v2/jasmine-tests.ts index f79c3627eb..167aca1981 100644 --- a/types/jasmine/v2/jasmine-tests.ts +++ b/types/jasmine/v2/jasmine-tests.ts @@ -643,19 +643,24 @@ describe("A spy, when created manually", () => { }); describe("Multiple spies, when created manually", () => { - interface Tape { - play(): void; - pause(): void; - rewind(pos: number): void; - stop(): void; + abstract class Tape { + private rewindTo: number; + play(): void { }; + pause(): void { }; + rewind(pos: number): void { + this.rewindTo = pos; + }; + stop(): void { }; readonly isPlaying: boolean; // spy obj makes this writable } - var tape: jasmine.SpyObj; + var tape: Tape; + var tapeSpy: jasmine.SpyObj; var el: jasmine.SpyObj; beforeEach(() => { - tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tapeSpy = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tape = tapeSpy; (tape as { isPlaying: boolean }).isPlaying = false; el = jasmine.createSpyObj('Element', ['hasAttribute']); @@ -665,6 +670,10 @@ describe("Multiple spies, when created manually", () => { tape.play(); tape.pause(); tape.rewind(0); + + tapeSpy.play.and.callThrough(); + tapeSpy.pause.and.callThrough(); + tapeSpy.rewind.and.callThrough(); }); it("creates spies for each requested function", () => { From 1c20b07f905a4bafcb1340563dae666e6a97443e Mon Sep 17 00:00:00 2001 From: Bradley Hill Date: Tue, 8 Jan 2019 14:26:43 -0600 Subject: [PATCH 216/646] Match image filter types to latest fabric code --- types/fabric/fabric-impl.d.ts | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 60ec11648f..d3c7f70a90 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1801,10 +1801,12 @@ export class Image { initialize(element?: string | HTMLImageElement, options?: IImageOptions): void; /** - * Applies filters assigned to this image (from "filters" array) - * @param callback Callback is invoked when all filters have been applied and new image is generated + * Applies filters assigned to this image (from "filters" array) or from filter param + * @param {Array} filters to be applied + * @return {thisArg} return the fabric.Image object + * @chainable */ - applyFilters(callback: Function): void; + applyFilters(filters?: IBaseFilter[]): Image; /** * Returns a clone of an instance * @param callback Callback is invoked with a clone as a first argument @@ -3717,17 +3719,29 @@ interface IAllFilters { */ new(options?: any): IBaseFilter; }; - Blend: { + BlendColor: { /** * Constructor * @param [options] Options object */ - new(options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; + new(options?: { color?: string; mode?: string; alpha?: number; }): IBlendColorFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from */ - fromObject(object: any): IBlendFilter + fromObject(object: any): IBlendColorFilter + }; + BlendImage: { + /** + * Constructor + * @param [options] Options object + */ + new(options?: { image?: Image; mode?: string; alpha?: number; }): IBlendImageFilter; + /** + * Returns filter instance from an object representation + * @param object Object to create an instance from + */ + fromObject(object: any): IBlendImageFilter }; Brightness: { new(options?: { @@ -3910,7 +3924,14 @@ interface IBaseFilter { */ toJSON(): string; } -interface IBlendFilter extends IBaseFilter { +interface IBlendColorFilter extends IBaseFilter { + /** + * Applies filter to canvas element + * @param canvasEl Canvas element to apply filter to + */ + applyTo(canvasEl: HTMLCanvasElement): void; +} +interface IBlendImageFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to From cd98b442e17da94a39fc682441fef89cb5f730f8 Mon Sep 17 00:00:00 2001 From: ikokostya Date: Tue, 8 Jan 2019 23:30:06 +0300 Subject: [PATCH 217/646] [got] Improve beforRequest hook test Move test case for beforeRequest hook to tests for other hooks. Refs #31769 --- types/got/got-tests.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/types/got/got-tests.ts b/types/got/got-tests.ts index d80d0aadcf..c32c7da121 100644 --- a/types/got/got-tests.ts +++ b/types/got/got-tests.ts @@ -268,7 +268,6 @@ got('http://todomvc.com', { cookieJar: new tough.CookieJar() }); got('http://todomvc.com', { retry: 2 }); got('http://todomvc.com', { retry: { retries: 2, methods: ['GET'], statusCodes: [408, 504], maxRetryAfter: 1 } }); got('http://todomvc.com', { throwHttpErrors: false }); -got('http://todomvc.com', { hooks: { beforeRequest: [ () => 'foo']} }); // Test timeout options. got('http://todomvc.com', {timeout: 1}); @@ -288,6 +287,15 @@ got('http://todomvc.com', { got('http://todomvc.com', {timeout: 1}).catch((err) => err instanceof got.TimeoutError); // Test hooks. +got('example.com', { + hooks: { + beforeRequest: [ + options => { + options.headers!['x-foo'] = 'bar'; + } + ] + } +}); got('example.com', { hooks: { beforeRedirect: [ @@ -339,6 +347,11 @@ got('example.com', { got('example.com', { hooks: { + beforeRequest: [ + async () => { + await doSomethingAsync(); + } + ], beforeRedirect: [ async () => { await doSomethingAsync(); From c9d1d8aa3fcc6f224a29abf0a7c049ca703487ef Mon Sep 17 00:00:00 2001 From: Javon Harper Date: Tue, 8 Jan 2019 18:21:50 -0500 Subject: [PATCH 218/646] Fix tests --- types/iopipe/index.d.ts | 45 ++++++++++++++++++++++++------------ types/iopipe/iopipe-tests.ts | 19 ++++++++------- types/iopipe/tsconfig.json | 1 + 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/types/iopipe/index.d.ts b/types/iopipe/index.d.ts index 965787a49a..be82b4125e 100644 --- a/types/iopipe/index.d.ts +++ b/types/iopipe/index.d.ts @@ -1,22 +1,37 @@ -// Type definitions for iopipe -// Project: https://github.com/iopipe/iopipe-js +// Type definitions for iopipe 1.6 +// Project: https://github.com/iopipe/the-meta-package#readme +// Definitions by: Javon Harper +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface IOPipeConfig { +interface LibraryConfig { debug?: boolean; token?: string; networkTimeout?: number; timeoutWindow?: number; } - -interface Mark { - start(label: string): void; - end(label: string): void; -} - + +type FunctionWrapper = (wrappedFunction: any) => void; + declare module "@iopipe/iopipe" { - export function label(label: string): void; - export function metric(label: string, number: number): void; - export let mark: Mark - - export default function iopipe(config?: IOPipeConfig): Function; -} \ No newline at end of file + namespace mark { + function start(label: string): void; + function end(label: string): void; + } + + function label(label: string): void; + function metric(label: string, number: number): void; + + export default function iopipe(config?: LibraryConfig): FunctionWrapper; +} + +declare module "@iopipe/core" { + namespace mark { + function start(label: string): void; + function end(label: string): void; + } + + function label(label: string): void; + function metric(label: string, number: number): void; + + export default function iopipe(config?: LibraryConfig): FunctionWrapper; +} diff --git a/types/iopipe/iopipe-tests.ts b/types/iopipe/iopipe-tests.ts index 4ebbf69f28..bffd85a763 100644 --- a/types/iopipe/iopipe-tests.ts +++ b/types/iopipe/iopipe-tests.ts @@ -1,17 +1,16 @@ -import iopipe, { label, mark, metric } from '@iopipe/iopipe' +import iopipe, { mark, label, metric } from "@iopipe/iopipe"; -const configuredLib = iopipe({ - token: 'ABCDEFG' +const configured = iopipe({ + token: "ABCDEFG" }); -const run = () => {} +const handler = () => {}; -configuredLib(run) +configured(handler); -label('a label'); +mark.start("api-call"); +mark.end("api-call"); -mark.start('trace'); -mark.end('trace'); - -metric('metric-label', 42); +label("here is a label"); +metric("magic number", 42); diff --git a/types/iopipe/tsconfig.json b/types/iopipe/tsconfig.json index ed43f65a14..e60c45b965 100644 --- a/types/iopipe/tsconfig.json +++ b/types/iopipe/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 3aaa16ae95e86c39f33827bb24ea1e92c7fb96d3 Mon Sep 17 00:00:00 2001 From: Benjamin Davies Date: Wed, 9 Jan 2019 12:33:28 +1300 Subject: [PATCH 219/646] Fix typo in option name Replace "watchIgnorePatters" with "watchIgnorePatterns" in Options interface. --- types/forever-monitor/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/forever-monitor/index.d.ts b/types/forever-monitor/index.d.ts index c9de58e7cc..cc666b65c0 100644 --- a/types/forever-monitor/index.d.ts +++ b/types/forever-monitor/index.d.ts @@ -25,7 +25,7 @@ export interface Options { sourceDir?: string; watch?: boolean; watchIgnoreDotFiles?: boolean; - watchIgnorePatters?: string[]; + watchIgnorePatterns?: string[]; watchDirectory?: string; spawnWith?: SpawnWith; env?: NodeJS.ProcessEnv; From bea7afecd64ced9c64414430007963145950bbfd Mon Sep 17 00:00:00 2001 From: Teoxoy <28601907+Teoxoy@users.noreply.github.com> Date: Wed, 9 Jan 2019 02:11:13 +0100 Subject: [PATCH 220/646] updated pressKey & releaseKey --- types/keyboardjs/index.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/types/keyboardjs/index.d.ts b/types/keyboardjs/index.d.ts index 037bf7189b..c97cda0741 100644 --- a/types/keyboardjs/index.d.ts +++ b/types/keyboardjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for KeyboardJS v2.4.1 +// Type definitions for KeyboardJS v2.4.2 // Project: https://github.com/RobertWHurst/KeyboardJS // Definitions by: Vincent Bortone , // David Asmuth , @@ -92,14 +92,16 @@ declare namespace keyboardjs { /** * Triggers a key press. Stays in pressed state until released. - * @param keyCombo String of keys to be pressed to execute 'pressed' callbacks. + * @param keyCombo String of keys or keyCode to be pressed to execute 'pressed' callbacks. + * @param event The KeyEvent, can be null. */ - export function pressKey(keyCombo: string): void + export function pressKey(keyCombo: string | number, event?: KeyEvent): void; /** * Triggers a key release. - * @param keyCombo String of keys to be released to execute 'released' callbacks. + * @param keyCombo String of keys or keyCode to be released to execute 'released' callbacks. + * @param event The KeyEvent, can be null. */ - export function releaseKey(keyCombo: string): void; + export function releaseKey(keyCombo: string | number, event?: KeyEvent): void; /** * Releases all keys. */ From 2b59ec43297e987f39a4b46eed4f8adcf7656771 Mon Sep 17 00:00:00 2001 From: Nitesh Phadatare Date: Wed, 9 Jan 2019 09:52:02 +0530 Subject: [PATCH 221/646] [Ramda] innerJoin definition - code review comments --- types/ramda/index.d.ts | 2 +- types/ramda/ramda-tests.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index d84c148d96..8993d59a28 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1179,7 +1179,7 @@ declare namespace R { * `xs`, `ys`, and `xs'` are treated as sets, semantically, so ordering should * not be significant, but since `xs'` is ordered the implementation guarantees * that its values are in the same order as they appear in `xs`. Duplicates are - * not removed, so `xs'` may contain duplicates if `xs` contains duplicates. + * not removed, so `xs` may contain duplicates if `xs` contains duplicates. */ innerJoin(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray, list2: ReadonlyArray): T1[]; diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index b1c0a43b39..c67ef3944d 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -2531,9 +2531,7 @@ class Rectangle { ]; const list2 = [5, 4, 6]; - function matchId(record: any, id: number): boolean { - return record.id === id; - } + const matchId = (record: { id: number, name: string }, id: number): boolean => record.id === id; R.innerJoin(matchId, list1, list2); // [{"id": 4, "name": "Four"}, {"id": 5, "name": "Five"}] From 64a54feb95a74d860c470f9124f2fe71e93c41d3 Mon Sep 17 00:00:00 2001 From: Nitesh Phadatare Date: Wed, 9 Jan 2019 09:58:46 +0530 Subject: [PATCH 222/646] [Ramda] innerJoin definition - Updated code comment --- types/ramda/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 8993d59a28..d84c148d96 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1179,7 +1179,7 @@ declare namespace R { * `xs`, `ys`, and `xs'` are treated as sets, semantically, so ordering should * not be significant, but since `xs'` is ordered the implementation guarantees * that its values are in the same order as they appear in `xs`. Duplicates are - * not removed, so `xs` may contain duplicates if `xs` contains duplicates. + * not removed, so `xs'` may contain duplicates if `xs` contains duplicates. */ innerJoin(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray, list2: ReadonlyArray): T1[]; From ed82b9ef70ab6fdf9d5d4bec1686a9662ffbc657 Mon Sep 17 00:00:00 2001 From: Karim Alibhai Date: Wed, 9 Jan 2019 00:06:49 -0500 Subject: [PATCH 223/646] Add(mongoose): generics for schema methods --- types/mongoose/index.d.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 14e965dd5f..df91675e15 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -737,7 +737,7 @@ declare module "mongoose" { * section schema.js * http://mongoosejs.com/docs/api.html#schema-js */ - class Schema extends events.EventEmitter { + class Schema extends events.EventEmitter { /** * Schema constructor. * When nesting schemas, (children in the example above), always declare @@ -789,8 +789,10 @@ declare module "mongoose" { * Adds an instance method to documents constructed from Models compiled from this schema. * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods. */ - method(method: string, fn: Function): this; - method(methodObj: { [name: string]: Function }): this; + method(method: F, fn: T[F]): this; + method(methodObj: { + [F in keyof T]: T[F] + }): this; /** * Gets/sets schema paths. @@ -954,7 +956,9 @@ declare module "mongoose" { static reserved: any; /** Object of currently defined methods on this schema. */ - methods: any; + methods: { + [F in keyof T]: T[F] + }; /** Object of currently defined statics on this schema. */ statics: any; /** Object of currently defined query helpers on this schema. */ From 4f0e246373e1afbae5ddb087012893fba4dc3587 Mon Sep 17 00:00:00 2001 From: Karim Alibhai Date: Wed, 9 Jan 2019 00:35:38 -0500 Subject: [PATCH 224/646] Add: animal interface to tests --- types/mongoose/mongoose-tests.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 7d23e6be6b..8f5914d9dd 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -522,12 +522,15 @@ mongoose.Schema.reserved.hasOwnProperty(''); /* inherited properties */ schema.addListener('e', cb); /* practical examples */ -var animalSchema = new mongoose.Schema({ +interface Animal { + findSimilarTypes(cb: any): Promise +} +var animalSchema = new mongoose.Schema({ name: String, type: String }); -animalSchema.methods.findSimilarTypes = function (cb: any) { - return this.model('Aminal').find({ type: this.type }, cb); +animalSchema.methods.findSimilarTypes = function (cb) { + return this.model('Animal').find({ type: this.type }, cb); }; var Animal: any = mongoose.model('Animal', animalSchema); var dog: any = new Animal({type: 'dog'}); From 9a44a03183551d3a06b4a328eb2d18e76fa4b1bf Mon Sep 17 00:00:00 2001 From: Daniil Dotsev Date: Wed, 9 Jan 2019 11:34:42 +0200 Subject: [PATCH 225/646] Update @guardian/prosemirror-invisibles typings --- .../guardian__prosemirror-invisibles-tests.ts | 9 +++++++-- .../index.d.ts | 18 +++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/types/guardian__prosemirror-invisibles/guardian__prosemirror-invisibles-tests.ts b/types/guardian__prosemirror-invisibles/guardian__prosemirror-invisibles-tests.ts index 6a31efb820..38398d9830 100644 --- a/types/guardian__prosemirror-invisibles/guardian__prosemirror-invisibles-tests.ts +++ b/types/guardian__prosemirror-invisibles/guardian__prosemirror-invisibles-tests.ts @@ -1,3 +1,8 @@ -import invisibles, { hardBreak, paragraph, space } from 'guardian__prosemirror-invisibles'; +import { Node } from 'prosemirror-model'; +import { Plugin } from 'prosemirror-state'; -const plugin = invisibles([hardBreak, paragraph, space]); +import invisibles, { hardBreak, paragraph, space, Builder } from 'guardian__prosemirror-invisibles'; + +const plugin1: Plugin = invisibles([hardBreak((node: Node) => true), paragraph(), space((char: string) => false)]); + +const plugin2: Plugin = invisibles([hardBreak(), paragraph((node: Node) => false), space()]); diff --git a/types/guardian__prosemirror-invisibles/index.d.ts b/types/guardian__prosemirror-invisibles/index.d.ts index b2e2434662..f3453cd6ec 100644 --- a/types/guardian__prosemirror-invisibles/index.d.ts +++ b/types/guardian__prosemirror-invisibles/index.d.ts @@ -1,17 +1,25 @@ -// Type definitions for @guardian/prosemirror-invisibles 0.1 +// Type definitions for @guardian/prosemirror-invisibles 1.0 // Project: https://github.com/guardian/prosemirror-invisibles // Definitions by: Daniil Dotsev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { Node } from 'prosemirror-model'; -import { DecorationSet } from "prosemirror-view"; +import { Decoration, DecorationSet } from "prosemirror-view"; import { Plugin } from 'prosemirror-state'; export type Builder = (from: number, to: number, doc: Node, decos: DecorationSet) => DecorationSet; +export interface TextBetweenPosition { + pos: number; + text: string; +} + export default function(builders: Builder[]): Plugin; -export const hardBreak: Builder; -export const paragraph: Builder; -export const space: Builder; +export function hardBreak(predicate?: (node: Node) => boolean): Builder; +export function paragraph(predicate?: (node: Node) => boolean): Builder; +export function space(predicate?: (char: string) => boolean): Builder; + +export function createDeco(pos: number, type: string): Decoration; +export function textBetween(from: number, to: number, doc: Node): TextBetweenPosition[]; From 2b934fc57ec1c6a1af318867b16363ca9268d2f5 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Wed, 9 Jan 2019 17:58:13 +0800 Subject: [PATCH 226/646] weixin-app show toast to support "none" icon type weixin-app show toast to support "none" icon type --- types/weixin-app/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index b33af483a1..9422850bc5 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -1920,9 +1920,9 @@ declare namespace wx { */ title: string; /** - * 图标,只支持"success"、"loading" + * 图标,只支持 "success", "loading", "none" */ - icon?: "success" | "loading"; + icon?: "success" | "loading" | "none"; /** * 自定义图标的本地路径,image 的优先级高于 icon */ From bf6a005b882f1ab66f5d22368c94e35a46406744 Mon Sep 17 00:00:00 2001 From: AlessandroFerrariFood Date: Wed, 9 Jan 2019 12:26:15 +0100 Subject: [PATCH 227/646] Typo in deleteByID method name --- types/solr-client/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/solr-client/index.d.ts b/types/solr-client/index.d.ts index 74e8e2ba94..7c21c6a73c 100644 --- a/types/solr-client/index.d.ts +++ b/types/solr-client/index.d.ts @@ -147,7 +147,7 @@ export interface Client { softCommit(callback?: (err: Error, data: object) => void): ClientRequest; delete(field: string, text: string, options?: Options, callback?: (err: Error, data: object) => void): ClientRequest; deleteByRange(field: string, start: string | Date, stop: string | Date, options?: object, callback?: (err: Error, data: object) => void): ClientRequest; - deleteById(id: string | number, options?: Options, callback?: (err: Error, data: object) => void): ClientRequest; + deleteByID(id: string | number, options?: Options, callback?: (err: Error, data: object) => void): ClientRequest; deleteByQuery(query: string, options?: Options, callback?: (err: Error, data: object) => void): ClientRequest; deleteAll(options?: Options, callback?: (err: Error, data: object) => void): ClientRequest; optimize(options: object, callback?: (err: Error, data: object) => void): ClientRequest; From 18af3f8a109da3ff6fc443132951ab19a299be3f Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 9 Jan 2019 14:16:50 +0100 Subject: [PATCH 228/646] Add trusted-types --- types/trusted-types/index.d.ts | 31 ++++++++++++++++++++++ types/trusted-types/trusted-types-tests.ts | 17 ++++++++++++ types/trusted-types/tsconfig.json | 23 ++++++++++++++++ types/trusted-types/tslint.json | 1 + 4 files changed, 72 insertions(+) create mode 100644 types/trusted-types/index.d.ts create mode 100644 types/trusted-types/trusted-types-tests.ts create mode 100644 types/trusted-types/tsconfig.json create mode 100644 types/trusted-types/tslint.json diff --git a/types/trusted-types/index.d.ts b/types/trusted-types/index.d.ts new file mode 100644 index 0000000000..64ed96b713 --- /dev/null +++ b/types/trusted-types/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for trusted-types 1.0 +// Project: https://github.com/WICG/trusted-types +// Definitions by: Jakub Vrana +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class TrustedHTML {} +declare class TrustedScript {} +declare class TrustedScriptURL {} +declare class TrustedURL {} + +declare class TrustedTypePolicy { + createHTML(s: string): TrustedHTML; + createScript(s: string): TrustedScript; + createScriptURL(s: string): TrustedScriptURL; + createURL(s: string): TrustedURL; +} + +interface TrustedTypeInnerPolicy { + createHTML(s: string): string; + createScript(s: string): string; + createScriptURL(s: string): string; + createURL(s: string): string; +} + +declare class TrustedTypePolicyFactory { + createPolicy(name: string, policy: TrustedTypeInnerPolicy, expose?: boolean): TrustedTypePolicy; + getExposedPolicy(name: string): TrustedTypePolicy; + getPolicyNames(): string[]; +} + +declare const TrustedTypes: TrustedTypePolicyFactory; diff --git a/types/trusted-types/trusted-types-tests.ts b/types/trusted-types/trusted-types-tests.ts new file mode 100644 index 0000000000..79f79db4b7 --- /dev/null +++ b/types/trusted-types/trusted-types-tests.ts @@ -0,0 +1,17 @@ +const policy = { + createHTML: (s: string) => s, + createScript: (s: string) => s, + createScriptURL: (s: string) => s, + createURL: (s: string) => s, +}; + +TrustedTypes.getPolicyNames(); +TrustedTypes.createPolicy('default', policy, true); +TrustedTypes.getExposedPolicy('default'); + +const trustedTypes = TrustedTypes.createPolicy('test', policy); + +trustedTypes.createHTML('') instanceof TrustedHTML; +trustedTypes.createScript('') instanceof TrustedScript; +trustedTypes.createScriptURL('') instanceof TrustedScriptURL; +trustedTypes.createURL('') instanceof TrustedURL; diff --git a/types/trusted-types/tsconfig.json b/types/trusted-types/tsconfig.json new file mode 100644 index 0000000000..8bfe83a032 --- /dev/null +++ b/types/trusted-types/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "trusted-types-tests.ts" + ] +} diff --git a/types/trusted-types/tslint.json b/types/trusted-types/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/trusted-types/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 71cbfeded447b7d6b7da29d03a701dc26660d070 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 9 Jan 2019 14:46:52 +0100 Subject: [PATCH 229/646] trusted-types: Prevent structural typing --- types/trusted-types/index.d.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/types/trusted-types/index.d.ts b/types/trusted-types/index.d.ts index 64ed96b713..2d2db62999 100644 --- a/types/trusted-types/index.d.ts +++ b/types/trusted-types/index.d.ts @@ -3,10 +3,21 @@ // Definitions by: Jakub Vrana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare class TrustedHTML {} -declare class TrustedScript {} -declare class TrustedScriptURL {} -declare class TrustedURL {} +declare class TrustedHTML { + private readonly _TrustedHTMLBrand: true; // To prevent structural typing. +} + +declare class TrustedScript { + private readonly _TrustedScriptBrand: true; // To prevent structural typing. +} + +declare class TrustedScriptURL { + private readonly _TrustedScriptURLBrand: true; // To prevent structural typing. +} + +declare class TrustedURL { + private readonly _TrustedURL: trueBrand; // To prevent structural typing. +} declare class TrustedTypePolicy { createHTML(s: string): TrustedHTML; From e34aaeda276d127870a6fa0e2ec74cc2e5f0ea55 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 9 Jan 2019 15:05:02 +0100 Subject: [PATCH 230/646] trusted-types: Fix a typo --- types/trusted-types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/trusted-types/index.d.ts b/types/trusted-types/index.d.ts index 2d2db62999..e6e410dfed 100644 --- a/types/trusted-types/index.d.ts +++ b/types/trusted-types/index.d.ts @@ -16,7 +16,7 @@ declare class TrustedScriptURL { } declare class TrustedURL { - private readonly _TrustedURL: trueBrand; // To prevent structural typing. + private readonly _TrustedURLBrand: true; // To prevent structural typing. } declare class TrustedTypePolicy { From 0db26808f992714424374ffb7c7b420da3acee64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Wed, 9 Jan 2019 11:51:16 +0200 Subject: [PATCH 231/646] fix: TransactionRecord --- types/stellar-sdk/index.d.ts | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 5180c2e14d..a5692f56f4 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -11,6 +11,11 @@ /// +// Dependency +export type Key = string|number|symbol; +export type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; +export type Omit = Pick>; + export namespace StellarBase { class Account { constructor(accountId: string, sequence: string | number) @@ -734,25 +739,8 @@ export namespace Server { close: string; } - interface TransactionRecord extends Horizon.BaseResponse { - id: string; - paging_token: string; - hash: string; - ledger_attr: number; - created_at: string; - max_fee: number; - fee_paid: number; - operation_count: number; - result_code: number; - result_code_s: string; - source_account: string; - source_account_sequence: string; - envelope_xdr: string; - result_xdr: string; - result_meta_xdr: string; - memo: string; - envelope: any; - memo_type: any; + interface TransactionRecord extends Omit { + ledger_attr: Horizon.TransactionResponse['ledger']; account: CallFunction; effects: CallCollectionFunction; @@ -888,7 +876,8 @@ export namespace Horizon { hash: string; id: string; ledger: number; - memo_type: string; + memo_type: Memo.AnyType; + memo?: string; operation_count: number; paging_token: string; result_meta_xdr: string; From 9c21b9040cc91bbc84cf4dd0288cf4075809e374 Mon Sep 17 00:00:00 2001 From: Max Bogue Date: Wed, 9 Jan 2019 10:34:27 -0600 Subject: [PATCH 232/646] Attempt filtering out StringIterator. --- types/lodash/common/collection.d.ts | 2 +- types/lodash/fp.d.ts | 137 ++++++++++------------------ types/lodash/lodash-tests.ts | 4 +- types/lodash/scripts/generate-fp.ts | 1 + 4 files changed, 54 insertions(+), 90 deletions(-) diff --git a/types/lodash/common/collection.d.ts b/types/lodash/common/collection.d.ts index 024116adc8..641a4f92f7 100644 --- a/types/lodash/common/collection.d.ts +++ b/types/lodash/common/collection.d.ts @@ -215,7 +215,7 @@ declare module "../index" { * @return Returns the new filtered array. */ filter( - collection: string | string[] | null | undefined, + collection: string | null | undefined, predicate?: StringIterator ): string[]; diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index a31b8b459d..68084f1c8d 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -616,20 +616,15 @@ declare namespace _ { (iteratee: (value: T) => any): LodashForEach1x1; (iteratee: lodash.__, collection: ReadonlyArray): LodashForEach1x2; (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - (iteratee: (value: string) => any): LodashForEach2x1; - (iteratee: lodash.__, collection: string): LodashForEach2x2; - (iteratee: (value: string) => any, collection: string): string; - (iteratee: lodash.__, collection: lodash.List): LodashForEach3x2; + (iteratee: lodash.__, collection: lodash.List): LodashForEach2x2; (iteratee: (value: T) => any, collection: lodash.List): lodash.List; - (iteratee: lodash.__, collection: T): LodashForEach4x2; + (iteratee: lodash.__, collection: T): LodashForEach3x2; (iteratee: (value: T[keyof T]) => any, collection: T): T; - (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEach5x2; + (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEach4x2; (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - (iteratee: lodash.__, collection: TString): LodashForEach6x2; - (iteratee: (value: string) => any, collection: TString): TString; - | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEach7x2; + | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEach5x2; | null | undefined>(iteratee: (value: T) => any, collection: TList & (lodash.List | null | undefined)): TList; - (iteratee: lodash.__, collection: T | null | undefined): LodashForEach8x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashForEach6x2; (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; } interface LodashForEach1x1 { @@ -641,35 +636,24 @@ declare namespace _ { (collection: T1 | null | undefined): T1 | null | undefined; } type LodashForEach1x2 = (iteratee: (value: T) => any) => T[]; - interface LodashForEach2x1 { - (collection: string): string; - (collection: TString): TString; - } - type LodashForEach2x2 = (iteratee: (value: string) => any) => string; - type LodashForEach3x2 = (iteratee: (value: T) => any) => lodash.List; - type LodashForEach4x2 = (iteratee: (value: T[keyof T]) => any) => T; - type LodashForEach5x2 = (iteratee: (value: T) => any) => TArray; - type LodashForEach6x2 = (iteratee: (value: string) => any) => TString; - type LodashForEach7x2 = (iteratee: (value: T) => any) => TList; - type LodashForEach8x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + type LodashForEach2x2 = (iteratee: (value: T) => any) => lodash.List; + type LodashForEach3x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForEach4x2 = (iteratee: (value: T) => any) => TArray; + type LodashForEach5x2 = (iteratee: (value: T) => any) => TList; + type LodashForEach6x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; interface LodashForEachRight { (iteratee: (value: T) => any): LodashForEachRight1x1; (iteratee: lodash.__, collection: ReadonlyArray): LodashForEachRight1x2; (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - (iteratee: (value: string) => any): LodashForEachRight2x1; - (iteratee: lodash.__, collection: string): LodashForEachRight2x2; - (iteratee: (value: string) => any, collection: string): string; - (iteratee: lodash.__, collection: lodash.List): LodashForEachRight3x2; + (iteratee: lodash.__, collection: lodash.List): LodashForEachRight2x2; (iteratee: (value: T) => any, collection: lodash.List): lodash.List; - (iteratee: lodash.__, collection: T): LodashForEachRight4x2; + (iteratee: lodash.__, collection: T): LodashForEachRight3x2; (iteratee: (value: T[keyof T]) => any, collection: T): T; - (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEachRight5x2; + (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEachRight4x2; (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - (iteratee: lodash.__, collection: TString): LodashForEachRight6x2; - (iteratee: (value: string) => any, collection: TString): TString; - | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEachRight7x2; + | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEachRight5x2; | null | undefined>(iteratee: (value: T) => any, collection: TList & (lodash.List | null | undefined)): TList; - (iteratee: lodash.__, collection: T | null | undefined): LodashForEachRight8x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashForEachRight6x2; (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; } interface LodashForEachRight1x1 { @@ -681,17 +665,11 @@ declare namespace _ { (collection: T1 | null | undefined): T1 | null | undefined; } type LodashForEachRight1x2 = (iteratee: (value: T) => any) => T[]; - interface LodashForEachRight2x1 { - (collection: string): string; - (collection: TString): TString; - } - type LodashForEachRight2x2 = (iteratee: (value: string) => any) => string; - type LodashForEachRight3x2 = (iteratee: (value: T) => any) => lodash.List; - type LodashForEachRight4x2 = (iteratee: (value: T[keyof T]) => any) => T; - type LodashForEachRight5x2 = (iteratee: (value: T) => any) => TArray; - type LodashForEachRight6x2 = (iteratee: (value: string) => any) => TString; - type LodashForEachRight7x2 = (iteratee: (value: T) => any) => TList; - type LodashForEachRight8x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + type LodashForEachRight2x2 = (iteratee: (value: T) => any) => lodash.List; + type LodashForEachRight3x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForEachRight4x2 = (iteratee: (value: T) => any) => TArray; + type LodashForEachRight5x2 = (iteratee: (value: T) => any) => TList; + type LodashForEachRight6x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; interface LodashEndsWith { (target: string): LodashEndsWith1x1; (target: lodash.__, string: string): LodashEndsWith1x2; @@ -917,29 +895,24 @@ declare namespace _ { type LodashFill2x13 = (end: number) => lodash.List; type LodashFill2x14 = (start: number) => lodash.List; interface LodashFilter { - (predicate: (value: string) => boolean): LodashFilter1x1; - (predicate: lodash.__, collection: string | string[] | null | undefined): LodashFilter1x2; - (predicate: (value: string) => boolean, collection: string | string[] | null | undefined): string[]; - (predicate: lodash.ValueIteratorTypeGuard): LodashFilter2x1; - (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFilter2x2; + (predicate: lodash.ValueIteratorTypeGuard): LodashFilter1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFilter1x2; (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S[]; - (predicate: lodash.ValueIterateeCustom): LodashFilter3x1; + (predicate: lodash.ValueIterateeCustom): LodashFilter2x1; (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T[]; - (predicate: lodash.ValueIteratorTypeGuard): LodashFilter4x1; - (predicate: lodash.__, collection: T | null | undefined): LodashFilter4x2; + (predicate: lodash.ValueIteratorTypeGuard): LodashFilter3x1; + (predicate: lodash.__, collection: T | null | undefined): LodashFilter3x2; (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S[]; (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; } - type LodashFilter1x1 = (collection: string | string[] | null | undefined) => string[]; - type LodashFilter1x2 = (predicate: (value: string) => boolean) => string[]; - type LodashFilter2x1 = (collection: lodash.List | null | undefined) => S[]; - interface LodashFilter2x2 { + type LodashFilter1x1 = (collection: lodash.List | null | undefined) => S[]; + interface LodashFilter1x2 { (predicate: lodash.ValueIteratorTypeGuard): S[]; (predicate: lodash.ValueIterateeCustom): T[]; } - type LodashFilter3x1 = (collection: lodash.List | object | null | undefined) => T[]; - type LodashFilter4x1 = (collection: T | null | undefined) => S[]; - interface LodashFilter4x2 { + type LodashFilter2x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashFilter3x1 = (collection: T | null | undefined) => S[]; + interface LodashFilter3x2 { (predicate: lodash.ValueIteratorTypeGuard): S[]; (predicate: lodash.ValueIterateeCustom): Array; } @@ -2131,45 +2104,40 @@ declare namespace _ { type LodashMapKeys2x1 = (object: T | null | undefined) => lodash.Dictionary; type LodashMapKeys2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; interface LodashMapValues { - (callback: (value: string) => TResult): LodashMapValues1x1; - (callback: lodash.__, obj: string | null | undefined): LodashMapValues1x2; - (callback: (value: string) => TResult, obj: string | null | undefined): lodash.NumericDictionary; - (callback: (value: T) => TResult): LodashMapValues2x1; - (callbackOrIterateeOrIterateeOrIteratee: lodash.__, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashMapValues2x2; + (callback: (value: T) => TResult): LodashMapValues1x1; + (callbackOrIterateeOrIterateeOrIteratee: lodash.__, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashMapValues1x2; (callback: (value: T) => TResult, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; - (callback: (value: T[keyof T]) => TResult): LodashMapValues3x1; - (callbackOrIterateeOrIteratee: lodash.__, obj: T | null | undefined): LodashMapValues3x2; + (callback: (value: T[keyof T]) => TResult): LodashMapValues2x1; + (callbackOrIterateeOrIteratee: lodash.__, obj: T | null | undefined): LodashMapValues2x2; (callback: (value: T[keyof T]) => TResult, obj: T | null | undefined): { [P in keyof T]: TResult }; - (iteratee: object): LodashMapValues4x1; + (iteratee: object): LodashMapValues3x1; (iteratee: object, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; (iteratee: object, obj: T | null | undefined): { [P in keyof T]: boolean }; - (iteratee: TKey): LodashMapValues6x1; + (iteratee: TKey): LodashMapValues5x1; (iteratee: TKey, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; - (iteratee: string): LodashMapValues7x1; + (iteratee: string): LodashMapValues6x1; (iteratee: string, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; (iteratee: string, obj: T | null | undefined): { [P in keyof T]: any }; } - type LodashMapValues1x1 = (obj: string | null | undefined) => lodash.NumericDictionary; - type LodashMapValues1x2 = (callback: (value: string) => TResult) => lodash.NumericDictionary; - type LodashMapValues2x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; - interface LodashMapValues2x2 { + type LodashMapValues1x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; + interface LodashMapValues1x2 { (callback: (value: T) => TResult): lodash.Dictionary; (iteratee: object): lodash.Dictionary; (iteratee: TKey): lodash.Dictionary; (iteratee: string): lodash.Dictionary; } - type LodashMapValues3x1 = (obj: T | null | undefined) => { [P in keyof T]: TResult }; - interface LodashMapValues3x2 { + type LodashMapValues2x1 = (obj: T | null | undefined) => { [P in keyof T]: TResult }; + interface LodashMapValues2x2 { (callback: (value: T[keyof T]) => TResult): { [P in keyof T]: TResult }; (iteratee: object): { [P in keyof T]: boolean }; (iteratee: string): { [P in keyof T]: any }; } - interface LodashMapValues4x1 { + interface LodashMapValues3x1 { (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; (obj: T | null | undefined): { [P in keyof T]: boolean }; } - type LodashMapValues6x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; - interface LodashMapValues7x1 { + type LodashMapValues5x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; + interface LodashMapValues6x1 { (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; (obj: T | null | undefined): { [P in keyof T]: any }; } @@ -3536,20 +3504,15 @@ declare namespace _ { type LodashReduceRight3x5 = (accumulator: TResult) => TResult; type LodashReduceRight3x6 = (callback: lodash.MemoIteratorCappedRight) => TResult; interface LodashReject { - (predicate: (value: string) => boolean): LodashReject1x1; - (predicate: lodash.__, collection: string | null | undefined): LodashReject1x2; - (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; - (predicate: lodash.ValueIterateeCustom): LodashReject2x1; - (predicate: lodash.__, collection: lodash.List | null | undefined): LodashReject2x2; + (predicate: lodash.ValueIterateeCustom): LodashReject1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashReject1x2; (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T[]; - (predicate: lodash.__, collection: T | null | undefined): LodashReject3x2; + (predicate: lodash.__, collection: T | null | undefined): LodashReject2x2; (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; } - type LodashReject1x1 = (collection: string | null | undefined) => string[]; - type LodashReject1x2 = (predicate: (value: string) => boolean) => string[]; - type LodashReject2x1 = (collection: lodash.List | object | null | undefined) => T[]; - type LodashReject2x2 = (predicate: lodash.ValueIterateeCustom) => T[]; - type LodashReject3x2 = (predicate: lodash.ValueIterateeCustom) => Array; + type LodashReject1x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashReject1x2 = (predicate: lodash.ValueIterateeCustom) => T[]; + type LodashReject2x2 = (predicate: lodash.ValueIterateeCustom) => Array; interface LodashRemove { (predicate: lodash.ValueIteratee): LodashRemove1x1; (predicate: lodash.__, array: lodash.List): LodashRemove1x2; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 1aa4bc3eb2..15feece064 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -1766,7 +1766,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; @@ -2338,7 +2338,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper }); - fp.forEach(stringIterator, ""); // $ExpectType string + fp.forEach(stringIterator, ""); // $ExpectType ArrayLike fp.forEach(valueIterator, array); // $ExpectType AbcObject[] fp.forEach(valueIterator)(array); // $ExpectType AbcObject[] fp.forEach(valueIterator, list); // $ExpectType ArrayLike diff --git a/types/lodash/scripts/generate-fp.ts b/types/lodash/scripts/generate-fp.ts index 817b485cf2..8dc4b7d3eb 100644 --- a/types/lodash/scripts/generate-fp.ts +++ b/types/lodash/scripts/generate-fp.ts @@ -153,6 +153,7 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P for (const filePath of filePaths) { const definitions = await parseFile(filePath, commonTypes); for (const definition of definitions) { + definition.overloads = definition.overloads.filter(o => !o.params.some(p => p.includes('StringIterator'))); if (definition.overloads.every(o => o.params.length <= 1 && (o.returnType === "typeof _" || o.returnType === "LoDashStatic"))) { // Our convert technique doesn't work well on "typeof _" functions (or at least runInContext) // Plus, if there are 0-1 parameters, there's nothing to curry anyways. From 73845813f9d05cbc6bca9a2a8a5964119ea180e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Wed, 9 Jan 2019 19:55:00 +0200 Subject: [PATCH 233/646] feat: parameterize Transaction --- types/stellar-sdk/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index a5692f56f4..ca2fbc4651 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -371,7 +371,7 @@ export namespace StellarBase { function decodeSha256Hash(data: string): Buffer; } - class Transaction { + class Transaction { constructor(envelope: string | xdr.TransactionEnvelope) hash(): Buffer; sign(...keypairs: Keypair[]): void; @@ -379,11 +379,11 @@ export namespace StellarBase { signHashX(preimage: Buffer | string): void; toEnvelope(): xdr.TransactionEnvelope; - operations: TransactionOperation[]; + operations: TOps; sequence: number; fee: number; source: string; - memo: Memo; + memo: TMemo; signatures: xdr.DecoratedSignature[]; } From 875ec553cffcdc35cbfa0728096de49afc7b22fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Wed, 9 Jan 2019 20:02:58 +0200 Subject: [PATCH 234/646] fix: linter & tests --- types/stellar-sdk/index.d.ts | 2 +- types/stellar-sdk/stellar-sdk-tests.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index ca2fbc4651..d632b6c0a2 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -7,7 +7,7 @@ // Timur Ramazanov // Kalvis Kalniņš // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 /// diff --git a/types/stellar-sdk/stellar-sdk-tests.ts b/types/stellar-sdk/stellar-sdk-tests.ts index c4dcbda7c8..143ccdaba4 100644 --- a/types/stellar-sdk/stellar-sdk-tests.ts +++ b/types/stellar-sdk/stellar-sdk-tests.ts @@ -6,8 +6,7 @@ const account = new StellarSdk.Account(sourceKey.publicKey(), '1'); const transaction = new StellarSdk.TransactionBuilder(account) .addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()})) .addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo")) - .build(); // $ExpectType () => Transaction -transaction; // $ExpectType Transaction + .build(); // $ExpectType () => Transaction StellarSdk.StellarTomlResolver.resolve("example.com", {allowHttp: true, timeout: 100}) .then(toml => toml.FEDERATION_SERVER); From 26f45797e9b674ac7fd59418c568233939b3ee3f Mon Sep 17 00:00:00 2001 From: Daniel Yule Date: Wed, 9 Jan 2019 10:29:45 -0800 Subject: [PATCH 235/646] @types/angular-material Add missing close method to IMenuService --- types/angular-material/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 9202829175..19c6dcc9e5 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -344,6 +344,7 @@ declare module 'angular' { } interface IMenuService { + close(): void; hide(response?: any, options?: any): IPromise; open(event?: MouseEvent): void; } From 3f04bdfc94fab9b1eafc65528b10deaeb82bc56c Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Wed, 9 Jan 2019 20:03:18 +0100 Subject: [PATCH 236/646] [new-github-release-url] Add types --- types/new-github-release-url/index.d.ts | 63 +++++++++++++++++++ .../new-github-release-url-tests.ts | 44 +++++++++++++ types/new-github-release-url/tsconfig.json | 23 +++++++ types/new-github-release-url/tslint.json | 1 + 4 files changed, 131 insertions(+) create mode 100644 types/new-github-release-url/index.d.ts create mode 100644 types/new-github-release-url/new-github-release-url-tests.ts create mode 100644 types/new-github-release-url/tsconfig.json create mode 100644 types/new-github-release-url/tslint.json diff --git a/types/new-github-release-url/index.d.ts b/types/new-github-release-url/index.d.ts new file mode 100644 index 0000000000..3b1be4b7f2 --- /dev/null +++ b/types/new-github-release-url/index.d.ts @@ -0,0 +1,63 @@ +// Type definitions for new-github-release-url 0.1 +// Project: https://github.com/sindresorhus/new-github-release-url#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export = newGithubReleaseUrl; + +/** + * Returns a URL string. + */ +declare function newGithubReleaseUrl(options: newGithubReleaseUrl.Options): string; + +declare namespace newGithubReleaseUrl { + type Without = { [P in Exclude]?: never }; + type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + + type Options = XOR; + + interface BaseOptions { + /** + * The tag name of the release. + */ + tag?: string; + /** + * The branch name or commit SHA to point the release's tag at, if the tag doesn't already exist. + * @default The default branch + */ + target?: string; + /** + * The title of the release. + * GitHub shows the `tag` name when not specified. + */ + title?: string; + /** + * The description text of the release. + */ + body?: string; + /** + * Whether the release should be marked as a pre-release. + * @default false + */ + isPrerelease?: boolean; + } + + interface RepoUrlOptions extends BaseOptions { + /** + * The full URL to the repo. + */ + repoUrl: string; + } + + interface UserRepoOptions extends BaseOptions { + /** + * GitHub username or organization. + */ + user: string; + /** + * GitHub repo. + */ + repo: string; + } +} diff --git a/types/new-github-release-url/new-github-release-url-tests.ts b/types/new-github-release-url/new-github-release-url-tests.ts new file mode 100644 index 0000000000..9efe4e83db --- /dev/null +++ b/types/new-github-release-url/new-github-release-url-tests.ts @@ -0,0 +1,44 @@ +import newGithubReleaseUrl = require('new-github-release-url'); + +// $ExpectType string +newGithubReleaseUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', +}); +// $ExpectType string +newGithubReleaseUrl({ + user: 'sindresorhus', + repo: 'new-github-release-url', +}); +// $ExpectError +newGithubReleaseUrl({ + user: 'sindresorhus', +}); +// $ExpectError +newGithubReleaseUrl({ + repo: 'new-github-release-url', +}); +// $ExpectType string +newGithubReleaseUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + tag: 'foo', +}); +// $ExpectType string +newGithubReleaseUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + target: 'foo', +}); +// $ExpectType string +newGithubReleaseUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + title: 'foo', +}); +// $ExpectType string +newGithubReleaseUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + body: 'foo', +}); +// $ExpectType string +newGithubReleaseUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + isPrerelease: true, +}); diff --git a/types/new-github-release-url/tsconfig.json b/types/new-github-release-url/tsconfig.json new file mode 100644 index 0000000000..62cf729db4 --- /dev/null +++ b/types/new-github-release-url/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", + "new-github-release-url-tests.ts" + ] +} diff --git a/types/new-github-release-url/tslint.json b/types/new-github-release-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/new-github-release-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 1424b551719a8b17367b47aaef4400d274c8694c Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 9 Jan 2019 11:14:49 -0800 Subject: [PATCH 237/646] Refreshing Excel preview APIs --- types/office-js-preview/index.d.ts | 2778 +++++++++++++++++++++++++--- 1 file changed, 2567 insertions(+), 211 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index dec070dad5..8a9904d462 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -17753,6 +17753,107 @@ declare namespace OfficeCore { //////////////////////////////////////////////////////////////// declare namespace Excel { + /** Represents which cell properties to load, when used as part of a "range.getCellProperties" method. */ + interface CellPropertiesLoadOptions { + address?: boolean; + addressLocal?: boolean; + format?: Excel.CellPropertiesFormatLoadOptions; + hasSpill?: boolean; + hidden?: boolean; + hyperlink?: boolean; + style?: boolean; + } + /** Represents which row properties to load, when used as part of a "range.getRowProperties" method. */ + interface RowPropertiesLoadOptions extends CellPropertiesLoadOptions { + rowHidden?: boolean; + rowIndex?: boolean; + format?: Excel.CellPropertiesFormatLoadOptions & { + rowHeight?: boolean; + }; + } + /** Represents which column properties to load, when used as part of a "range.getColumnProperties" method. */ + interface ColumnPropertiesLoadOptions extends CellPropertiesLoadOptions { + columnIndex?: boolean; + columnHidden?: boolean; + format?: Excel.CellPropertiesFormatLoadOptions & { + columnWidth?: boolean; + }; + } + /** Represents which properties to load on the format object. */ + interface CellPropertiesFormatLoadOptions { + autoIndent?: boolean; + borders?: Excel.CellPropertiesBorderLoadOptions; + fill?: Excel.CellPropertiesFillLoadOptions; + font?: Excel.CellPropertiesFontLoadOptions; + horizontalAlignment?: boolean; + indentLevel?: boolean; + protection?: boolean; + readingOrder?: boolean; + shrinkToFit?: boolean; + textOrientation?: boolean; + useStandardHeight?: boolean; + useStandardWidth?: boolean; + verticalAlignment?: boolean; + wrapText?: boolean; + } + /** Represents the input parameter of setCellProperties. */ + interface SettableCellProperties { + format?: Excel.CellPropertiesFormat; + hyperlink?: Excel.RangeHyperlink; + style?: string; + } + /** Represents the returned properties of getCellProperties. */ + interface CellProperties extends SettableCellProperties { + address?: string; + addressLocal?: string; + hasSpill?: boolean; + hidden?: boolean; + } + /** Represents the input parameter of setRowProperties. */ + interface SettableRowProperties extends SettableCellProperties { + rowHidden?: boolean; + format?: Excel.CellPropertiesFormat & { + rowHeight?: number; + }; + } + /** Represents the returned properties of getRowProperties. */ + interface RowProperties extends SettableRowProperties { + rowIndex?: number; + address?: string; + addressLocal?: string; + hasSpill?: boolean; + } + /** Represents the input parameter of setColumnProperties. */ + interface SettableColumnProperties extends SettableCellProperties { + columnHidden?: boolean; + format?: Excel.CellPropertiesFormat & { + columnWidth?: number; + }; + } + /** Represents the returned properties of getColumnProperties. */ + interface ColumnProperties extends SettableColumnProperties { + columnIndex?: number; + address?: string; + addressLocal?: string; + hasSpill?: boolean; + } + /** Represents the returned format properties of getCellProperties or format input parameter of setCellProperties. */ + interface CellPropertiesFormat { + autoIndent?: boolean; + borders?: Excel.CellBorderCollection; + fill?: Excel.CellPropertiesFill; + font?: Excel.CellPropertiesFont; + horizontalAlignment?: Excel.HorizontalAlignment | "General" | "Left" | "Center" | "Right" | "Fill" | "Justify" | "CenterAcrossSelection" | "Distributed"; + indentLevel?: number; + protection?: Excel.CellPropertiesProtection; + readingOrder?: Excel.ReadingOrder | "Context" | "LeftToRight" | "RightToLeft"; + shrinkToFit?: boolean; + textOrientation?: number; + useStandardHeight?: boolean; + useStandardWidth?: boolean; + verticalAlignment?: Excel.VerticalAlignment | "Top" | "Center" | "Bottom" | "Justify" | "Distributed"; + wrapText?: boolean; + } /** * * Creates and opens a new workbook. Optionally, the workbook can be pre-populated with a base64-encoded .xlsx file. @@ -17761,7 +17862,7 @@ declare namespace Excel { * * @param base64File Optional. The base64 encoded .xlsx file. The default value is null. */ - function createWorkbook(base64?: string): Promise; + function createWorkbook(base64?: string): Promise; interface ThreeArrowsSet { [index: number]: Icon; redDownArrow: Icon; @@ -17994,6 +18095,8 @@ declare namespace Excel { * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. */ function run(context: OfficeExtension.ClientRequestContext, batch: (context: Excel.RequestContext) => Promise): Promise; + function postprocessBindingDescriptor(response: any): any; + function getDataCommonPostprocess(response: any, callArgs: any): any; /** * * Provides information about the binding that raised the SelectionChanged event. @@ -18826,7 +18929,7 @@ declare namespace Excel { context: RequestContext; /** * - * Turn on/off JavaScript events in current taskpane or content add-in. + * Toggle JavaScript events in the current task pane or content add-in. * * [Api set: ExcelApi 1.8] */ @@ -19150,6 +19253,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.4] */ readonly settings: Excel.SettingCollection; + /** + * + * Represents a collection of Slicers associated with the workbook. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly slicers: Excel.SlicerCollection; /** * * Represents a collection of styles associated with the workbook. Read-only. @@ -19300,6 +19411,22 @@ declare namespace Excel { * @beta */ getActiveChartOrNullObject(): Excel.Chart; + /** + * + * Gets the currently active slicer in the workbook. If there is no active slicer, will throw exception when invoke this statement. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getActiveSlicer(): Excel.Slicer; + /** + * + * Gets the currently active slicer in the workbook. If there is no active slicer, will return null object + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getActiveSlicerOrNullObject(): Excel.Slicer; /** * * True if the workbook is being edited by multiple users (co-authoring). @@ -19383,6 +19510,15 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * + * Occurs when a WAC operation occurs. + * + * [Api set: WACOperationEvents 1.1] + * + * @eventproperty + * @beta + */ /** * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) * Whereas the original Excel.Workbook object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorkbookData`) that contains shallow copies of any loaded child properties from the original object. @@ -19509,6 +19645,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ readonly charts: Excel.ChartCollection; + /** + * + * Returns a collection of all the Comments objects on the worksheet. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly comments: Excel.CommentCollection; /** * * Gets an object that can be used to manipulate frozen panes on the worksheet. Read-only. @@ -19561,6 +19705,14 @@ declare namespace Excel { * @beta */ readonly shapes: Excel.ShapeCollection; + /** + * + * Returns collection of slicers that are part of the worksheet. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly slicers: Excel.SlicerCollection; /** * * Collection of tables that are part of the worksheet. Read-only. @@ -20621,6 +20773,8 @@ declare namespace Excel { set(properties: Interfaces.RangeUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ set(properties: Excel.Range): void; + autoFill(destinationRange: Range | string, autoFillType?: Excel.AutoFillType): void; + autoFill(destinationRange: Range | string, autoFillType?: "FillDefault" | "FillCopy" | "FillSeries" | "FillFormats" | "FillValues" | "FillDays" | "FillWeekdays" | "FillMonths" | "FillYears" | "LinearTrend" | "GrowthTrend" | "FlashFill"): void; /** * * Calculates a range of cells on a worksheet. @@ -20766,6 +20920,14 @@ declare namespace Excel { * @param column Column number of the cell to be retrieved. Zero-indexed. */ getCell(row: number, column: number): Excel.Range; + /** + * + * Returns a 2D array, encapsulating the data for each cell's font, fill, borders, alignment, and other properties. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getCellProperties(cellPropertiesLoadOptions: CellPropertiesLoadOptions): OfficeExtension.ClientResult; /** * * Gets a column contained in the range. @@ -20775,6 +20937,14 @@ declare namespace Excel { * @param column Column number of the range to be retrieved. Zero-indexed. */ getColumn(column: number): Excel.Range; + /** + * + * Returns a single-dimensional array, encapsulating the data for each column's font, fill, borders, alignment, and other properties. For properties that are not consistent across each cell within a given column, null will be returned. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getColumnProperties(columnPropertiesLoadOptions: ColumnPropertiesLoadOptions): OfficeExtension.ClientResult; /** * * Gets a certain number of columns to the right of the current Range object. @@ -20882,6 +21052,14 @@ declare namespace Excel { * @param row Row number of the range to be retrieved. Zero-indexed. */ getRow(row: number): Excel.Range; + /** + * + * Returns a single-dimensional array, encapsulating the data for each row's font, fill, borders, alignment, and other properties. For properties that are not consistent across each cell within a given row, null will be returned. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getRowProperties(rowPropertiesLoadOptions: RowPropertiesLoadOptions): OfficeExtension.ClientResult; /** * * Gets a certain number of rows above the current Range object. @@ -21063,6 +21241,22 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ select(): void; + /** + * + * Updates the range based on a 2D array of cell properties , encapsulating things like font, fill, borders, alignment, and so forth. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + setCellProperties(cellPropertiesData: SettableCellProperties[][]): void; + /** + * + * Updates the range based on a single-dimensional array of column properties, encapsulating things like font, fill, borders, alignment, and so forth. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + setColumnProperties(columnPropertiesData: SettableColumnProperties[]): void; /** * * Set a range to be recalculated when the next recalculation occurs. @@ -21071,6 +21265,14 @@ declare namespace Excel { * @beta */ setDirty(): void; + /** + * + * Updates the range based on a single-dimensional array of row properties, encapsulating things like font, fill, borders, alignment, and so forth. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + setRowProperties(rowPropertiesData: SettableRowProperties[]): void; /** * * Displays the card for an active cell if it has rich value content. @@ -21617,6 +21819,126 @@ declare namespace Excel { */ matchCase?: boolean; } + /** + * + * Represents which properties to load on the format.fill object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellPropertiesFillLoadOptions { + color?: boolean; + pattern?: boolean; + patternColor?: boolean; + patternTintAndShade?: boolean; + tintAndShade?: boolean; + } + /** + * + * Represents which properties to load on the format.font object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellPropertiesFontLoadOptions { + bold?: boolean; + color?: boolean; + italic?: boolean; + name?: boolean; + size?: boolean; + strikethrough?: boolean; + subscript?: boolean; + superscript?: boolean; + tintAndShade?: boolean; + underline?: boolean; + } + /** + * + * Represents which properties to load on the format.borders object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellPropertiesBorderLoadOptions { + color?: boolean; + style?: boolean; + tintAndShade?: boolean; + weight?: boolean; + } + /** + * + * Represents the returned format.protection properties of getCell/Row/ColumnProperties or format.protection input parameter of setCell/Row/ColumnProperties. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellPropertiesProtection { + formulaHidden?: boolean; + locked?: boolean; + } + /** + * + * Represents the returned format.fill properties of getCell/Row/ColumnProperties or format.fill input parameter of setCell/Row/ColumnProperties. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellPropertiesFill { + color?: string; + pattern?: Excel.FillPattern | "None" | "Solid" | "Gray50" | "Gray75" | "Gray25" | "Horizontal" | "Vertical" | "Down" | "Up" | "Checker" | "SemiGray75" | "LightHorizontal" | "LightVertical" | "LightDown" | "LightUp" | "Grid" | "CrissCross" | "Gray16" | "Gray8" | "LinearGradient" | "RectangularGradient"; + patternColor?: string; + patternTintAndShade?: number; + tintAndShade?: number; + } + /** + * + * Represents the returned format.font properties of getCell/Row/ColumnProperties or format.font input parameter of setCell/Row/ColumnProperties. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellPropertiesFont { + bold?: boolean; + color?: string; + italic?: boolean; + name?: string; + size?: number; + strikethrough?: boolean; + subscript?: boolean; + superscript?: boolean; + tintAndShade?: number; + underline?: Excel.RangeUnderlineStyle | "None" | "Single" | "Double" | "SingleAccountant" | "DoubleAccountant"; + } + /** + * + * Represents the returned format.borders properties of getCell/Row/ColumnProperties or format.borders input parameter of setCell/Row/ColumnProperties. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellBorderCollection { + bottom?: Excel.CellBorder; + diagonalDown?: Excel.CellBorder; + diagonalUp?: Excel.CellBorder; + horizontal?: Excel.CellBorder; + left?: Excel.CellBorder; + right?: Excel.CellBorder; + top?: Excel.CellBorder; + vertical?: Excel.CellBorder; + } + /** + * + * Represents the returned single border properties of getCell/Row/ColumnProperties or border property input parameter of setCell/Row/ColumnProperties. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface CellBorder { + color?: string; + style?: Excel.BorderLineStyle | "None" | "Continuous" | "Dash" | "DashDot" | "DashDotDot" | "Dot" | "Double" | "SlantDashDot"; + tintAndShade?: number; + weight?: Excel.BorderWeight | "Hairline" | "Thin" | "Medium" | "Thick"; + } /** * * RangeView represents a set of visible cells of the parent range. @@ -21899,7 +22221,7 @@ declare namespace Excel { context: RequestContext; private static DateJSONPrefix; private static DateJSONSuffix; - private static replaceStringDateWithDate(value); + private static replaceStringDateWithDate; /** * * Returns the key that represents the id of the Setting. Read-only. @@ -23324,7 +23646,7 @@ declare namespace Excel { prompt: Excel.DataValidationPrompt; /** * - * Data Validation rule that contains different type of data validation criteria. + * Data validation rule that contains different type of data validation criteria. * * [Api set: ExcelApi 1.8] */ @@ -23528,7 +23850,8 @@ declare namespace Excel { interface BasicDataValidation { /** * - * Gets or sets the Formula1, i.e. minimum value or value depending of the operator. + * Specifies the right-hand operand when the operator property is set to a binary operator such as GreaterThan (the left-hand operand is the value the user tries to enter in the cell). With the ternary operators Between and NotBetween, specifies the lower bound operand. + For example, setting formula1 to 10 and operator to GreaterThan means that valid data for the range must be greater than 10. When setting the value, it can be passed in as a number, a range object, or a string formula (where the string is either a stringified number, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc. * @@ -23537,7 +23860,7 @@ declare namespace Excel { formula1: string | number | Range; /** * - * Gets or sets the Formula2, i.e. maximum value or value depending of the operator. + * With the ternary operators Between and NotBetween, specifies the upper bound operand. Is not used with the binary operators, such as GreaterThan. When setting the value, it can be passed in as a number, a range object, or a string formula (where the string is either a stringified number, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc. * @@ -23561,7 +23884,7 @@ declare namespace Excel { interface DateTimeDataValidation { /** * - * Gets or sets the Formula1, i.e. minimum value or value depending of the operator. + * Specifies the right-hand operand when the operator property is set to a binary operator such as GreaterThan (the left-hand operand is the value the user tries to enter in the cell). With the ternary operators Between and NotBetween, specifies the lower bound operand. When setting the value, it can be passed in as a Date, a Range object, or a string formula (where the string is either a stringified date/time in ISO8601 format, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc. * @@ -23570,7 +23893,7 @@ declare namespace Excel { formula1: string | Date | Range; /** * - * Gets or sets the Formula2, i.e. maximum value or value depending of the operator. + * With the ternary operators Between and NotBetween, specifies the upper bound operand. Is not used with the binary operators, such as GreaterThan. When setting the value, it can be passed in as a Date, a Range object, or a string (where the string is either a stringified date/time in ISO8601 format, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc. * @@ -23617,7 +23940,7 @@ declare namespace Excel { interface CustomDataValidation { /** * - * Custom data validation formula, it is to create special rules, such as preventing duplicates, or limiting the total in a range of cells. + * A custom data validation formula. This creates special input rules, such as preventing duplicates, or limiting the total in a range of cells. * * [Api set: ExcelApi 1.8] */ @@ -23639,14 +23962,14 @@ declare namespace Excel { message: string; /** * - * It determines show error alert dialog or not when users enter invalid data, it defaults to true. + * Determines whether to show an error alert dialog or not when a user enters invalid data. The default is true. * * [Api set: ExcelApi 1.8] */ showAlert: boolean; /** * - * Represents Data validation alert type, please see Excel.DataValidationAlertStyle for details. + * Represents data validation alert type, please see Excel.DataValidationAlertStyle for details. * * [Api set: ExcelApi 1.8] */ @@ -23675,7 +23998,7 @@ declare namespace Excel { message: string; /** * - * It determines showing the prompt or not when user selects a cell with the data validation. + * Determines whether or not to show the prompt when user selects a cell with data validation. * * [Api set: ExcelApi 1.8] */ @@ -23951,7 +24274,7 @@ declare namespace Excel { context: RequestContext; /** * - * HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") + * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") * * [Api set: ExcelApi 1.1] */ @@ -24532,7 +24855,7 @@ declare namespace Excel { readonly series: Excel.ChartSeriesCollection; /** * - * Represents the title of the specified chart, including the text, visibility, position, and formating of the title. Read-only. + * Represents the title of the specified chart, including the text, visibility, position, and formatting of the title. Read-only. * * [Api set: ExcelApi 1.1] */ @@ -24625,7 +24948,7 @@ declare namespace Excel { showAllFieldButtons: boolean; /** * - * Represents whether to to show the data labels when the value is greater than the maximum value on the value axis. + * Represents whether to show the data labels when the value is greater than the maximum value on the value axis. If value axis became smaller than the size of data points, you can use this property to set whether to show the data labels. This property applies to 2-D charts only. * @@ -25295,7 +25618,7 @@ declare namespace Excel { name: string; /** * - * Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. + * Specifies how bars and columns are positioned. Can be a value between –100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -25460,7 +25783,7 @@ declare namespace Excel { context: RequestContext; /** * - * Represents the fill format of a chart series, which includes background formating information. Read-only. + * Represents the fill format of a chart series, which includes background formatting information. Read-only. * * [Api set: ExcelApi 1.1] */ @@ -25695,7 +26018,7 @@ declare namespace Excel { readonly border: Excel.ChartBorder; /** * - * Represents the fill format of a chart, which includes background formating information. Read-only. + * Represents the fill format of a chart, which includes background formatting information. Read-only. * * [Api set: ExcelApi 1.1] */ @@ -26033,7 +26356,7 @@ declare namespace Excel { position: Excel.ChartAxisPosition | "Automatic" | "Maximum" | "Minimum" | "Custom"; /** * - * Represents the specified axis position where the other axis crosses at. Read Only. Set to this property should use SetPositionAt(double) method. + * Represents the specified axis position where the other axis crosses at. You should use the SetPositionAt(double) method to set this property. * * [Api set: ExcelApi 1.8] */ @@ -26423,7 +26746,7 @@ declare namespace Excel { readonly format: Excel.ChartDataLabelFormat; /** * - * Represents whether data labels automatically generates appropriate text based on context. + * Represents whether data labels automatically generate appropriate text based on context. * * [Api set: ExcelApi 1.8] */ @@ -27236,14 +27559,14 @@ declare namespace Excel { context: RequestContext; /** * - * Represents the height of the legendEntry on the chart Legend. + * Represents the height of the legendEntry on the chart legend. * * [Api set: ExcelApi 1.8] */ readonly height: number; /** * - * Represents the index of the LegendEntry in the Chart Legend. + * Represents the index of the legendEntry in the chart legend. * * [Api set: ExcelApi 1.8] */ @@ -27386,7 +27709,7 @@ declare namespace Excel { readonly border: Excel.ChartBorder; /** * - * Represents the fill format of an object, which includes background formating information. Read-only. + * Represents the fill format of an object, which includes background formatting information. Read-only. * * [Api set: ExcelApi 1.1] */ @@ -27749,7 +28072,7 @@ declare namespace Excel { readonly border: Excel.ChartBorder; /** * - * Represents the fill format of an object, which includes background formating information. Read-only. + * Represents the fill format of an object, which includes background formatting information. Read-only. * * [Api set: ExcelApi 1.1] */ @@ -27828,7 +28151,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.1] * - * @param color HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). + * @param color HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). */ setSolidColor(color: string): void; /** @@ -28898,7 +29221,7 @@ declare namespace Excel { readonly border: Excel.ChartBorder; /** * - * Represents the fill format of an object, which includes background formating information. + * Represents the fill format of an object, which includes background formatting information. * * [Api set: ExcelApi 1.8] */ @@ -29908,6 +30231,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ readonly worksheet: Excel.Worksheet; + /** + * + * True if the PivotTable should use custom lists when sorting. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enableDataValueEditing: boolean; /** * * Id of the PivotTable. Read-only. @@ -29994,6 +30325,14 @@ declare namespace Excel { class PivotLayout extends OfficeExtension.ClientObject { /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ context: RequestContext; + /** + * + * True if formatting will be automatically formatted when it’s refreshed or when fields are moved + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + autoFormat: boolean; /** * * True if the field list should be shown or hidden from the UI. @@ -30009,6 +30348,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ layoutType: Excel.PivotLayoutType | "Compact" | "Tabular" | "Outline"; + /** + * + * True if formatting is preserved when the report is refreshed or recalculated by operations such as pivoting, sorting, or changing page field items. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + preserveFormatting: boolean; /** * * True if the PivotTable report shows grand totals for columns. @@ -30752,7 +31099,7 @@ declare namespace Excel { position: number; /** * - * Determines whether the data should be sown as a specific summary calculation or not. + * Determines whether the data should be shown as a specific summary calculation or not. * * [Api set: ExcelApi 1.8] */ @@ -30818,14 +31165,14 @@ declare namespace Excel { interface ShowAsRule { /** * - * The Base PivotField to base the ShowAs calculation, if applicable based on the ShowAsCalculation type, else null. + * The base PivotField to base the ShowAs calculation, if applicable based on the ShowAsCalculation type, else null. * * [Api set: ExcelApi 1.8] */ baseField?: Excel.PivotField; /** * - * The Base Item to base the ShowAs calculation on, if applicable based on the ShowAsCalculation type, else null. + * The base Item to base the ShowAs calculation on, if applicable based on the ShowAsCalculation type, else null. * * [Api set: ExcelApi 1.8] */ @@ -31201,7 +31548,7 @@ declare namespace Excel { topSum = "TopSum", bottomItems = "BottomItems", bottomPercent = "BottomPercent", - bottomSum = "BottomSum", + bottomSum = "BottomSum" } /** * @@ -31221,7 +31568,7 @@ declare namespace Excel { * Descending sort. Largest to smallest or Z to A. * */ - descending = "Descending", + descending = "Descending" } /** * @@ -31307,7 +31654,7 @@ declare namespace Excel { * Aggregate using the variance of the data, equivalent to the VARP function. * */ - varianceP = "VarianceP", + varianceP = "VarianceP" } /** * @@ -31412,7 +31759,7 @@ declare namespace Excel { ((value in cell) x (Grand Total of Grand Totals)) / ((Grand Row Total) x (Grand Column Total)) * */ - index = "Index", + index = "Index" } /** * @@ -31451,7 +31798,7 @@ declare namespace Excel { * The filter axis. * */ - filter = "Filter", + filter = "Filter" } /** * @@ -32703,7 +33050,7 @@ declare namespace Excel { formula?: string; /** * - * What the icon conditional formula should be based on. + * What the criterion conditional formula should be based on. * * [Api set: ExcelApi 1.6] */ @@ -33688,6 +34035,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class StyleCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Style[]; /** @@ -33699,6 +34048,14 @@ declare namespace Excel { * @param name Name of the style to be added. */ add(name: string): void; + /** + * + * Gets the number of styles in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getCount(): OfficeExtension.ClientResult; /** * * Gets a style by name. @@ -33708,6 +34065,16 @@ declare namespace Excel { * @param name Name of the style to be retrieved. */ getItem(name: string): Excel.Style; + /** + * + * Gets a style based on its position in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param index Index value of the object to be retrieved. Zero-indexed. + */ + getItemAt(index: number): Excel.Style; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -33726,6 +34093,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.StyleCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.StyleCollection; load(option?: string | string[]): Excel.StyleCollection; load(option?: OfficeExtension.LoadOption): Excel.StyleCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.StyleCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.StyleCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.StyleCollectionData; } /** @@ -34554,6 +34925,30 @@ declare namespace Excel { context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Comment[]; + /** + * + * Creates a new comment(comment thread) based on the cell location and content. Invalid argument will be thrown if the location is larger than one cell. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param content The comment content. + * @param cellAddress Cell to insert comment to. May be an Excel Range object, or a string. If string, must contain the full address, including the sheet name + * @param contentType Optional. Type of the comment content + */ + add(content: string, cellAddress: Range | string, contentType?: Excel.ContentType): Excel.Comment; + /** + * + * Creates a new comment(comment thread) based on the cell location and content. Invalid argument will be thrown if the location is larger than one cell. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param content The comment content. + * @param cellAddress Cell to insert comment to. May be an Excel Range object, or a string. If string, must contain the full address, including the sheet name + * @param contentType Optional. Type of the comment content + */ + add(content: string, cellAddress: Range | string, contentType?: "Plain"): Excel.Comment; /** * * Gets the number of comments in the collection. @@ -34582,6 +34977,26 @@ declare namespace Excel { * @param index Index value of the object to be retrieved. Zero-indexed. */ getItemAt(index: number): Excel.Comment; + /** + * + * Gets a comment on the specific cell in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param cellAddress Cell which the comment is on. May be an Excel Range object, or a string. If string, must contain the full address, including the sheet name + */ + getItemByCell(cellAddress: Range | string): Excel.Comment; + /** + * + * Gets a comment related to its reply ID in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param replyId The identifier of comment reply. + */ + getItemByReplyId(replyId: string): Excel.Comment; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -34624,6 +35039,14 @@ declare namespace Excel { * @beta */ readonly replies: Excel.CommentReplyCollection; + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content: string; /** * * Represents the comment identifier. Read-only. @@ -34640,6 +35063,28 @@ declare namespace Excel { * @beta */ readonly isParent: boolean; + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Excel.Comment): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ + set(properties: Interfaces.CommentUpdateData, options?: OfficeExtension.UpdateOptions): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Excel.Comment): void; + /** + * + * Deletes the comment thread. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + delete(): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -34701,6 +35146,14 @@ declare namespace Excel { * @param contentType Optional. Type of the comment content */ add(content: string, contentType?: "Plain"): Excel.CommentReply; + /** + * + * Gets the number of comment replies in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getCount(): OfficeExtension.ClientResult; /** * * Returns a comment reply identified by its ID. Read-only. @@ -34711,6 +35164,16 @@ declare namespace Excel { * @param commentReplyId The identifier for the comment reply. */ getItem(commentReplyId: string): Excel.CommentReply; + /** + * + * Gets a comment reply based on its position in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param index Index value of the object to be retrieved. Zero-indexed. + */ + getItemAt(index: number): Excel.CommentReply; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -34745,6 +35208,14 @@ declare namespace Excel { class CommentReply extends OfficeExtension.ClientObject { /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ context: RequestContext; + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content: string; /** * * Represents the comment reply identifier. Read-only. @@ -34761,6 +35232,20 @@ declare namespace Excel { * @beta */ readonly isParent: boolean; + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Excel.CommentReply): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ + set(properties: Interfaces.CommentReplyUpdateData, options?: OfficeExtension.UpdateOptions): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Excel.CommentReply): void; /** * * Deletes the comment reply. @@ -34769,6 +35254,14 @@ declare namespace Excel { * @beta */ delete(): void; + /** + * + * Get its parent comment of this reply. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getParentComment(): Excel.Comment; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -34856,6 +35349,34 @@ declare namespace Excel { * @param base64ImageString A base64 encoded image in JPEG or PNG formats. */ addImage(base64ImageString: string): Excel.Shape; + /** + * + * Adds a line to worksheet. Returns a Shape object that represents the new line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param startLeft The distance, in points, from the start left of the line to the left side of the worksheet. + * @param startTop The distance, in points, from the start top of the line to the top of the worksheet. + * @param endLeft The distance, in points, from the end left of the line to the left of the worksheet. + * @param endTop The distance, in points, from the end top of the line to the top of the worksheet. + * @param connectorType Represents the connector type. See Excel.ConnectorType for details. + */ + addLine(startLeft: number, startTop: number, endLeft: number, endTop: number, connectorType?: Excel.ConnectorType): Excel.Shape; + /** + * + * Adds a line to worksheet. Returns a Shape object that represents the new line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param startLeft The distance, in points, from the start left of the line to the left side of the worksheet. + * @param startTop The distance, in points, from the start top of the line to the top of the worksheet. + * @param endLeft The distance, in points, from the end left of the line to the left of the worksheet. + * @param endTop The distance, in points, from the end top of the line to the top of the worksheet. + * @param connectorType Represents the connector type. See Excel.ConnectorType for details. + */ + addLine(startLeft: number, startTop: number, endLeft: number, endTop: number, connectorType?: "Straight" | "Elbow" | "Curve"): Excel.Shape; /** * * Creates an SVG from a XML string and adds it to worksheet. Returns a Shape object that represents the new Image. @@ -34886,14 +35407,24 @@ declare namespace Excel { getCount(): OfficeExtension.ClientResult; /** * - * Returns a shape identified by the shape id. Read-only. + * Gets a shape using its name. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta * - * @param shapeId The identifier for the shape. + * @param name Name of the shape to be retrieved. */ - getItem(shapeId: string): Excel.Shape; + getItem(name: string): Excel.Shape; + /** + * + * Gets a shape based on its position in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param index Index value of the object to be retrieved. Zero-indexed. + */ + getItemAt(index: number): Excel.Shape; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -34960,6 +35491,30 @@ declare namespace Excel { * @beta */ readonly image: Excel.Image; + /** + * + * Returns the line object for the shape object. Error will be thrown, if the shape object is other shape type (Like, GeometricShape, SmartArt, etc.) rather than Image. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly line: Excel.Line; + /** + * + * Returns the line formatting of the shape object. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly lineFormat: Excel.ShapeLineFormat; + /** + * + * Represents the parent group of the specified shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly parentGroup: Excel.Shape; /** * * Returns the textFrame object of a shape. Read only. @@ -35018,6 +35573,14 @@ declare namespace Excel { * @beta */ left: number; + /** + * + * Represents the level of the specified shape. Level 0 means the shape is not part of any group, level 1 means the shape is part of a top-level group, etc. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly level: number; /** * * Represents if the aspect ratio locked, in boolean, of the shape. @@ -35028,12 +35591,12 @@ declare namespace Excel { lockAspectRatio: boolean; /** * - * Represents the name of the shape. Read-only. + * Represents the name of the shape. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta */ - readonly name: string; + name: string; /** * * Represents the placment, value that represents the way the object is attached to the cells below it. @@ -35066,7 +35629,7 @@ declare namespace Excel { * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta */ - readonly type: Excel.ShapeType | "Unknown" | "Image" | "GeometricShape" | "Group"; + readonly type: Excel.ShapeType | "Unknown" | "Image" | "GeometricShape" | "Group" | "Line"; /** * * Represents the visibility, in boolean, of the specified shape. @@ -35481,14 +36044,24 @@ declare namespace Excel { getCount(): OfficeExtension.ClientResult; /** * - * Returns a shape identified by the shape id. Read-only. + * Gets a shape using its name. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta * - * @param shapeId The identifier for the shape. + * @param name Name of the shape to be retrieved. */ - getItem(shapeId: string): Excel.Shape; + getItem(name: string): Excel.Shape; + /** + * + * Gets a shape based on its position in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param index Index value of the object to be retrieved. Zero-indexed. + */ + getItemAt(index: number): Excel.Shape; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -35513,6 +36086,81 @@ declare namespace Excel { */ toJSON(): Excel.Interfaces.GroupShapeCollectionData; } + /** + * + * Represents a Line object inside a worksheet. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + class Line extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** + * + * Returns the shape object for the line. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly shape: Excel.Shape; + /** + * + * Represents the shape identifier. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly id: string; + /** + * + * Represents the connector type for the line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectorType: Excel.ConnectorType | "Straight" | "Elbow" | "Curve"; + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Excel.Line): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ + set(properties: Interfaces.LineUpdateData, options?: OfficeExtension.UpdateOptions): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Excel.Line): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Excel.Line` - Where option is a comma-delimited string or an array of strings that specify the properties to load. + * + * `load(option?: { select?: string; expand?: string; }): Excel.Line` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Line` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. + */ + load(option?: Excel.Interfaces.LineLoadOptions): Excel.Line; + load(option?: string | string[]): Excel.Line; + load(option?: { + select?: string; + expand?: string; + }): Excel.Line; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Line object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.LineData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Excel.Interfaces.LineData; + } /** * * Represents the fill formatting for a shape object. @@ -35606,6 +36254,105 @@ declare namespace Excel { */ toJSON(): Excel.Interfaces.ShapeFillData; } + /** + * + * Represents the line formatting for the shape object. For picture and geometric shape, line formatting represents the border of shape object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + class ShapeLineFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** + * + * Represents the line color in HTML color format, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + color: string; + /** + * + * Represents the line style of the shape. Returns null when line is not visible or has mixed line dash style property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + dashStyle: Excel.ShapeLineDashStyle | "Dash" | "DashDot" | "DashDotDot" | "LongDash" | "LongDashDot" | "RoundDot" | "Solid" | "SquareDot" | "LongDashDotDot" | "SystemDash" | "SystemDot" | "SystemDashDot"; + /** + * + * Represents the line style of the shape object. Returns null when line is not visible or has mixed line visible property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style: Excel.ShapeLineStyle | "Single" | "ThickBetweenThin" | "ThickThin" | "ThinThick" | "ThinThin"; + /** + * + * Represents the degree of transparency of the specified line as a value from 0.0 (opaque) through 1.0 (clear). Returns null when the shape has mixed line transparency property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + transparency: number; + /** + * + * Represents whether the line formatting of a shape element is visible. Returns null when the shape has mixed line visible property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + visible: boolean; + /** + * + * Represents weight of the line, in points. Returns null when the line is not visible or has mixed line weight property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + weight: number; + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Excel.ShapeLineFormat): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ + set(properties: Interfaces.ShapeLineFormatUpdateData, options?: OfficeExtension.UpdateOptions): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Excel.ShapeLineFormat): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Excel.ShapeLineFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. + * + * `load(option?: { select?: string; expand?: string; }): Excel.ShapeLineFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ShapeLineFormat` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. + */ + load(option?: Excel.Interfaces.ShapeLineFormatLoadOptions): Excel.ShapeLineFormat; + load(option?: string | string[]): Excel.ShapeLineFormat; + load(option?: { + select?: string; + expand?: string; + }): Excel.ShapeLineFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ShapeLineFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ShapeLineFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Excel.Interfaces.ShapeLineFormatData; + } /** * * Represents the text frame for a shape object. @@ -35936,6 +36683,444 @@ declare namespace Excel { */ toJSON(): Excel.Interfaces.ShapeFontData; } + /** + * + * Represents a slicer object in the workbook. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + class Slicer extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** + * + * Represents the collection of SlicerItems that are part of the slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly slicerItems: Excel.SlicerItemCollection; + /** + * + * Represents the worksheet containing the slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly worksheet: Excel.Worksheet; + /** + * + * Represents the caption of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + caption: string; + /** + * + * Represents the height, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + height: number; + /** + * + * Represents the unique id of slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly id: string; + /** + * + * True if all filters currently applied on the slicer is cleared. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly isFilterCleared: boolean; + /** + * + * Represents the distance, in points, from the left side of the slicer to the left of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + left: number; + /** + * + * Represents the name of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name: string; + /** + * + * Represents the name used in the formula. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + nameInFormula: string; + /** + * + * Represents the sort order of the items in the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + sortBy: Excel.SlicerSortType | "DataSourceOrder" | "Ascending" | "Descending"; + /** + * + * Constant value that represents the Slicer style. Possible values are: SlicerStyleLight1 thru SlicerStyleLight6, TableStyleOther1 thru TableStyleOther2, SlicerStyleDark1 thru SlicerStyleDark6. A custom user-defined style present in the workbook can also be specified. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style: string; + /** + * + * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + top: number; + /** + * + * Represents the width, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + width: number; + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Excel.Slicer): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ + set(properties: Interfaces.SlicerUpdateData, options?: OfficeExtension.UpdateOptions): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Excel.Slicer): void; + /** + * + * Clears all the filters currently applied on the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + clearFilters(): void; + /** + * + * Deletes the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + delete(): void; + /** + * + * Returns an array of selected items' names. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getSelectedItems(): OfficeExtension.ClientResult; + /** + * + * Select slicer items based on their names. Previous selection will be cleared. + All items will be deselected if the array is empty. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param items Optional. The specified slicer item names to be selected. + */ + selectItems(items?: string[]): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Excel.Slicer` - Where option is a comma-delimited string or an array of strings that specify the properties to load. + * + * `load(option?: { select?: string; expand?: string; }): Excel.Slicer` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Slicer` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. + */ + load(option?: Excel.Interfaces.SlicerLoadOptions): Excel.Slicer; + load(option?: string | string[]): Excel.Slicer; + load(option?: { + select?: string; + expand?: string; + }): Excel.Slicer; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Slicer object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SlicerData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Excel.Interfaces.SlicerData; + } + /** + * + * Represents a collection of all the slicer objects on the workbook or a worksheet. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + class SlicerCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** Gets the loaded child items in this collection. */ + readonly items: Excel.Slicer[]; + /** + * + * Adds a new slicer to the workbook. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param slicerSource The data source that the new slicer will be based on. It can be a PivotTable object, a Table object or a string. When a PivotTable object is passed, the data source is the source of the PivotTable object. When a Table object is passed, the data source is the Table object. When a string is passed, it is interpreted as the name/id of a PivotTable/Table. + * @param sourceField The field in the data source to filter by. It can be a PivotField object, a TableColumn object, the id of a PivotField or the id/name of TableColumn. + * @param slicerDestination Optional. The worksheet where the new slicer will be created in. It can be a Worksheet object or the name/id of a worksheet. This parameter can be omitted if the slicer collection is retrieved from worksheet. + * @returns The new slicer. + */ + add(slicerSource: string | PivotTable | Table, sourceField: string | PivotField | number | TableColumn, slicerDestination?: string | Worksheet): Excel.Slicer; + /** + * + * Returns the number of slicers in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getCount(): OfficeExtension.ClientResult; + /** + * + * Gets a slicer object using its name or id. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param key The name or id of the slicer. + */ + getItem(key: string): Excel.Slicer; + /** + * + * Gets a slicer based on its position in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param index Index value of the object to be retrieved. Zero-indexed. + */ + getItemAt(index: number): Excel.Slicer; + /** + * + * Gets a slicer using its name or id. If the slicer does not exist, will return a null object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param key Name or Id of the slicer to be retrieved. + */ + getItemOrNullObject(key: string): Excel.Slicer; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Excel.SlicerCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. + * + * `load(option?: { select?: string; expand?: string; }): Excel.SlicerCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.SlicerCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. + */ + load(option?: Excel.Interfaces.SlicerCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.SlicerCollection; + load(option?: string | string[]): Excel.SlicerCollection; + load(option?: OfficeExtension.LoadOption): Excel.SlicerCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.SlicerCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SlicerCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ + toJSON(): Excel.Interfaces.SlicerCollectionData; + } + /** + * + * Represents a slicer item in a slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + class SlicerItem extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** + * + * True if the slicer item has data. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly hasData: boolean; + /** + * + * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isSelected: boolean; + /** + * + * Represents the unique value representing the slicer item. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly key: string; + /** + * + * Represents the value displayed on UI. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly name: string; + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Excel.SlicerItem): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ + set(properties: Interfaces.SlicerItemUpdateData, options?: OfficeExtension.UpdateOptions): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Excel.SlicerItem): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Excel.SlicerItem` - Where option is a comma-delimited string or an array of strings that specify the properties to load. + * + * `load(option?: { select?: string; expand?: string; }): Excel.SlicerItem` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.SlicerItem` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. + */ + load(option?: Excel.Interfaces.SlicerItemLoadOptions): Excel.SlicerItem; + load(option?: string | string[]): Excel.SlicerItem; + load(option?: { + select?: string; + expand?: string; + }): Excel.SlicerItem; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.SlicerItem object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SlicerItemData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Excel.Interfaces.SlicerItemData; + } + /** + * + * Represents a collection of all the slicer item objects on the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + class SlicerItemCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** Gets the loaded child items in this collection. */ + readonly items: Excel.SlicerItem[]; + /** + * + * Returns the number of slicer items in the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getCount(): OfficeExtension.ClientResult; + /** + * + * Gets a slicer item object using its key or name. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param key The key or name of the slicer item. + */ + getItem(key: string): Excel.SlicerItem; + /** + * + * Gets a slicer item based on its position in the collection. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param index Index value of the object to be retrieved. Zero-indexed. + */ + getItemAt(index: number): Excel.SlicerItem; + /** + * + * Gets a slicer item using its key or name. If the slicer item does not exist, will return a null object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param key Key or name of the slicer to be retrieved. + */ + getItemOrNullObject(key: string): Excel.SlicerItem; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Excel.SlicerItemCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. + * + * `load(option?: { select?: string; expand?: string; }): Excel.SlicerItemCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.SlicerItemCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. + */ + load(option?: Excel.Interfaces.SlicerItemCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.SlicerItemCollection; + load(option?: string | string[]): Excel.SlicerItemCollection; + load(option?: OfficeExtension.LoadOption): Excel.SlicerItemCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.SlicerItemCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SlicerItemCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ + toJSON(): Excel.Interfaces.SlicerItemCollectionData; + } /** * [Api set: ExcelApi 1.7] */ @@ -35958,21 +37143,21 @@ declare namespace Excel { * Axis displays data series. * */ - series = "Series", + series = "Series" } /** * [Api set: ExcelApi 1.7] */ enum ChartAxisGroup { primary = "Primary", - secondary = "Secondary", + secondary = "Secondary" } /** * [Api set: ExcelApi 1.7] */ enum ChartAxisScaleType { linear = "Linear", - logarithmic = "Logarithmic", + logarithmic = "Logarithmic" } /** * [Api set: ExcelApi 1.7] @@ -35981,7 +37166,7 @@ declare namespace Excel { automatic = "Automatic", maximum = "Maximum", minimum = "Minimum", - custom = "Custom", + custom = "Custom" } /** * [Api set: ExcelApi 1.7] @@ -35990,7 +37175,7 @@ declare namespace Excel { none = "None", cross = "Cross", inside = "Inside", - outside = "Outside", + outside = "Outside" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -35999,7 +37184,7 @@ declare namespace Excel { enum CalculationState { done = "Done", calculating = "Calculating", - pending = "Pending", + pending = "Pending" } /** * [Api set: ExcelApi 1.7] @@ -36008,7 +37193,7 @@ declare namespace Excel { nextToAxis = "NextToAxis", high = "High", low = "Low", - none = "None", + none = "None" } /** * [Api set: ExcelApi 1.7] @@ -36079,7 +37264,7 @@ declare namespace Excel { * This will set the axis in units of custom value. * */ - custom = "Custom", + custom = "Custom" } /** * @@ -36090,7 +37275,7 @@ declare namespace Excel { enum ChartAxisTimeUnit { days = "Days", months = "Months", - years = "Years", + years = "Years" } /** * @@ -36101,7 +37286,7 @@ declare namespace Excel { */ enum ChartBoxQuartileCalculation { inclusive = "Inclusive", - exclusive = "Exclusive", + exclusive = "Exclusive" } /** * @@ -36127,7 +37312,7 @@ declare namespace Excel { * Axis groups data on a time scale. * */ - dateAxis = "DateAxis", + dateAxis = "DateAxis" } /** * @@ -36140,7 +37325,7 @@ declare namespace Excel { category = "Category", auto = "Auto", binWidth = "BinWidth", - binCount = "BinCount", + binCount = "BinCount" } /** * [Api set: ExcelApi 1.7] @@ -36156,7 +37341,7 @@ declare namespace Excel { grey50 = "Grey50", grey75 = "Grey75", automatic = "Automatic", - roundDot = "RoundDot", + roundDot = "RoundDot" } /** * [Api set: ExcelApi 1.1] @@ -36173,7 +37358,7 @@ declare namespace Excel { top = "Top", bottom = "Bottom", bestFit = "BestFit", - callout = "Callout", + callout = "Callout" } /** * @@ -36185,7 +37370,7 @@ declare namespace Excel { enum ChartErrorBarsInclude { both = "Both", minusValues = "MinusValues", - plusValues = "PlusValues", + plusValues = "PlusValues" } /** * @@ -36199,7 +37384,7 @@ declare namespace Excel { percent = "Percent", stDev = "StDev", stError = "StError", - custom = "Custom", + custom = "Custom" } /** * @@ -36216,7 +37401,7 @@ declare namespace Excel { state = "State", country = "Country", continent = "Continent", - world = "World", + world = "World" } /** * @@ -36227,7 +37412,7 @@ declare namespace Excel { */ enum ChartGradientStyle { twoPhaseColor = "TwoPhaseColor", - threePhaseColor = "ThreePhaseColor", + threePhaseColor = "ThreePhaseColor" } /** * @@ -36239,7 +37424,7 @@ declare namespace Excel { enum ChartGradientStyleType { extremeValue = "ExtremeValue", number = "Number", - percent = "Percent", + percent = "Percent" } /** * @@ -36252,7 +37437,7 @@ declare namespace Excel { top = "Top", bottom = "Bottom", left = "Left", - right = "Right", + right = "Right" } /** * [Api set: ExcelApi 1.1] @@ -36264,7 +37449,7 @@ declare namespace Excel { left = "Left", right = "Right", corner = "Corner", - custom = "Custom", + custom = "Custom" } /** * [Api set: ExcelApi 1.7] @@ -36282,14 +37467,14 @@ declare namespace Excel { dash = "Dash", circle = "Circle", plus = "Plus", - picture = "Picture", + picture = "Picture" } /** * [Api set: ExcelApi 1.8] */ enum ChartPlotAreaPosition { automatic = "Automatic", - custom = "Custom", + custom = "Custom" } /** * @@ -36301,7 +37486,7 @@ declare namespace Excel { enum ChartMapLabelStrategy { none = "None", bestFit = "BestFit", - showAll = "ShowAll", + showAll = "ShowAll" } /** * @@ -36315,7 +37500,7 @@ declare namespace Excel { mercator = "Mercator", miller = "Miller", robinson = "Robinson", - albers = "Albers", + albers = "Albers" } /** * @@ -36327,7 +37512,7 @@ declare namespace Excel { enum ChartParentLabelStrategy { none = "None", banner = "Banner", - overlapping = "Overlapping", + overlapping = "Overlapping" } /** * @@ -36343,7 +37528,7 @@ declare namespace Excel { */ auto = "Auto", columns = "Columns", - rows = "Rows", + rows = "Rows" } /** * @@ -36356,7 +37541,7 @@ declare namespace Excel { left = "Left", right = "Right", justify = "Justify", - distributed = "Distributed", + distributed = "Distributed" } /** * @@ -36369,7 +37554,7 @@ declare namespace Excel { bottom = "Bottom", top = "Top", justify = "Justify", - distributed = "Distributed", + distributed = "Distributed" } /** * [Api set: ExcelApi 1.8] @@ -36377,7 +37562,7 @@ declare namespace Excel { enum ChartTickLabelAlignment { center = "Center", left = "Left", - right = "Right", + right = "Right" } /** * [Api set: ExcelApi 1.1] @@ -36464,14 +37649,14 @@ declare namespace Excel { treemap = "Treemap", waterfall = "Waterfall", sunburst = "Sunburst", - funnel = "Funnel", + funnel = "Funnel" } /** * [Api set: ExcelApi 1.1] */ enum ChartUnderlineStyle { none = "None", - single = "Single", + single = "Single" } /** * [Api set: ExcelApi 1.8] @@ -36479,14 +37664,14 @@ declare namespace Excel { enum ChartDisplayBlanksAs { notPlotted = "NotPlotted", zero = "Zero", - interplotted = "Interplotted", + interplotted = "Interplotted" } /** * [Api set: ExcelApi 1.8] */ enum ChartPlotBy { rows = "Rows", - columns = "Columns", + columns = "Columns" } /** * [Api set: ExcelApi 1.8] @@ -36495,7 +37680,7 @@ declare namespace Excel { splitByPosition = "SplitByPosition", splitByValue = "SplitByValue", splitByPercentValue = "SplitByPercentValue", - splitByCustomSplit = "SplitByCustomSplit", + splitByCustomSplit = "SplitByCustomSplit" } /** * [Api set: ExcelApi 1.8] @@ -36517,7 +37702,7 @@ declare namespace Excel { monochromaticPalette10 = "MonochromaticPalette10", monochromaticPalette11 = "MonochromaticPalette11", monochromaticPalette12 = "MonochromaticPalette12", - monochromaticPalette13 = "MonochromaticPalette13", + monochromaticPalette13 = "MonochromaticPalette13" } /** * [Api set: ExcelApi 1.7] @@ -36528,7 +37713,7 @@ declare namespace Excel { logarithmic = "Logarithmic", movingAverage = "MovingAverage", polynomial = "Polynomial", - power = "Power", + power = "Power" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -36538,7 +37723,7 @@ declare namespace Excel { bringToFront = "BringToFront", bringForward = "BringForward", sendToBack = "SendToBack", - sendBackward = "SendBackward", + sendBackward = "SendBackward" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -36549,6 +37734,7 @@ declare namespace Excel { image = "Image", geometricShape = "GeometricShape", group = "Group", + line = "Line" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -36556,7 +37742,7 @@ declare namespace Excel { */ enum ShapeScaleType { currentSize = "CurrentSize", - originalSize = "OriginalSize", + originalSize = "OriginalSize" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -36565,7 +37751,7 @@ declare namespace Excel { enum ShapeScaleFrom { scaleFromTopLeft = "ScaleFromTopLeft", scaleFromMiddle = "ScaleFromMiddle", - scaleFromBottomRight = "ScaleFromBottomRight", + scaleFromBottomRight = "ScaleFromBottomRight" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -36577,7 +37763,7 @@ declare namespace Excel { gradient = "Gradient", pattern = "Pattern", pictureAndTexture = "PictureAndTexture", - mixed = "Mixed", + mixed = "Mixed" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -36600,7 +37786,7 @@ declare namespace Excel { dotDotDashHeavy = "DotDotDashHeavy", wavy = "Wavy", wavyHeavy = "WavyHeavy", - wavyDouble = "WavyDouble", + wavyDouble = "WavyDouble" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -36612,7 +37798,36 @@ declare namespace Excel { jpeg = "JPEG", gif = "GIF", png = "PNG", - svg = "SVG", + svg = "SVG" + } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum ShapeLineStyle { + single = "Single", + thickBetweenThin = "ThickBetweenThin", + thickThin = "ThickThin", + thinThick = "ThinThick", + thinThin = "ThinThin" + } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum ShapeLineDashStyle { + dash = "Dash", + dashDot = "DashDot", + dashDotDot = "DashDotDot", + longDash = "LongDash", + longDashDot = "LongDashDot", + roundDot = "RoundDot", + solid = "Solid", + squareDot = "SquareDot", + longDashDotDot = "LongDashDotDot", + systemDash = "SystemDash", + systemDot = "SystemDot", + systemDashDot = "SystemDashDot" } /** * [Api set: ExcelApi 1.1] @@ -36620,7 +37835,7 @@ declare namespace Excel { enum BindingType { range = "Range", table = "Table", - text = "Text", + text = "Text" } /** * [Api set: ExcelApi 1.1] @@ -36633,7 +37848,7 @@ declare namespace Excel { insideVertical = "InsideVertical", insideHorizontal = "InsideHorizontal", diagonalDown = "DiagonalDown", - diagonalUp = "DiagonalUp", + diagonalUp = "DiagonalUp" } /** * [Api set: ExcelApi 1.1] @@ -36646,7 +37861,7 @@ declare namespace Excel { dashDotDot = "DashDotDot", dot = "Dot", double = "Double", - slantDashDot = "SlantDashDot", + slantDashDot = "SlantDashDot" } /** * [Api set: ExcelApi 1.1] @@ -36655,15 +37870,30 @@ declare namespace Excel { hairline = "Hairline", thin = "Thin", medium = "Medium", - thick = "Thick", + thick = "Thick" } /** * [Api set: ExcelApi 1.1] */ enum CalculationMode { + /** + * + * The default recalculation behavior where Excel calculates new formula results every time the relevant data is changed. + * + */ automatic = "Automatic", + /** + * + * Calculates new formula results every time the relevant data is changed, unless the formula is in a data table. + * + */ automaticExceptTables = "AutomaticExceptTables", - manual = "Manual", + /** + * + * Calculations only occur when the user or add-in requests them. + * + */ + manual = "Manual" } /** * [Api set: ExcelApi 1.1] @@ -36686,7 +37916,7 @@ declare namespace Excel { * This will rebuild the full dependency chain, mark all cells as dirty and then recalculate them. * */ - fullRebuild = "FullRebuild", + fullRebuild = "FullRebuild" } /** * [Api set: ExcelApi 1.1 for All/Formats/Contents, 1.7 for Hyperlinks & HyperlinksAndFormats.] @@ -36716,7 +37946,7 @@ declare namespace Excel { * Removes hyperlinks and formatting for the cell but leaves content, conditional formats, and data validation intact. * */ - removeHyperlinks = "RemoveHyperlinks", + removeHyperlinks = "RemoveHyperlinks" } /** * @@ -36727,7 +37957,7 @@ declare namespace Excel { enum ConditionalDataBarAxisFormat { automatic = "Automatic", none = "None", - cellMidPoint = "CellMidPoint", + cellMidPoint = "CellMidPoint" } /** * @@ -36738,7 +37968,7 @@ declare namespace Excel { enum ConditionalDataBarDirection { context = "Context", leftToRight = "LeftToRight", - rightToLeft = "RightToLeft", + rightToLeft = "RightToLeft" } /** * @@ -36748,7 +37978,7 @@ declare namespace Excel { */ enum ConditionalFormatDirection { top = "Top", - bottom = "Bottom", + bottom = "Bottom" } /** * [Api set: ExcelApi 1.6] @@ -36761,7 +37991,7 @@ declare namespace Excel { topBottom = "TopBottom", presetCriteria = "PresetCriteria", containsText = "ContainsText", - cellValue = "CellValue", + cellValue = "CellValue" } /** * @@ -36777,7 +38007,7 @@ declare namespace Excel { number = "Number", percent = "Percent", formula = "Formula", - percentile = "Percentile", + percentile = "Percentile" } /** * @@ -36790,7 +38020,7 @@ declare namespace Excel { number = "Number", percent = "Percent", formula = "Formula", - percentile = "Percentile", + percentile = "Percentile" } /** * @@ -36805,7 +38035,7 @@ declare namespace Excel { number = "Number", percent = "Percent", formula = "Formula", - percentile = "Percentile", + percentile = "Percentile" } /** * @@ -36818,7 +38048,7 @@ declare namespace Excel { topItems = "TopItems", topPercent = "TopPercent", bottomItems = "BottomItems", - bottomPercent = "BottomPercent", + bottomPercent = "BottomPercent" } /** * @@ -36853,7 +38083,7 @@ declare namespace Excel { threeStdDevAboveAverage = "ThreeStdDevAboveAverage", threeStdDevBelowAverage = "ThreeStdDevBelowAverage", uniqueValues = "UniqueValues", - duplicateValues = "DuplicateValues", + duplicateValues = "DuplicateValues" } /** * @@ -36866,7 +38096,7 @@ declare namespace Excel { contains = "Contains", notContains = "NotContains", beginsWith = "BeginsWith", - endsWith = "EndsWith", + endsWith = "EndsWith" } /** * @@ -36883,7 +38113,7 @@ declare namespace Excel { greaterThan = "GreaterThan", lessThan = "LessThan", greaterThanOrEqual = "GreaterThanOrEqual", - lessThanOrEqual = "LessThanOrEqual", + lessThanOrEqual = "LessThanOrEqual" } /** * @@ -36894,7 +38124,7 @@ declare namespace Excel { enum ConditionalIconCriterionOperator { invalid = "Invalid", greaterThan = "GreaterThan", - greaterThanOrEqual = "GreaterThanOrEqual", + greaterThanOrEqual = "GreaterThanOrEqual" } /** * [Api set: ExcelApi 1.6] @@ -36903,7 +38133,7 @@ declare namespace Excel { edgeTop = "EdgeTop", edgeBottom = "EdgeBottom", edgeLeft = "EdgeLeft", - edgeRight = "EdgeRight", + edgeRight = "EdgeRight" } /** * [Api set: ExcelApi 1.6] @@ -36914,7 +38144,7 @@ declare namespace Excel { dash = "Dash", dashDot = "DashDot", dashDotDot = "DashDotDot", - dot = "Dot", + dot = "Dot" } /** * [Api set: ExcelApi 1.6] @@ -36922,7 +38152,7 @@ declare namespace Excel { enum ConditionalRangeFontUnderlineStyle { none = "None", single = "Single", - double = "Double", + double = "Double" } /** * [Api set: CustomFunctions 1.1] @@ -36931,7 +38161,7 @@ declare namespace Excel { enum CustomFunctionType { invalid = "Invalid", script = "Script", - webService = "WebService", + webService = "WebService" } /** * [Api set: CustomFunctions 1.1] @@ -36939,7 +38169,7 @@ declare namespace Excel { */ enum CustomFunctionMetadataFormat { invalid = "Invalid", - openApi = "OpenApi", + openApi = "OpenApi" } /** * @@ -37007,7 +38237,7 @@ declare namespace Excel { * MixedCriteria means that the range has data validation present on some but not all cells * */ - mixedCriteria = "MixedCriteria", + mixedCriteria = "MixedCriteria" } /** * @@ -37023,7 +38253,7 @@ declare namespace Excel { greaterThan = "GreaterThan", lessThan = "LessThan", greaterThanOrEqualTo = "GreaterThanOrEqualTo", - lessThanOrEqualTo = "LessThanOrEqualTo", + lessThanOrEqualTo = "LessThanOrEqualTo" } /** * @@ -37034,14 +38264,14 @@ declare namespace Excel { enum DataValidationAlertStyle { stop = "Stop", warning = "Warning", - information = "Information", + information = "Information" } /** * [Api set: ExcelApi 1.1] */ enum DeleteShiftDirection { up = "Up", - left = "Left", + left = "Left" } /** * [Api set: ExcelApi 1.2] @@ -37081,7 +38311,7 @@ declare namespace Excel { today = "Today", tomorrow = "Tomorrow", yearToDate = "YearToDate", - yesterday = "Yesterday", + yesterday = "Yesterday" } /** * [Api set: ExcelApi 1.2] @@ -37092,7 +38322,7 @@ declare namespace Excel { day = "Day", hour = "Hour", minute = "Minute", - second = "Second", + second = "Second" } /** * [Api set: ExcelApi 1.2] @@ -37107,14 +38337,14 @@ declare namespace Excel { topItems = "TopItems", topPercent = "TopPercent", icon = "Icon", - custom = "Custom", + custom = "Custom" } /** * [Api set: ExcelApi 1.2] */ enum FilterOperator { and = "And", - or = "Or", + or = "Or" } /** * [Api set: ExcelApi 1.1] @@ -37127,7 +38357,7 @@ declare namespace Excel { fill = "Fill", justify = "Justify", centerAcrossSelection = "CenterAcrossSelection", - distributed = "Distributed", + distributed = "Distributed" } /** * [Api set: ExcelApi 1.2] @@ -37155,7 +38385,7 @@ declare namespace Excel { threeTriangles = "ThreeTriangles", fiveBoxes = "FiveBoxes", linkedEntityFinanceIcon = "LinkedEntityFinanceIcon", - linkedEntityMapIcon = "LinkedEntityMapIcon", + linkedEntityMapIcon = "LinkedEntityMapIcon" } /** * [Api set: ExcelApi 1.2] @@ -37163,21 +38393,21 @@ declare namespace Excel { enum ImageFittingMode { fit = "Fit", fitAndCenter = "FitAndCenter", - fill = "Fill", + fill = "Fill" } /** * [Api set: ExcelApi 1.1] */ enum InsertShiftDirection { down = "Down", - right = "Right", + right = "Right" } /** * [Api set: ExcelApi 1.4] */ enum NamedItemScope { worksheet = "Worksheet", - workbook = "Workbook", + workbook = "Workbook" } /** * [Api set: ExcelApi 1.1 for String,Integer,Double,Boolean,Range,Error; 1.7 for Array] @@ -37189,7 +38419,7 @@ declare namespace Excel { boolean = "Boolean", range = "Range", error = "Error", - array = "Array", + array = "Array" } /** * [Api set: ExcelApi 1.1] @@ -37199,7 +38429,7 @@ declare namespace Excel { single = "Single", double = "Double", singleAccountant = "SingleAccountant", - doubleAccountant = "DoubleAccountant", + doubleAccountant = "DoubleAccountant" } /** * [Api set: ExcelApi 1.1] @@ -37207,7 +38437,7 @@ declare namespace Excel { enum SheetVisibility { visible = "Visible", hidden = "Hidden", - veryHidden = "VeryHidden", + veryHidden = "VeryHidden" } /** * [Api set: ExcelApi 1.1 for Unknown, Empty, String, Integer, Double, Boolean, Error. 1.7 for RichValue] @@ -37220,7 +38450,7 @@ declare namespace Excel { double = "Double", boolean = "Boolean", error = "Error", - richValue = "RichValue", + richValue = "RichValue" } /** * @@ -37241,14 +38471,14 @@ declare namespace Excel { * Search in reverse order. * */ - backwards = "Backwards", + backwards = "Backwards" } /** * [Api set: ExcelApi 1.2] */ enum SortOrientation { rows = "Rows", - columns = "Columns", + columns = "Columns" } /** * [Api set: ExcelApi 1.2] @@ -37257,21 +38487,21 @@ declare namespace Excel { value = "Value", cellColor = "CellColor", fontColor = "FontColor", - icon = "Icon", + icon = "Icon" } /** * [Api set: ExcelApi 1.2] */ enum SortDataOption { normal = "Normal", - textAsNumber = "TextAsNumber", + textAsNumber = "TextAsNumber" } /** * [Api set: ExcelApi 1.2] */ enum SortMethod { pinYin = "PinYin", - strokeCount = "StrokeCount", + strokeCount = "StrokeCount" } /** * [Api set: ExcelApi 1.1] @@ -37281,7 +38511,7 @@ declare namespace Excel { center = "Center", bottom = "Bottom", justify = "Justify", - distributed = "Distributed", + distributed = "Distributed" } /** * [Api set: ExcelApi 1.7] @@ -37291,7 +38521,7 @@ declare namespace Excel { boolean = "Boolean", date = "Date", string = "String", - float = "Float", + float = "Float" } /** * [Api set: ExcelApi 1.7] @@ -37308,7 +38538,7 @@ declare namespace Excel { * Remote means event comes from remote user session. * */ - remote = "Remote", + remote = "Remote" } /** * [Api set: ExcelApi 1.7] @@ -37361,7 +38591,7 @@ declare namespace Excel { * CellDeleted represents the data change event is triggered by deleting cells. * */ - cellDeleted = "CellDeleted", + cellDeleted = "CellDeleted" } /** * [Api set: ExcelApi 1.7] @@ -37511,6 +38741,7 @@ declare namespace Excel { * */ worksheetFormatChanged = "WorksheetFormatChanged", + wacoperationEvent = "WACOperationEvent" } /** * [Api set: ExcelApi 1.7] @@ -37531,7 +38762,7 @@ declare namespace Excel { category = "Category", format = "Format", manager = "Manager", - company = "Company", + company = "Company" } /** * [Api set: ExcelApi 1.8] @@ -37554,7 +38785,7 @@ declare namespace Excel { * Subtotals are off. * */ - off = "Off", + off = "Off" } /** * [Api set: ExcelApi 1.8] @@ -37577,7 +38808,7 @@ declare namespace Excel { * Inner fields' items are on same row as outer fields' items and subtotals are always on the bottom. * */ - outline = "Outline", + outline = "Outline" } /** * [Api set: ExcelApi 1.7] @@ -37600,14 +38831,14 @@ declare namespace Excel { * Selection is not allowed for all cells. * */ - none = "None", + none = "None" } /** * [Api set: ExcelApi 1.7] */ enum PageOrientation { portrait = "Portrait", - landscape = "Landscape", + landscape = "Landscape" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37654,7 +38885,7 @@ declare namespace Excel { envelopePersonal = "EnvelopePersonal", fanfoldUS = "FanfoldUS", fanfoldStdGerman = "FanfoldStdGerman", - fanfoldLegalGerman = "FanfoldLegalGerman", + fanfoldLegalGerman = "FanfoldLegalGerman" } /** * [Api set: ExcelApi 1.7] @@ -37679,7 +38910,7 @@ declare namespace Excel { * Right to left reading order * */ - rightToLeft = "RightToLeft", + rightToLeft = "RightToLeft" } /** * [Api set: ExcelApi 1.7] @@ -37736,7 +38967,7 @@ declare namespace Excel { accent6_20 = "Accent6_20", accent6_40 = "Accent6_40", accent6_60 = "Accent6_60", - explanatoryText = "ExplanatoryText", + explanatoryText = "ExplanatoryText" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37746,7 +38977,7 @@ declare namespace Excel { asDisplayed = "AsDisplayed", blank = "Blank", dash = "Dash", - notAvailable = "NotAvailable", + notAvailable = "NotAvailable" } /** * [Api set: ExcelApi 1.7] @@ -37756,7 +38987,7 @@ declare namespace Excel { before = "Before", after = "After", beginning = "Beginning", - end = "End", + end = "End" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37780,7 +39011,7 @@ declare namespace Excel { * Comments will be printed where they were inserted in the worksheet. * */ - inPlace = "InPlace", + inPlace = "InPlace" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37798,7 +39029,7 @@ declare namespace Excel { * Process across pages or page fields to the right before moving down the rows. * */ - overThenDown = "OverThenDown", + overThenDown = "OverThenDown" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37822,7 +39053,7 @@ declare namespace Excel { * Assign the page margins in centimeters. * */ - centimeters = "Centimeters", + centimeters = "Centimeters" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37852,7 +39083,25 @@ declare namespace Excel { * There is a separate first page header/footer, then there is a separate header/footer for odd and even pages. * */ - firstOddAndEven = "FirstOddAndEven", + firstOddAndEven = "FirstOddAndEven" + } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum AutoFillType { + fillDefault = "FillDefault", + fillCopy = "FillCopy", + fillSeries = "FillSeries", + fillFormats = "FillFormats", + fillValues = "FillValues", + fillDays = "FillDays", + fillWeekdays = "FillWeekdays", + fillMonths = "FillMonths", + fillYears = "FillYears", + linearTrend = "LinearTrend", + growthTrend = "GrowthTrend", + flashFill = "FlashFill" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37862,7 +39111,7 @@ declare namespace Excel { all = "All", formulas = "Formulas", values = "Values", - formats = "Formats", + formats = "Formats" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -37873,7 +39122,7 @@ declare namespace Excel { validLinkedData = "ValidLinkedData", disambiguationNeeded = "DisambiguationNeeded", brokenLinkedData = "BrokenLinkedData", - fetchingData = "FetchingData", + fetchingData = "FetchingData" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38056,7 +39305,16 @@ declare namespace Excel { plaqueTabs = "PlaqueTabs", chartX = "ChartX", chartStar = "ChartStar", - chartPlus = "ChartPlus", + chartPlus = "ChartPlus" + } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum ConnectorType { + straight = "Straight", + elbow = "Elbow", + curve = "Curve" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38068,7 +39326,7 @@ declare namespace Excel { * Indicates plain format type of the comment content. * */ - plain = "Plain", + plain = "Plain" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38128,7 +39386,7 @@ declare namespace Excel { * Cells that are visible. * */ - visible = "Visible", + visible = "Visible" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38224,7 +39482,7 @@ declare namespace Excel { * Cells that have a string value. * */ - text = "Text", + text = "Text" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38233,7 +39491,7 @@ declare namespace Excel { enum Placement { twoCell = "TwoCell", oneCell = "OneCell", - absolute = "Absolute", + absolute = "Absolute" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38260,7 +39518,7 @@ declare namespace Excel { gray16 = "Gray16", gray8 = "Gray8", linearGradient = "LinearGradient", - rectangularGradient = "RectangularGradient", + rectangularGradient = "RectangularGradient" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38274,7 +39532,7 @@ declare namespace Excel { justifyLow = "JustifyLow", distributed = "Distributed", thaiDistributed = "ThaiDistributed", - shapeTextHorizontalAlignType_MaxEnumIDs = "ShapeTextHorizontalAlignType_MaxEnumIDs", + shapeTextHorizontalAlignType_MaxEnumIDs = "ShapeTextHorizontalAlignType_MaxEnumIDs" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38286,7 +39544,7 @@ declare namespace Excel { bottom = "Bottom", justified = "Justified", distributed = "Distributed", - shapeTextVerticalAlignType_MaxEnumIDs = "ShapeTextVerticalAlignType_MaxEnumIDs", + shapeTextVerticalAlignType_MaxEnumIDs = "ShapeTextVerticalAlignType_MaxEnumIDs" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38296,7 +39554,7 @@ declare namespace Excel { overflow = "Overflow", ellipsis = "Ellipsis", clip = "Clip", - shapeTextVertOverflowType_MaxEnumIDs = "ShapeTextVertOverflowType_MaxEnumIDs", + shapeTextVertOverflowType_MaxEnumIDs = "ShapeTextVertOverflowType_MaxEnumIDs" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38305,7 +39563,7 @@ declare namespace Excel { enum ShapeTextHorzOverflowType { overflow = "Overflow", clip = "Clip", - shapeTextHorzOverflowType_MaxEnumIDs = "ShapeTextHorzOverflowType_MaxEnumIDs", + shapeTextHorzOverflowType_MaxEnumIDs = "ShapeTextHorzOverflowType_MaxEnumIDs" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38313,7 +39571,7 @@ declare namespace Excel { */ enum ShapeTextReadingOrder { ltr = "LTR", - rtl = "RTL", + rtl = "RTL" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38327,7 +39585,7 @@ declare namespace Excel { eastAsianVertical = "EastAsianVertical", mongolianVertical = "MongolianVertical", wordArtVerticalRTL = "WordArtVerticalRTL", - shapeTextOrientationType_MaxEnumIDs = "ShapeTextOrientationType_MaxEnumIDs", + shapeTextOrientationType_MaxEnumIDs = "ShapeTextOrientationType_MaxEnumIDs" } /** * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38337,7 +39595,7 @@ declare namespace Excel { autoSizeNone = "AutoSizeNone", autoSizeTextToFitShape = "AutoSizeTextToFitShape", autoSizeShapeToFitText = "AutoSizeShapeToFitText", - autoSizeMixed = "AutoSizeMixed", + autoSizeMixed = "AutoSizeMixed" } /** * @@ -38358,7 +39616,7 @@ declare namespace Excel { * Discard the possible changes when closing the workbook. * */ - skipSave = "SkipSave", + skipSave = "SkipSave" } /** * @@ -38381,7 +39639,16 @@ declare namespace Excel { Ignored if the workbook was previously saved. * */ - prompt = "Prompt", + prompt = "Prompt" + } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum SlicerSortType { + dataSourceOrder = "DataSourceOrder", + ascending = "Ascending", + descending = "Descending" } /** * @@ -42202,7 +43469,7 @@ declare namespace Excel { nonBlankCellOffSheet = "NonBlankCellOffSheet", notImplemented = "NotImplemented", unsupportedOperation = "UnsupportedOperation", - invalidOperationInCellEditMode = "InvalidOperationInCellEditMode", + invalidOperationInCellEditMode = "InvalidOperationInCellEditMode" } module Interfaces { /** @@ -42222,7 +43489,7 @@ declare namespace Excel { interface RuntimeUpdateData { /** * - * Turn on/off JavaScript events in current taskpane or content add-in. + * Toggle JavaScript events in the current task pane or content add-in. * * [Api set: ExcelApi 1.8] */ @@ -42744,7 +44011,7 @@ declare namespace Excel { prompt?: Excel.DataValidationPrompt; /** * - * Data Validation rule that contains different type of data validation criteria. + * Data validation rule that contains different type of data validation criteria. * * [Api set: ExcelApi 1.8] */ @@ -42898,7 +44165,7 @@ declare namespace Excel { interface RangeFillUpdateData { /** * - * HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") + * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") * * [Api set: ExcelApi 1.1] */ @@ -43121,7 +44388,7 @@ declare namespace Excel { plotArea?: Excel.Interfaces.ChartPlotAreaUpdateData; /** * - * Represents the title of the specified chart, including the text, visibility, position, and formating of the title. + * Represents the title of the specified chart, including the text, visibility, position, and formatting of the title. * * [Api set: ExcelApi 1.1] */ @@ -43200,7 +44467,7 @@ declare namespace Excel { showAllFieldButtons?: boolean; /** * - * Represents whether to to show the data labels when the value is greater than the maximum value on the value axis. + * Represents whether to show the data labels when the value is greater than the maximum value on the value axis. If value axis became smaller than the size of data points, you can use this property to set whether to show the data labels. This property applies to 2-D charts only. * @@ -43556,7 +44823,7 @@ declare namespace Excel { name?: string; /** * - * Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. + * Specifies how bars and columns are positioned. Can be a value between –100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -44026,7 +45293,7 @@ declare namespace Excel { format?: Excel.Interfaces.ChartDataLabelFormatUpdateData; /** * - * Represents whether data labels automatically generates appropriate text based on context. + * Represents whether data labels automatically generate appropriate text based on context. * * [Api set: ExcelApi 1.8] */ @@ -45080,6 +46347,14 @@ declare namespace Excel { } /** An interface for updating data on the PivotTable object, for use in "pivotTable.set({ ... })". */ interface PivotTableUpdateData { + /** + * + * True if the PivotTable should use custom lists when sorting. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enableDataValueEditing?: boolean; /** * * Name of the PivotTable. @@ -45098,6 +46373,14 @@ declare namespace Excel { } /** An interface for updating data on the PivotLayout object, for use in "pivotLayout.set({ ... })". */ interface PivotLayoutUpdateData { + /** + * + * True if formatting will be automatically formatted when it’s refreshed or when fields are moved + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + autoFormat?: boolean; /** * * True if the field list should be shown or hidden from the UI. @@ -45113,6 +46396,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ layoutType?: Excel.PivotLayoutType | "Compact" | "Tabular" | "Outline"; + /** + * + * True if formatting is preserved when the report is refreshed or recalculated by operations such as pivoting, sorting, or changing page field items. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + preserveFormatting?: boolean; /** * * True if the PivotTable report shows grand totals for columns. @@ -45234,7 +46525,7 @@ declare namespace Excel { position?: number; /** * - * Determines whether the data should be sown as a specific summary calculation or not. + * Determines whether the data should be shown as a specific summary calculation or not. * * [Api set: ExcelApi 1.8] */ @@ -46367,10 +47658,32 @@ declare namespace Excel { interface CommentCollectionUpdateData { items?: Excel.Interfaces.CommentData[]; } + /** An interface for updating data on the Comment object, for use in "comment.set({ ... })". */ + interface CommentUpdateData { + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: string; + } /** An interface for updating data on the CommentReplyCollection object, for use in "commentReplyCollection.set({ ... })". */ interface CommentReplyCollectionUpdateData { items?: Excel.Interfaces.CommentReplyData[]; } + /** An interface for updating data on the CommentReply object, for use in "commentReply.set({ ... })". */ + interface CommentReplyUpdateData { + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: string; + } /** An interface for updating data on the ShapeCollection object, for use in "shapeCollection.set({ ... })". */ interface ShapeCollectionUpdateData { items?: Excel.Interfaces.ShapeData[]; @@ -46385,6 +47698,14 @@ declare namespace Excel { * @beta */ fill?: Excel.Interfaces.ShapeFillUpdateData; + /** + * + * Returns the line formatting of the shape object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + lineFormat?: Excel.Interfaces.ShapeLineFormatUpdateData; /** * * Returns or sets the alternative descriptive text string for a Shape object when the object is saved to a Web page. @@ -46435,6 +47756,14 @@ declare namespace Excel { * @beta */ lockAspectRatio?: boolean; + /** + * + * Represents the name of the shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: string; /** * * Represents the placment, value that represents the way the object is attached to the cells below it. @@ -46482,6 +47811,17 @@ declare namespace Excel { interface GroupShapeCollectionUpdateData { items?: Excel.Interfaces.ShapeData[]; } + /** An interface for updating data on the Line object, for use in "line.set({ ... })". */ + interface LineUpdateData { + /** + * + * Represents the connector type for the line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectorType?: Excel.ConnectorType | "Straight" | "Elbow" | "Curve"; + } /** An interface for updating data on the ShapeFill object, for use in "shapeFill.set({ ... })". */ interface ShapeFillUpdateData { /** @@ -46501,6 +47841,57 @@ declare namespace Excel { */ transparency?: number; } + /** An interface for updating data on the ShapeLineFormat object, for use in "shapeLineFormat.set({ ... })". */ + interface ShapeLineFormatUpdateData { + /** + * + * Represents the line color in HTML color format, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: string; + /** + * + * Represents the line style of the shape. Returns null when line is not visible or has mixed line dash style property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + dashStyle?: Excel.ShapeLineDashStyle | "Dash" | "DashDot" | "DashDotDot" | "LongDash" | "LongDashDot" | "RoundDot" | "Solid" | "SquareDot" | "LongDashDotDot" | "SystemDash" | "SystemDot" | "SystemDashDot"; + /** + * + * Represents the line style of the shape object. Returns null when line is not visible or has mixed line visible property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style?: Excel.ShapeLineStyle | "Single" | "ThickBetweenThin" | "ThickThin" | "ThinThick" | "ThinThin"; + /** + * + * Represents the degree of transparency of the specified line as a value from 0.0 (opaque) through 1.0 (clear). Returns null when the shape has mixed line transparency property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + transparency?: number; + /** + * + * Represents whether the line formatting of a shape element is visible. Returns null when the shape has mixed line visible property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + visible?: boolean; + /** + * + * Represents weight of the line, in points. Returns null when the line is not visible or has mixed line weight property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + weight?: number; + } /** An interface for updating data on the TextFrame object, for use in "textFrame.set({ ... })". */ interface TextFrameUpdateData { /** @@ -46662,11 +48053,117 @@ declare namespace Excel { */ underline?: Excel.ShapeFontUnderlineStyle | "None" | "Single" | "Double" | "Heavy" | "Dotted" | "DottedHeavy" | "Dash" | "DashHeavy" | "DashLong" | "DashLongHeavy" | "DotDash" | "DotDashHeavy" | "DotDotDash" | "DotDotDashHeavy" | "Wavy" | "WavyHeavy" | "WavyDouble"; } + /** An interface for updating data on the Slicer object, for use in "slicer.set({ ... })". */ + interface SlicerUpdateData { + /** + * + * Represents the worksheet containing the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + worksheet?: Excel.Interfaces.WorksheetUpdateData; + /** + * + * Represents the caption of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + caption?: string; + /** + * + * Represents the height, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + height?: number; + /** + * + * Represents the distance, in points, from the left side of the slicer to the left of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + left?: number; + /** + * + * Represents the name of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: string; + /** + * + * Represents the name used in the formula. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + nameInFormula?: string; + /** + * + * Represents the sort order of the items in the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + sortBy?: Excel.SlicerSortType | "DataSourceOrder" | "Ascending" | "Descending"; + /** + * + * Constant value that represents the Slicer style. Possible values are: SlicerStyleLight1 thru SlicerStyleLight6, TableStyleOther1 thru TableStyleOther2, SlicerStyleDark1 thru SlicerStyleDark6. A custom user-defined style present in the workbook can also be specified. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style?: string; + /** + * + * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + top?: number; + /** + * + * Represents the width, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + width?: number; + } + /** An interface for updating data on the SlicerCollection object, for use in "slicerCollection.set({ ... })". */ + interface SlicerCollectionUpdateData { + items?: Excel.Interfaces.SlicerData[]; + } + /** An interface for updating data on the SlicerItem object, for use in "slicerItem.set({ ... })". */ + interface SlicerItemUpdateData { + /** + * + * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isSelected?: boolean; + } + /** An interface for updating data on the SlicerItemCollection object, for use in "slicerItemCollection.set({ ... })". */ + interface SlicerItemCollectionUpdateData { + items?: Excel.Interfaces.SlicerItemData[]; + } /** An interface describing the data returned by calling "runtime.toJSON()". */ interface RuntimeData { /** * - * Turn on/off JavaScript events in current taskpane or content add-in. + * Toggle JavaScript events in the current task pane or content add-in. * * [Api set: ExcelApi 1.8] */ @@ -46796,6 +48293,14 @@ declare namespace Excel { settings?: Excel.Interfaces.SettingData[]; /** * + * Represents a collection of Slicers associated with the workbook. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + slicers?: Excel.Interfaces.SlicerData[]; + /** + * * Represents a collection of styles associated with the workbook. Read-only. * * [Api set: ExcelApi 1.7] @@ -46921,6 +48426,14 @@ declare namespace Excel { charts?: Excel.Interfaces.ChartData[]; /** * + * Returns a collection of all the Comments objects on the worksheet. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + comments?: Excel.Interfaces.CommentData[]; + /** + * * Gets the horizontal page break collection for the worksheet. This collection only contains manual page breaks. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -46966,6 +48479,14 @@ declare namespace Excel { shapes?: Excel.Interfaces.ShapeData[]; /** * + * Returns collection of slicers that are part of the worksheet. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + slicers?: Excel.Interfaces.SlicerData[]; + /** + * * Collection of tables that are part of the worksheet. Read-only. * * [Api set: ExcelApi 1.1] @@ -47793,7 +49314,7 @@ declare namespace Excel { prompt?: Excel.DataValidationPrompt; /** * - * Data Validation rule that contains different type of data validation criteria. + * Data validation rule that contains different type of data validation criteria. * * [Api set: ExcelApi 1.8] */ @@ -47982,7 +49503,7 @@ declare namespace Excel { interface RangeFillData { /** * - * HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") + * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") * * [Api set: ExcelApi 1.1] */ @@ -48210,7 +49731,7 @@ declare namespace Excel { series?: Excel.Interfaces.ChartSeriesData[]; /** * - * Represents the title of the specified chart, including the text, visibility, position, and formating of the title. Read-only. + * Represents the title of the specified chart, including the text, visibility, position, and formatting of the title. Read-only. * * [Api set: ExcelApi 1.1] */ @@ -48296,7 +49817,7 @@ declare namespace Excel { showAllFieldButtons?: boolean; /** * - * Represents whether to to show the data labels when the value is greater than the maximum value on the value axis. + * Represents whether to show the data labels when the value is greater than the maximum value on the value axis. If value axis became smaller than the size of data points, you can use this property to set whether to show the data labels. This property applies to 2-D charts only. * @@ -48666,7 +50187,7 @@ declare namespace Excel { name?: string; /** * - * Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. + * Specifies how bars and columns are positioned. Can be a value between –100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -49047,7 +50568,7 @@ declare namespace Excel { position?: Excel.ChartAxisPosition | "Automatic" | "Maximum" | "Minimum" | "Custom"; /** * - * Represents the specified axis position where the other axis crosses at. Read Only. Set to this property should use SetPositionAt(double) method. + * Represents the specified axis position where the other axis crosses at. You should use the SetPositionAt(double) method to set this property. * * [Api set: ExcelApi 1.8] */ @@ -49199,7 +50720,7 @@ declare namespace Excel { format?: Excel.Interfaces.ChartDataLabelFormatData; /** * - * Represents whether data labels automatically generates appropriate text based on context. + * Represents whether data labels automatically generate appropriate text based on context. * * [Api set: ExcelApi 1.8] */ @@ -49627,14 +51148,14 @@ declare namespace Excel { interface ChartLegendEntryData { /** * - * Represents the height of the legendEntry on the chart Legend. + * Represents the height of the legendEntry on the chart legend. * * [Api set: ExcelApi 1.8] */ height?: number; /** * - * Represents the index of the LegendEntry in the Chart Legend. + * Represents the index of the legendEntry in the chart legend. * * [Api set: ExcelApi 1.8] */ @@ -50450,6 +51971,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ rowHierarchies?: Excel.Interfaces.RowColumnPivotHierarchyData[]; + /** + * + * True if the PivotTable should use custom lists when sorting. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enableDataValueEditing?: boolean; /** * * Id of the PivotTable. Read-only. @@ -50475,6 +52004,14 @@ declare namespace Excel { } /** An interface describing the data returned by calling "pivotLayout.toJSON()". */ interface PivotLayoutData { + /** + * + * True if formatting will be automatically formatted when it’s refreshed or when fields are moved + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + autoFormat?: boolean; /** * * True if the field list should be shown or hidden from the UI. @@ -50490,6 +52027,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ layoutType?: Excel.PivotLayoutType | "Compact" | "Tabular" | "Outline"; + /** + * + * True if formatting is preserved when the report is refreshed or recalculated by operations such as pivoting, sorting, or changing page field items. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + preserveFormatting?: boolean; /** * * True if the PivotTable report shows grand totals for columns. @@ -50660,7 +52205,7 @@ declare namespace Excel { position?: number; /** * - * Determines whether the data should be sown as a specific summary calculation or not. + * Determines whether the data should be shown as a specific summary calculation or not. * * [Api set: ExcelApi 1.8] */ @@ -51892,6 +53437,14 @@ declare namespace Excel { * @beta */ replies?: Excel.Interfaces.CommentReplyData[]; + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: string; /** * * Represents the comment identifier. Read-only. @@ -51915,6 +53468,14 @@ declare namespace Excel { } /** An interface describing the data returned by calling "commentReply.toJSON()". */ interface CommentReplyData { + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: string; /** * * Represents the comment reply identifier. Read-only. @@ -51946,6 +53507,14 @@ declare namespace Excel { * @beta */ fill?: Excel.Interfaces.ShapeFillData; + /** + * + * Returns the line formatting of the shape object. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + lineFormat?: Excel.Interfaces.ShapeLineFormatData; /** * * Returns or sets the alternative descriptive text string for a Shape object when the object is saved to a Web page. @@ -51996,6 +53565,14 @@ declare namespace Excel { * @beta */ left?: number; + /** + * + * Represents the level of the specified shape. Level 0 means the shape is not part of any group, level 1 means the shape is part of a top-level group, etc. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + level?: number; /** * * Represents if the aspect ratio locked, in boolean, of the shape. @@ -52006,7 +53583,7 @@ declare namespace Excel { lockAspectRatio?: boolean; /** * - * Represents the name of the shape. Read-only. + * Represents the name of the shape. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -52044,7 +53621,7 @@ declare namespace Excel { * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta */ - type?: Excel.ShapeType | "Unknown" | "Image" | "GeometricShape" | "Group"; + type?: Excel.ShapeType | "Unknown" | "Image" | "GeometricShape" | "Group" | "Line"; /** * * Represents the visibility, in boolean, of the specified shape. @@ -52124,6 +53701,25 @@ declare namespace Excel { interface GroupShapeCollectionData { items?: Excel.Interfaces.ShapeData[]; } + /** An interface describing the data returned by calling "line.toJSON()". */ + interface LineData { + /** + * + * Represents the shape identifier. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: string; + /** + * + * Represents the connector type for the line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectorType?: Excel.ConnectorType | "Straight" | "Elbow" | "Curve"; + } /** An interface describing the data returned by calling "shapeFill.toJSON()". */ interface ShapeFillData { /** @@ -52151,6 +53747,57 @@ declare namespace Excel { */ type?: Excel.ShapeFillType | "NoFill" | "Solid" | "Gradient" | "Pattern" | "PictureAndTexture" | "Mixed"; } + /** An interface describing the data returned by calling "shapeLineFormat.toJSON()". */ + interface ShapeLineFormatData { + /** + * + * Represents the line color in HTML color format, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: string; + /** + * + * Represents the line style of the shape. Returns null when line is not visible or has mixed line dash style property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + dashStyle?: Excel.ShapeLineDashStyle | "Dash" | "DashDot" | "DashDotDot" | "LongDash" | "LongDashDot" | "RoundDot" | "Solid" | "SquareDot" | "LongDashDotDot" | "SystemDash" | "SystemDot" | "SystemDashDot"; + /** + * + * Represents the line style of the shape object. Returns null when line is not visible or has mixed line visible property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style?: Excel.ShapeLineStyle | "Single" | "ThickBetweenThin" | "ThickThin" | "ThinThick" | "ThinThin"; + /** + * + * Represents the degree of transparency of the specified line as a value from 0.0 (opaque) through 1.0 (clear). Returns null when the shape has mixed line transparency property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + transparency?: number; + /** + * + * Represents whether the line formatting of a shape element is visible. Returns null when the shape has mixed line visible property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + visible?: boolean; + /** + * + * Represents weight of the line, in points. Returns null when the line is not visible or has mixed line weight property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + weight?: number; + } /** An interface describing the data returned by calling "textFrame.toJSON()". */ interface TextFrameData { /** @@ -52320,6 +53967,160 @@ declare namespace Excel { */ underline?: Excel.ShapeFontUnderlineStyle | "None" | "Single" | "Double" | "Heavy" | "Dotted" | "DottedHeavy" | "Dash" | "DashHeavy" | "DashLong" | "DashLongHeavy" | "DotDash" | "DotDashHeavy" | "DotDotDash" | "DotDotDashHeavy" | "Wavy" | "WavyHeavy" | "WavyDouble"; } + /** An interface describing the data returned by calling "slicer.toJSON()". */ + interface SlicerData { + /** + * + * Represents the collection of SlicerItems that are part of the slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + slicerItems?: Excel.Interfaces.SlicerItemData[]; + /** + * + * Represents the worksheet containing the slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + worksheet?: Excel.Interfaces.WorksheetData; + /** + * + * Represents the caption of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + caption?: string; + /** + * + * Represents the height, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + height?: number; + /** + * + * Represents the unique id of slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: string; + /** + * + * True if all filters currently applied on the slicer is cleared. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isFilterCleared?: boolean; + /** + * + * Represents the distance, in points, from the left side of the slicer to the left of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + left?: number; + /** + * + * Represents the name of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: string; + /** + * + * Represents the name used in the formula. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + nameInFormula?: string; + /** + * + * Represents the sort order of the items in the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + sortBy?: Excel.SlicerSortType | "DataSourceOrder" | "Ascending" | "Descending"; + /** + * + * Constant value that represents the Slicer style. Possible values are: SlicerStyleLight1 thru SlicerStyleLight6, TableStyleOther1 thru TableStyleOther2, SlicerStyleDark1 thru SlicerStyleDark6. A custom user-defined style present in the workbook can also be specified. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style?: string; + /** + * + * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + top?: number; + /** + * + * Represents the width, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + width?: number; + } + /** An interface describing the data returned by calling "slicerCollection.toJSON()". */ + interface SlicerCollectionData { + items?: Excel.Interfaces.SlicerData[]; + } + /** An interface describing the data returned by calling "slicerItem.toJSON()". */ + interface SlicerItemData { + /** + * + * True if the slicer item has data. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + hasData?: boolean; + /** + * + * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isSelected?: boolean; + /** + * + * Represents the unique value representing the slicer item. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + key?: string; + /** + * + * Represents the value displayed on UI. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: string; + } + /** An interface describing the data returned by calling "slicerItemCollection.toJSON()". */ + interface SlicerItemCollectionData { + items?: Excel.Interfaces.SlicerItemData[]; + } /** An interface describing the data returned by calling "functionResult.toJSON()". */ interface FunctionResultData { /** @@ -52347,7 +54148,7 @@ declare namespace Excel { $all?: boolean; /** * - * Turn on/off JavaScript events in current taskpane or content add-in. + * Toggle JavaScript events in the current task pane or content add-in. * * [Api set: ExcelApi 1.8] */ @@ -54120,7 +55921,7 @@ declare namespace Excel { prompt?: boolean; /** * - * Data Validation rule that contains different type of data validation criteria. + * Data validation rule that contains different type of data validation criteria. * * [Api set: ExcelApi 1.8] */ @@ -54334,7 +56135,7 @@ declare namespace Excel { $all?: boolean; /** * - * HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") + * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") * * [Api set: ExcelApi 1.1] */ @@ -54618,7 +56419,7 @@ declare namespace Excel { series?: Excel.Interfaces.ChartSeriesCollectionLoadOptions; /** * - * For EACH ITEM in the collection: Represents the title of the specified chart, including the text, visibility, position, and formating of the title. + * For EACH ITEM in the collection: Represents the title of the specified chart, including the text, visibility, position, and formatting of the title. * * [Api set: ExcelApi 1.1] */ @@ -54711,7 +56512,7 @@ declare namespace Excel { showAllFieldButtons?: boolean; /** * - * For EACH ITEM in the collection: Represents whether to to show the data labels when the value is greater than the maximum value on the value axis. + * For EACH ITEM in the collection: Represents whether to show the data labels when the value is greater than the maximum value on the value axis. If value axis became smaller than the size of data points, you can use this property to set whether to show the data labels. This property applies to 2-D charts only. * @@ -54800,7 +56601,7 @@ declare namespace Excel { series?: Excel.Interfaces.ChartSeriesCollectionLoadOptions; /** * - * Represents the title of the specified chart, including the text, visibility, position, and formating of the title. + * Represents the title of the specified chart, including the text, visibility, position, and formatting of the title. * * [Api set: ExcelApi 1.1] */ @@ -54893,7 +56694,7 @@ declare namespace Excel { showAllFieldButtons?: boolean; /** * - * Represents whether to to show the data labels when the value is greater than the maximum value on the value axis. + * Represents whether to show the data labels when the value is greater than the maximum value on the value axis. If value axis became smaller than the size of data points, you can use this property to set whether to show the data labels. This property applies to 2-D charts only. * @@ -55271,7 +57072,7 @@ declare namespace Excel { name?: boolean; /** * - * For EACH ITEM in the collection: Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. + * For EACH ITEM in the collection: Specifies how bars and columns are positioned. Can be a value between –100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -55618,7 +57419,7 @@ declare namespace Excel { name?: boolean; /** * - * Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. + * Specifies how bars and columns are positioned. Can be a value between –100 and 100. Applies only to 2-D bar and 2-D column charts. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -56104,7 +57905,7 @@ declare namespace Excel { position?: boolean; /** * - * Represents the specified axis position where the other axis crosses at. Read Only. Set to this property should use SetPositionAt(double) method. + * Represents the specified axis position where the other axis crosses at. You should use the SetPositionAt(double) method to set this property. * * [Api set: ExcelApi 1.8] */ @@ -56280,7 +58081,7 @@ declare namespace Excel { format?: Excel.Interfaces.ChartDataLabelFormatLoadOptions; /** * - * Represents whether data labels automatically generates appropriate text based on context. + * Represents whether data labels automatically generate appropriate text based on context. * * [Api set: ExcelApi 1.8] */ @@ -56751,14 +58552,14 @@ declare namespace Excel { $all?: boolean; /** * - * Represents the height of the legendEntry on the chart Legend. + * Represents the height of the legendEntry on the chart legend. * * [Api set: ExcelApi 1.8] */ height?: boolean; /** * - * Represents the index of the LegendEntry in the Chart Legend. + * Represents the index of the legendEntry in the chart legend. * * [Api set: ExcelApi 1.8] */ @@ -56802,14 +58603,14 @@ declare namespace Excel { $all?: boolean; /** * - * For EACH ITEM in the collection: Represents the height of the legendEntry on the chart Legend. + * For EACH ITEM in the collection: Represents the height of the legendEntry on the chart legend. * * [Api set: ExcelApi 1.8] */ height?: boolean; /** * - * For EACH ITEM in the collection: Represents the index of the LegendEntry in the Chart Legend. + * For EACH ITEM in the collection: Represents the index of the legendEntry in the chart legend. * * [Api set: ExcelApi 1.8] */ @@ -57848,6 +59649,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ worksheet?: Excel.Interfaces.WorksheetLoadOptions; + /** + * + * For EACH ITEM in the collection: True if the PivotTable should use custom lists when sorting. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enableDataValueEditing?: boolean; /** * * For EACH ITEM in the collection: Id of the PivotTable. Read-only. @@ -57893,6 +59702,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ worksheet?: Excel.Interfaces.WorksheetLoadOptions; + /** + * + * True if the PivotTable should use custom lists when sorting. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enableDataValueEditing?: boolean; /** * * Id of the PivotTable. Read-only. @@ -57924,6 +59741,14 @@ declare namespace Excel { */ interface PivotLayoutLoadOptions { $all?: boolean; + /** + * + * True if formatting will be automatically formatted when it’s refreshed or when fields are moved + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + autoFormat?: boolean; /** * * True if the field list should be shown or hidden from the UI. @@ -57939,6 +59764,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ layoutType?: boolean; + /** + * + * True if formatting is preserved when the report is refreshed or recalculated by operations such as pivoting, sorting, or changing page field items. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + preserveFormatting?: boolean; /** * * True if the PivotTable report shows grand totals for columns. @@ -58186,7 +60019,7 @@ declare namespace Excel { position?: boolean; /** * - * For EACH ITEM in the collection: Determines whether the data should be sown as a specific summary calculation or not. + * For EACH ITEM in the collection: Determines whether the data should be shown as a specific summary calculation or not. * * [Api set: ExcelApi 1.8] */ @@ -58244,7 +60077,7 @@ declare namespace Excel { position?: boolean; /** * - * Determines whether the data should be sown as a specific summary calculation or not. + * Determines whether the data should be shown as a specific summary calculation or not. * * [Api set: ExcelApi 1.8] */ @@ -60262,6 +62095,14 @@ declare namespace Excel { */ interface CommentCollectionLoadOptions { $all?: boolean; + /** + * + * For EACH ITEM in the collection: Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: boolean; /** * * For EACH ITEM in the collection: Represents the comment identifier. Read-only. @@ -60288,6 +62129,14 @@ declare namespace Excel { */ interface CommentLoadOptions { $all?: boolean; + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: boolean; /** * * Represents the comment identifier. Read-only. @@ -60314,6 +62163,14 @@ declare namespace Excel { */ interface CommentReplyCollectionLoadOptions { $all?: boolean; + /** + * + * For EACH ITEM in the collection: Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: boolean; /** * * For EACH ITEM in the collection: Represents the comment reply identifier. Read-only. @@ -60340,6 +62197,14 @@ declare namespace Excel { */ interface CommentReplyLoadOptions { $all?: boolean; + /** + * + * Get/Set the content. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + content?: boolean; /** * * Represents the comment reply identifier. Read-only. @@ -60400,6 +62265,30 @@ declare namespace Excel { image?: Excel.Interfaces.ImageLoadOptions; /** * + * For EACH ITEM in the collection: Returns the line object for the shape object. Error will be thrown, if the shape object is other shape type (Like, GeometricShape, SmartArt, etc.) rather than Image. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + line?: Excel.Interfaces.LineLoadOptions; + /** + * + * For EACH ITEM in the collection: Returns the line formatting of the shape object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + lineFormat?: Excel.Interfaces.ShapeLineFormatLoadOptions; + /** + * + * For EACH ITEM in the collection: Represents the parent group of the specified shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + parentGroup?: Excel.Interfaces.ShapeLoadOptions; + /** + * * For EACH ITEM in the collection: Returns the textFrame object of a shape. Read only. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -60456,6 +62345,14 @@ declare namespace Excel { * @beta */ left?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the level of the specified shape. Level 0 means the shape is not part of any group, level 1 means the shape is part of a top-level group, etc. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + level?: boolean; /** * * For EACH ITEM in the collection: Represents if the aspect ratio locked, in boolean, of the shape. @@ -60466,7 +62363,7 @@ declare namespace Excel { lockAspectRatio?: boolean; /** * - * For EACH ITEM in the collection: Represents the name of the shape. Read-only. + * For EACH ITEM in the collection: Represents the name of the shape. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -60574,6 +62471,30 @@ declare namespace Excel { image?: Excel.Interfaces.ImageLoadOptions; /** * + * Returns the line object for the shape object. Error will be thrown, if the shape object is other shape type (Like, GeometricShape, SmartArt, etc.) rather than Image. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + line?: Excel.Interfaces.LineLoadOptions; + /** + * + * Returns the line formatting of the shape object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + lineFormat?: Excel.Interfaces.ShapeLineFormatLoadOptions; + /** + * + * Represents the parent group of the specified shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + parentGroup?: Excel.Interfaces.ShapeLoadOptions; + /** + * * Returns the textFrame object of a shape. Read only. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -60630,6 +62551,14 @@ declare namespace Excel { * @beta */ left?: boolean; + /** + * + * Represents the level of the specified shape. Level 0 means the shape is not part of any group, level 1 means the shape is part of a top-level group, etc. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + level?: boolean; /** * * Represents if the aspect ratio locked, in boolean, of the shape. @@ -60640,7 +62569,7 @@ declare namespace Excel { lockAspectRatio?: boolean; /** * - * Represents the name of the shape. Read-only. + * Represents the name of the shape. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -60834,6 +62763,30 @@ declare namespace Excel { image?: Excel.Interfaces.ImageLoadOptions; /** * + * For EACH ITEM in the collection: Returns the line object for the shape object. Error will be thrown, if the shape object is other shape type (Like, GeometricShape, SmartArt, etc.) rather than Image. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + line?: Excel.Interfaces.LineLoadOptions; + /** + * + * For EACH ITEM in the collection: Returns the line formatting of the shape object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + lineFormat?: Excel.Interfaces.ShapeLineFormatLoadOptions; + /** + * + * For EACH ITEM in the collection: Represents the parent group of the specified shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + parentGroup?: Excel.Interfaces.ShapeLoadOptions; + /** + * * For EACH ITEM in the collection: Returns the textFrame object of a shape. Read only. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -60890,6 +62843,14 @@ declare namespace Excel { * @beta */ left?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the level of the specified shape. Level 0 means the shape is not part of any group, level 1 means the shape is part of a top-level group, etc. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + level?: boolean; /** * * For EACH ITEM in the collection: Represents if the aspect ratio locked, in boolean, of the shape. @@ -60900,7 +62861,7 @@ declare namespace Excel { lockAspectRatio?: boolean; /** * - * For EACH ITEM in the collection: Represents the name of the shape. Read-only. + * For EACH ITEM in the collection: Represents the name of the shape. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -60965,6 +62926,40 @@ declare namespace Excel { */ zorderPosition?: boolean; } + /** + * + * Represents a Line object inside a worksheet. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface LineLoadOptions { + $all?: boolean; + /** + * + * Returns the shape object for the line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + shape?: Excel.Interfaces.ShapeLoadOptions; + /** + * + * Represents the shape identifier. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * + * Represents the connector type for the line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectorType?: boolean; + } /** * * Represents the fill formatting for a shape object. @@ -60999,6 +62994,64 @@ declare namespace Excel { */ type?: boolean; } + /** + * + * Represents the line formatting for the shape object. For picture and geometric shape, line formatting represents the border of shape object. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface ShapeLineFormatLoadOptions { + $all?: boolean; + /** + * + * Represents the line color in HTML color format, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: boolean; + /** + * + * Represents the line style of the shape. Returns null when line is not visible or has mixed line dash style property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + dashStyle?: boolean; + /** + * + * Represents the line style of the shape object. Returns null when line is not visible or has mixed line visible property (e.g. group type of shape). See Excel.ShapeLineStyle for details. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style?: boolean; + /** + * + * Represents the degree of transparency of the specified line as a value from 0.0 (opaque) through 1.0 (clear). Returns null when the shape has mixed line transparency property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + transparency?: boolean; + /** + * + * Represents whether the line formatting of a shape element is visible. Returns null when the shape has mixed line visible property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + visible?: boolean; + /** + * + * Represents weight of the line, in points. Returns null when the line is not visible or has mixed line weight property (e.g. group type of shape). + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + weight?: boolean; + } /** * * Represents the text frame for a shape object. @@ -61187,6 +63240,310 @@ declare namespace Excel { */ underline?: boolean; } + /** + * + * Represents a slicer object in the workbook. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SlicerLoadOptions { + $all?: boolean; + /** + * + * Represents the worksheet containing the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + worksheet?: Excel.Interfaces.WorksheetLoadOptions; + /** + * + * Represents the caption of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + caption?: boolean; + /** + * + * Represents the height, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + height?: boolean; + /** + * + * Represents the unique id of slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * + * True if all filters currently applied on the slicer is cleared. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isFilterCleared?: boolean; + /** + * + * Represents the distance, in points, from the left side of the slicer to the left of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + left?: boolean; + /** + * + * Represents the name of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + /** + * + * Represents the name used in the formula. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + nameInFormula?: boolean; + /** + * + * Represents the sort order of the items in the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + sortBy?: boolean; + /** + * + * Constant value that represents the Slicer style. Possible values are: SlicerStyleLight1 thru SlicerStyleLight6, TableStyleOther1 thru TableStyleOther2, SlicerStyleDark1 thru SlicerStyleDark6. A custom user-defined style present in the workbook can also be specified. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style?: boolean; + /** + * + * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + top?: boolean; + /** + * + * Represents the width, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + width?: boolean; + } + /** + * + * Represents a collection of all the slicer objects on the workbook or a worksheet. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SlicerCollectionLoadOptions { + $all?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the worksheet containing the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + worksheet?: Excel.Interfaces.WorksheetLoadOptions; + /** + * + * For EACH ITEM in the collection: Represents the caption of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + caption?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the height, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + height?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the unique id of slicer. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * + * For EACH ITEM in the collection: True if all filters currently applied on the slicer is cleared. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isFilterCleared?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the distance, in points, from the left side of the slicer to the left of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + left?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the name of slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the name used in the formula. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + nameInFormula?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the sort order of the items in the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + sortBy?: boolean; + /** + * + * For EACH ITEM in the collection: Constant value that represents the Slicer style. Possible values are: SlicerStyleLight1 thru SlicerStyleLight6, TableStyleOther1 thru TableStyleOther2, SlicerStyleDark1 thru SlicerStyleDark6. A custom user-defined style present in the workbook can also be specified. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + style?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + Throws an invalid argument exception when set with negative value as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + top?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the width, in points, of the slicer. + Throws an invalid argument exception when set with negative value or zero as input. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + width?: boolean; + } + /** + * + * Represents a slicer item in a slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SlicerItemLoadOptions { + $all?: boolean; + /** + * + * True if the slicer item has data. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + hasData?: boolean; + /** + * + * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isSelected?: boolean; + /** + * + * Represents the unique value representing the slicer item. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + key?: boolean; + /** + * + * Represents the value displayed on UI. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + } + /** + * + * Represents a collection of all the slicer item objects on the slicer. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SlicerItemCollectionLoadOptions { + $all?: boolean; + /** + * + * For EACH ITEM in the collection: True if the slicer item has data. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + hasData?: boolean; + /** + * + * For EACH ITEM in the collection: True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isSelected?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the unique value representing the slicer item. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + key?: boolean; + /** + * + * For EACH ITEM in the collection: Represents the value displayed on UI. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + } /** * * An object containing the result of a function-evaluation operation @@ -61213,7 +63570,6 @@ declare namespace Excel { } } - //////////////////////////////////////////////////////////////// //////////////////////// End Excel APIs //////////////////////// //////////////////////////////////////////////////////////////// From b0fcc8c3e08cd091692e95fb02fffb21b6a9cbca Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Wed, 9 Jan 2019 20:16:53 +0100 Subject: [PATCH 238/646] [new-github-issue-url] Add types --- types/new-github-issue-url/index.d.ts | 81 +++++++++++++++++++ .../new-github-issue-url-tests.ts | 54 +++++++++++++ types/new-github-issue-url/tsconfig.json | 23 ++++++ types/new-github-issue-url/tslint.json | 1 + 4 files changed, 159 insertions(+) create mode 100644 types/new-github-issue-url/index.d.ts create mode 100644 types/new-github-issue-url/new-github-issue-url-tests.ts create mode 100644 types/new-github-issue-url/tsconfig.json create mode 100644 types/new-github-issue-url/tslint.json diff --git a/types/new-github-issue-url/index.d.ts b/types/new-github-issue-url/index.d.ts new file mode 100644 index 0000000000..f784a0d85d --- /dev/null +++ b/types/new-github-issue-url/index.d.ts @@ -0,0 +1,81 @@ +// Type definitions for new-github-issue-url 0.1 +// Project: https://github.com/sindresorhus/new-github-issue-url#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export = newGithubIssueUrl; + +/** + * Returns a URL string. + */ +declare function newGithubIssueUrl(options: newGithubIssueUrl.Options): string; + +declare namespace newGithubIssueUrl { + type Without = { [P in Exclude]?: never }; + type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + + type Options = XOR; + + interface BaseOptions { + /** + * The issue body. + */ + body?: string; + /** + * The issue title. + */ + title?: string; + /** + * Use an [issue template](https://help.github.com/articles/manually-creating-a-single-issue-template-for-your-repository). + * + * For example, if you want to use a template at `ISSUE_TEMPLATE/unicorn.md`, you would specify `unicorn.md` here. + */ + template?: string; + /** + * The labels for the issue. + * + * *Requires the user to have the permission to add labels.* + */ + labels?: string[]; + /** + * The milestone for the issue. + * + * *Requires the user to have the permission to add milestone.* + */ + milestone?: string; + /** + * The user to assign to the issue. + * + * *Requires the user to have the permission to add assignee.* + */ + assignee?: string; + /** + * The projects to add the issue to. + * + * The project reference format is `user/`, for example, if the URL to the project + * is `https://github.com/sindresorhus/some-repo/projects/3`, the project reference would be `some-repo/3`. + * + * *Requires the user to have the permission to add projects.* + */ + projects?: string[]; + } + + interface RepoUrlOptions extends BaseOptions { + /** + * The full URL to the repo. + */ + repoUrl: string; + } + + interface UserRepoOptions extends BaseOptions { + /** + * GitHub username or organization. + */ + user: string; + /** + * GitHub repo. + */ + repo: string; + } +} diff --git a/types/new-github-issue-url/new-github-issue-url-tests.ts b/types/new-github-issue-url/new-github-issue-url-tests.ts new file mode 100644 index 0000000000..c64b1aaa61 --- /dev/null +++ b/types/new-github-issue-url/new-github-issue-url-tests.ts @@ -0,0 +1,54 @@ +import newGithubIssueUrl = require('new-github-issue-url'); + +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-issue-url.git', +}); +// $ExpectType string +newGithubIssueUrl({ + user: 'sindresorhus', + repo: 'new-github-issue-url', +}); +// $ExpectError +newGithubIssueUrl({ + user: 'sindresorhus', +}); +// $ExpectError +newGithubIssueUrl({ + repo: 'new-github-issue-url', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + body: 'foo', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + title: 'foo', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + template: 'unicorn.md', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + labels: ['foo', 'bar'], +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + milestone: 'foo', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + assignee: 'sindresorhus', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + projects: ['some-repo/3'], +}); diff --git a/types/new-github-issue-url/tsconfig.json b/types/new-github-issue-url/tsconfig.json new file mode 100644 index 0000000000..3b1da7ee63 --- /dev/null +++ b/types/new-github-issue-url/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", + "new-github-issue-url-tests.ts" + ] +} diff --git a/types/new-github-issue-url/tslint.json b/types/new-github-issue-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/new-github-issue-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 711c0a8d670e90a13e37b85462cbe8265c2464e3 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 9 Jan 2019 16:02:31 -0500 Subject: [PATCH 239/646] [react-reconciler] Update to v0.18 --- types/react-reconciler/index.d.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/types/react-reconciler/index.d.ts b/types/react-reconciler/index.d.ts index 733cc10435..66b4d03136 100644 --- a/types/react-reconciler/index.d.ts +++ b/types/react-reconciler/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-reconciler 0.16 +// Type definitions for react-reconciler 0.18 // Project: https://reactjs.org/ // Definitions by: Nathan Bierema // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,7 +12,7 @@ declare function ReactReconciler; declare namespace ReactReconciler { - // react-ronciler/ReactFiber + // react-reconciler/ReactFiber // A Fiber is work on a Component that needs to be done or was done. There can // be more than one per component. @@ -201,7 +201,7 @@ declare namespace ReactReconciler { ): TextInstance; scheduleDeferredCallback( - callback: (deadline: Deadline) => void, + callback: () => any, options?: { timeout: number }, ): any; cancelDeferredCallback(callbackID: any): void; @@ -434,6 +434,11 @@ declare namespace ReactReconciler { // be retried. latestPingedTime: ExpirationTime; + pingCache: + | WeakMap> + | Map> + | null; + // If an error is thrown, and there are no more updates in the queue, we try // rendering from the root one more time, synchronously, before handling // the error. @@ -476,9 +481,8 @@ declare namespace ReactReconciler { // react-reconciler/ReactFiberScheduler - interface Deadline { - timeRemaining(): number; - didTimeout: boolean; + interface Thenable { + then(resolve: () => any, reject?: () => any): any; } // react-reconciler/ReactTypeOfMode @@ -555,6 +559,7 @@ declare namespace ReactReconciler { _currentValue: T; _currentValue2: T; + _threadCount: number; // DEV only _currentRenderer?: object | null; From 0b87ee56e42b4be04e837a900fb43d9b58d7c45e Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 9 Jan 2019 17:58:38 -0500 Subject: [PATCH 240/646] [scheduler] Update to v0.12 --- types/scheduler/index.d.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/types/scheduler/index.d.ts b/types/scheduler/index.d.ts index 9df4054e8e..15644f5ae4 100644 --- a/types/scheduler/index.d.ts +++ b/types/scheduler/index.d.ts @@ -1,14 +1,10 @@ -// Type definitions for scheduler 0.10 +// Type definitions for scheduler 0.12 // Project: https://reactjs.org/ // Definitions by: Nathan Bierema // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -export interface Deadline { - timeRemaining(): number; - didTimeout: boolean; -} -export type FrameCallbackType = (deadline: Deadline) => FrameCallbackType | void; +export type FrameCallbackType = () => FrameCallbackType | void; export interface CallbackNode { callback: FrameCallbackType; priorityLevel: number; @@ -20,10 +16,15 @@ export interface CallbackNode { export const unstable_ImmediatePriority = 1; export const unstable_UserBlockingPriority = 2; export const unstable_NormalPriority = 3; -export const unstable_IdlePriority = 4; +export const unstable_IdlePriority = 5; +export const unstable_LowPriority = 4; export function unstable_runWithPriority(priorityLevel: number, eventHandler: () => T): T | undefined; export function unstable_scheduleCallback(callback: FrameCallbackType, deprecated_options?: { timeout: number}): CallbackNode; export function unstable_cancelCallback(callbackNode: CallbackNode): void; export function unstable_wrapCallback(callback: FrameCallbackType): () => FrameCallbackType | undefined; export function unstable_getCurrentPriorityLevel(): number; +export function unstable_shouldYield(): boolean; +export function unstable_continueExecution(): void; +export function unstable_pauseExecution(): void; +export function unstable_getFirstCallbackNode(): CallbackNode | null; export function unstable_now(): number; From 618014791e1b4f1e30680087537e81cd81ba5661 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 9 Jan 2019 14:59:33 -0800 Subject: [PATCH 241/646] Updating Excel APIs with latest from CDN --- types/office-js/index.d.ts | 836 ++++++++++++++++++++++++++++++++----- 1 file changed, 736 insertions(+), 100 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 6468bbfffa..005e9cf037 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -17761,7 +17761,7 @@ declare namespace Excel { * * @param base64File Optional. The base64 encoded .xlsx file. The default value is null. */ - function createWorkbook(base64?: string): Promise; + function createWorkbook(base64?: string): Promise; interface ThreeArrowsSet { [index: number]: Icon; redDownArrow: Icon; @@ -18536,6 +18536,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class Runtime extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Turn on/off JavaScript events in current taskpane or content add-in. @@ -18578,6 +18580,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Runtime; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Runtime object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RuntimeData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RuntimeData; } /** @@ -18587,6 +18593,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class Application extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the calculation mode used in the workbook, as defined by the constants in Excel.CalculationMode. Possible values are: `Automatic`, where Excel controls recalculation; `AutomaticExceptTables`, where Excel controls recalculation but ignores changes in tables; `Manual`, where calculation is done when the user requests it. @@ -18654,6 +18662,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Application; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Application object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ApplicationData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ApplicationData; } /** @@ -18663,6 +18675,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class Workbook extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the Excel application instance that contains this workbook. Read-only. @@ -18826,6 +18840,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Workbook object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorkbookData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorkbookData; } /** @@ -18835,6 +18853,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class WorkbookProtection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Indicates if the workbook is protected. Read-Only. @@ -18881,6 +18901,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.WorkbookProtection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorkbookProtection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorkbookProtectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorkbookProtectionData; } /** @@ -18890,6 +18914,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class WorkbookCreated extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -18910,6 +18936,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.WorkbookCreated; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorkbookCreated object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorkbookCreatedData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorkbookCreatedData; } /** @@ -18922,6 +18952,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-worksheets | how-to guide on working with worksheets} has detailed walkthroughs and code samples. */ class Worksheet extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns collection of charts that are part of the worksheet. Read-only. @@ -19240,6 +19272,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Worksheet object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorksheetData; } /** @@ -19249,6 +19285,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class WorksheetCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Worksheet[]; /** @@ -19375,6 +19413,10 @@ declare namespace Excel { * @eventproperty */ readonly onDeleted: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.WorksheetCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.WorksheetCollectionData; } /** @@ -19384,6 +19426,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class WorksheetProtection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Sheet protection options. Read-only. @@ -19438,6 +19482,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.WorksheetProtection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorksheetProtection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetProtectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorksheetProtectionData; } /** @@ -19550,6 +19598,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class WorksheetFreezePanes extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Sets the frozen cells in the active worksheet view. @@ -19602,6 +19652,10 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ unfreeze(): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorksheetFreezePanes object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetFreezePanesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -19616,6 +19670,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-ranges | how-to guide on working with ranges} has detailed walkthroughs, images, and code samples. */ class Range extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Collection of ConditionalFormats that intersect the range. Read-only. @@ -20142,6 +20198,10 @@ declare namespace Excel { * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Excel.Range; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Range object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeData; } /** @@ -20202,6 +20262,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ class RangeView extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents a collection of range views associated with the range. Read-only. @@ -20328,6 +20390,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeView; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeView object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeViewData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeViewData; } /** @@ -20337,6 +20403,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ class RangeViewCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.RangeView[]; /** @@ -20373,6 +20441,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.RangeViewCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.RangeViewCollection; load(option?: string | string[]): Excel.RangeViewCollection; load(option?: OfficeExtension.LoadOption): Excel.RangeViewCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.RangeViewCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeViewCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.RangeViewCollectionData; } /** @@ -20382,6 +20454,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.4] */ class SettingCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Setting[]; /** @@ -20393,7 +20467,7 @@ declare namespace Excel { * @param key The Key of the new setting. * @param value The Value for the new setting. */ - add(key: string, value: string | number | boolean | Date | any[] | any): Excel.Setting; + add(key: string, value: string | number | boolean | Date | Array | any): Excel.Setting; /** * * Gets the number of Settings in the collection. @@ -20446,6 +20520,10 @@ declare namespace Excel { * @eventproperty */ readonly onSettingsChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.SettingCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SettingCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.SettingCollectionData; } /** @@ -20455,6 +20533,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.4] */ class Setting extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; private static DateJSONPrefix; private static DateJSONSuffix; private static replaceStringDateWithDate(value); @@ -20514,6 +20594,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Setting; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Setting object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SettingData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.SettingData; } /** @@ -20523,6 +20607,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class NamedItemCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.NamedItem[]; /** @@ -20592,6 +20678,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.NamedItemCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.NamedItemCollection; load(option?: string | string[]): Excel.NamedItemCollection; load(option?: OfficeExtension.LoadOption): Excel.NamedItemCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.NamedItemCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.NamedItemCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.NamedItemCollectionData; } /** @@ -20601,6 +20691,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class NamedItem extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns an object containing values and types of the named item. Read-only. @@ -20727,6 +20819,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.NamedItem; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.NamedItem object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.NamedItemData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.NamedItemData; } /** @@ -20736,6 +20832,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class NamedItemArrayValues extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the types for each item in the named item array @@ -20771,6 +20869,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.NamedItemArrayValues; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.NamedItemArrayValues object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.NamedItemArrayValuesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.NamedItemArrayValuesData; } /** @@ -20780,6 +20882,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class Binding extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents binding identifier. Read-only. @@ -20861,6 +20965,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Binding object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.BindingData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.BindingData; } /** @@ -20870,6 +20978,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class BindingCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Binding[]; /** @@ -20999,6 +21109,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.BindingCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.BindingCollection; load(option?: string | string[]): Excel.BindingCollection; load(option?: OfficeExtension.LoadOption): Excel.BindingCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.BindingCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.BindingCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.BindingCollectionData; } /** @@ -21008,6 +21122,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Table[]; /** @@ -21088,6 +21204,10 @@ declare namespace Excel { * @eventproperty */ readonly onChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.TableCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.TableCollectionData; } /** @@ -21100,6 +21220,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables | how-to guide on working with tables} has detailed walkthroughs, images, and code samples. */ class Table extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents a collection of all the columns in the table. Read-only. @@ -21314,6 +21436,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Table object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableData; } /** @@ -21323,6 +21449,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableColumnCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.TableColumn[]; /** @@ -21395,6 +21523,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.TableColumnCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.TableColumnCollection; load(option?: string | string[]): Excel.TableColumnCollection; load(option?: OfficeExtension.LoadOption): Excel.TableColumnCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.TableColumnCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableColumnCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.TableColumnCollectionData; } /** @@ -21404,6 +21536,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableColumn extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Retrieve the filter applied to the column. Read-only. @@ -21509,6 +21643,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TableColumn; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TableColumn object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableColumnData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableColumnData; } /** @@ -21523,6 +21661,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableRowCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.TableRow[]; /** @@ -21586,6 +21726,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.TableRowCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.TableRowCollection; load(option?: string | string[]): Excel.TableRowCollection; load(option?: OfficeExtension.LoadOption): Excel.TableRowCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.TableRowCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableRowCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.TableRowCollectionData; } /** @@ -21600,6 +21744,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableRow extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the index number of the row within the rows collection of the table. Zero-indexed. Read-only. @@ -21663,6 +21809,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TableRow; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TableRow object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableRowData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableRowData; } /** @@ -21672,6 +21822,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class DataValidation extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Error alert when user enters invalid data. @@ -21758,6 +21910,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DataValidation; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataValidation object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataValidationData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DataValidationData; } /** @@ -21993,6 +22149,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Collection of border objects that apply to the overall range. Read-only. @@ -22134,6 +22292,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeFormatData; } /** @@ -22143,6 +22305,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class FormatProtection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Indicates if Excel hides the formula for the cells in the range. A null value indicates that the entire range doesn't have uniform formula hidden setting. @@ -22192,6 +22356,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.FormatProtection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.FormatProtection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FormatProtectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.FormatProtectionData; } /** @@ -22201,6 +22369,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeFill extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") @@ -22250,6 +22420,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeFill; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeFill object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeFillData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeFillData; } /** @@ -22259,6 +22433,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeBorder extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -22322,6 +22498,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeBorder; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeBorder object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeBorderData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeBorderData; } /** @@ -22331,6 +22511,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeBorderCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.RangeBorder[]; /** @@ -22385,6 +22567,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.RangeBorderCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.RangeBorderCollection; load(option?: string | string[]): Excel.RangeBorderCollection; load(option?: OfficeExtension.LoadOption): Excel.RangeBorderCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.RangeBorderCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeBorderCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.RangeBorderCollectionData; } /** @@ -22394,6 +22580,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeFont extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the bold status of font. @@ -22471,6 +22659,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeFont; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeFont object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeFontData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeFontData; } /** @@ -22480,6 +22672,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Chart[]; /** @@ -22600,6 +22794,10 @@ declare namespace Excel { * @eventproperty */ readonly onDeleted: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartCollectionData; } /** @@ -22612,6 +22810,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-charts | how-to guide on working with charts} has detailed walkthroughs, images, and code samples. */ class Chart extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart axes. Read-only. @@ -22670,7 +22870,8 @@ declare namespace Excel { readonly worksheet: Excel.Worksheet; /** * - * Returns or sets a ChartCategoryLabelLevel enumeration constant referring to the level of where the category labels are being sourced from. Read/Write. + * Returns or sets a ChartCategoryLabelLevel enumeration constant referring to + the level of where the category labels are being sourced from. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -22733,7 +22934,8 @@ declare namespace Excel { plotVisibleOnly: boolean; /** * - * Returns or sets a ChartSeriesNameLevel enumeration constant referring to the level of where the series names are being sourced from. Read/Write. + * Returns or sets a ChartSeriesNameLevel enumeration constant referring to + the level of where the series names are being sourced from. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -22889,6 +23091,10 @@ declare namespace Excel { * @eventproperty */ readonly onDeactivated: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Chart object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartData; } /** @@ -22898,6 +23104,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAreaFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format of chart area, which includes color, linestyle, and weight. Read-only. @@ -22954,6 +23162,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAreaFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAreaFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAreaFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAreaFormatData; } /** @@ -22963,6 +23175,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartSeriesCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartSeries[]; /** @@ -23016,6 +23230,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartSeriesCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartSeriesCollection; load(option?: string | string[]): Excel.ChartSeriesCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartSeriesCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartSeriesCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartSeriesCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartSeriesCollectionData; } /** @@ -23025,6 +23243,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartSeries extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents a collection of all dataLabels in the series. @@ -23194,7 +23414,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.8] */ - splitType: "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; + splitType: Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; /** * * True if Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series. Read/Write. @@ -23271,6 +23491,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartSeries; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartSeries object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartSeriesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartSeriesData; } /** @@ -23280,6 +23504,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartSeriesFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the fill format of a chart series, which includes background formating information. Read-only. @@ -23329,6 +23555,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartSeriesFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartSeriesFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartSeriesFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartSeriesFormatData; } /** @@ -23338,6 +23568,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartPointsCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartPoint[]; /** @@ -23381,6 +23613,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartPointsCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartPointsCollection; load(option?: string | string[]): Excel.ChartPointsCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartPointsCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartPointsCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPointsCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartPointsCollectionData; } /** @@ -23390,6 +23626,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartPoint extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the data label of a chart point. Read-only. @@ -23481,6 +23719,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPoint; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPoint object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPointData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPointData; } /** @@ -23490,6 +23732,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartPointFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format of a chart data point, which includes color, style, and weight information. Read-only. @@ -23539,6 +23783,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPointFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPointFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPointFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPointFormatData; } /** @@ -23548,6 +23796,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxes extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the category axis in a chart. Read-only. @@ -23624,6 +23874,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxes; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxes object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxesData; } /** @@ -23633,6 +23887,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxis extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart object, which includes line and font formatting. Read-only. @@ -23961,6 +24217,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxis; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxis object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisData; } /** @@ -23970,6 +24230,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxisFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart fill formatting. Read-only. @@ -24026,6 +24288,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxisFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxisFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisFormatData; } /** @@ -24035,6 +24301,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxisTitle extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of chart axis title. Read-only. @@ -24100,6 +24368,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxisTitle; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxisTitle object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisTitleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisTitleData; } /** @@ -24109,6 +24381,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxisTitleFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. @@ -24165,6 +24439,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxisTitleFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxisTitleFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisTitleFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisTitleFormatData; } /** @@ -24174,6 +24452,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartDataLabels extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the format of chart data labels, which includes fill and font formatting. Read-only. @@ -24190,7 +24470,8 @@ declare namespace Excel { autoText: boolean; /** * - * Represents the horizontal alignment for chart data label. See Excel.ChartTextHorizontalAlignment for details. This property is valid only when TextOrientation of data label is 0. + * Represents the horizontal alignment for chart data label. See Excel.ChartTextHorizontalAlignment for details. + This property is valid only when TextOrientation of data label is 0. * * [Api set: ExcelApi 1.8] */ @@ -24267,7 +24548,8 @@ declare namespace Excel { textOrientation: number; /** * - * Represents the vertical alignment of chart data label. See Excel.ChartTextVerticalAlignment for details. This property is valid only when TextOrientation of data label is -90, 90, or 180. + * Represents the vertical alignment of chart data label. See Excel.ChartTextVerticalAlignment for details. + This property is valid only when TextOrientation of data label is 90, -90 or 180. * * [Api set: ExcelApi 1.8] */ @@ -24307,6 +24589,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartDataLabels; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartDataLabels object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartDataLabelsData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartDataLabelsData; } /** @@ -24316,6 +24602,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartDataLabel extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the format of chart data label. @@ -24493,6 +24781,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartDataLabel; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartDataLabel object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartDataLabelData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartDataLabelData; } /** @@ -24502,6 +24794,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartDataLabelFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. Read-only. @@ -24558,6 +24852,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartDataLabelFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartDataLabelFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartDataLabelFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartDataLabelFormatData; } /** @@ -24567,6 +24865,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartGridlines extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of chart gridlines. Read-only. @@ -24616,6 +24916,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartGridlines; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartGridlines object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartGridlinesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartGridlinesData; } /** @@ -24625,6 +24929,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartGridlinesFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart line formatting. Read-only. @@ -24667,6 +24973,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartGridlinesFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartGridlinesFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartGridlinesFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartGridlinesFormatData; } /** @@ -24676,6 +24986,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartLegend extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart legend, which includes fill and font formatting. Read-only. @@ -24781,6 +25093,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLegend; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLegend object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLegendData; } /** @@ -24790,6 +25106,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartLegendEntry extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the height of the legendEntry on the chart Legend. @@ -24867,6 +25185,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLegendEntry; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLegendEntry object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendEntryData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLegendEntryData; } /** @@ -24876,6 +25198,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartLegendEntryCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartLegendEntry[]; /** @@ -24912,6 +25236,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartLegendEntryCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartLegendEntryCollection; load(option?: string | string[]): Excel.ChartLegendEntryCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartLegendEntryCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartLegendEntryCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendEntryCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartLegendEntryCollectionData; } /** @@ -24921,6 +25249,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartLegendFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. Read-only. @@ -24977,6 +25307,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLegendFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLegendFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLegendFormatData; } /** @@ -24986,6 +25320,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartTitle extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart title, which includes fill and font formatting. Read-only. @@ -25131,6 +25467,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTitle; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTitle object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTitleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTitleData; } /** @@ -25140,6 +25480,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartFormatString extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the font attributes, such as font name, font size, color, etc. of chart characters object. @@ -25182,6 +25524,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartFormatString; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartFormatString object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartFormatStringData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartFormatStringData; } /** @@ -25191,6 +25537,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartTitleFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format of chart title, which includes color, linestyle, and weight. Read-only. @@ -25247,6 +25595,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTitleFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTitleFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTitleFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTitleFormatData; } /** @@ -25256,6 +25608,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartFill extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -25276,6 +25630,10 @@ declare namespace Excel { * @param color HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). */ setSolidColor(color: string): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartFill object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartFillData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -25287,6 +25645,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartBorder extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of borders in the chart. @@ -25350,6 +25710,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartBorder; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartBorder object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartBorderData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartBorderData; } /** @@ -25359,6 +25723,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartLineFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of lines in the chart. @@ -25422,6 +25788,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLineFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLineFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLineFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLineFormatData; } /** @@ -25431,6 +25801,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartFont extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the bold status of font. @@ -25508,6 +25880,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartFont; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartFont object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartFontData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartFontData; } /** @@ -25517,6 +25893,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartTrendline extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart trendline. @@ -25636,6 +26014,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendline; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendline object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineData; } /** @@ -25645,6 +26027,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartTrendlineCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartTrendline[]; /** @@ -25699,6 +26083,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartTrendlineCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartTrendlineCollection; load(option?: string | string[]): Excel.ChartTrendlineCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartTrendlineCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartTrendlineCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartTrendlineCollectionData; } /** @@ -25708,6 +26096,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartTrendlineFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart line formatting. Read-only. @@ -25750,6 +26140,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendlineFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendlineFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineFormatData; } /** @@ -25759,6 +26153,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartTrendlineLabel extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the format of chart trendline label. @@ -25880,6 +26276,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendlineLabel; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendlineLabel object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineLabelData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineLabelData; } /** @@ -25889,6 +26289,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartTrendlineLabelFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. @@ -25945,6 +26347,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendlineLabelFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendlineLabelFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineLabelFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineLabelFormatData; } /** @@ -25954,6 +26360,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartPlotArea extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart plotArea. @@ -26059,6 +26467,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPlotArea; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPlotArea object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPlotAreaData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPlotAreaData; } /** @@ -26068,6 +26480,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartPlotAreaFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border attributes of a chart plotArea. @@ -26117,6 +26531,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPlotAreaFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPlotAreaFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPlotAreaFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPlotAreaFormatData; } /** @@ -26126,6 +26544,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class RangeSort extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Perform a sort operation. @@ -26152,6 +26572,10 @@ declare namespace Excel { * @param method Optional. The ordering method used for Chinese characters. */ apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientation?: "Rows" | "Columns", method?: "PinYin" | "StrokeCount"): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeSort object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeSortData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -26163,6 +26587,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class TableSort extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the current conditions used to last sort the table. Read-only. @@ -26241,6 +26667,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TableSort; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TableSort object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableSortData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableSortData; } /** @@ -26300,6 +26730,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class Filter extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The currently applied filter on the given column. Read-only. @@ -26456,6 +26888,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Filter; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Filter object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FilterData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.FilterData; } /** @@ -26567,7 +27003,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.2] */ - set: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + set: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; } /** * @@ -26578,6 +27014,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class CustomXmlPartScopedCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.CustomXmlPart[]; /** @@ -26640,6 +27078,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.CustomXmlPartScopedCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.CustomXmlPartScopedCollection; load(option?: string | string[]): Excel.CustomXmlPartScopedCollection; load(option?: OfficeExtension.LoadOption): Excel.CustomXmlPartScopedCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.CustomXmlPartScopedCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomXmlPartScopedCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.CustomXmlPartScopedCollectionData; } /** @@ -26649,6 +27091,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class CustomXmlPartCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.CustomXmlPart[]; /** @@ -26713,6 +27157,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.CustomXmlPartCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.CustomXmlPartCollection; load(option?: string | string[]): Excel.CustomXmlPartCollection; load(option?: OfficeExtension.LoadOption): Excel.CustomXmlPartCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.CustomXmlPartCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomXmlPartCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.CustomXmlPartCollectionData; } /** @@ -26722,6 +27170,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class CustomXmlPart extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The custom XML part's ID. Read-only. @@ -26780,6 +27230,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CustomXmlPart; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CustomXmlPart object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomXmlPartData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CustomXmlPartData; } /** @@ -26789,6 +27243,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ class PivotTableCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotTable[]; /** @@ -26853,6 +27309,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotTableCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotTableCollection; load(option?: string | string[]): Excel.PivotTableCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotTableCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotTableCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotTableCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotTableCollectionData; } /** @@ -26865,6 +27325,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-pivottables | how-to guide on working with PivotTables} has detailed walkthroughs, images, and code samples. */ class PivotTable extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The Column Pivot Hierarchies of the PivotTable. @@ -26977,6 +27439,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotTable; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotTable object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotTableData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotTableData; } /** @@ -26986,6 +27452,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotLayout extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * This property indicates the PivotLayoutType of all fields on the PivotTable. If fields have different states, this will be null. @@ -27084,6 +27552,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotLayout; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotLayout object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotLayoutData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotLayoutData; } /** @@ -27093,6 +27565,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotHierarchy[]; /** @@ -27138,6 +27612,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotHierarchyCollection; load(option?: string | string[]): Excel.PivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotHierarchyCollectionData; } /** @@ -27147,6 +27625,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the PivotHierarchy. @@ -27203,6 +27683,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotHierarchyData; } /** @@ -27212,6 +27696,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class RowColumnPivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.RowColumnPivotHierarchy[]; /** @@ -27272,6 +27758,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.RowColumnPivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.RowColumnPivotHierarchyCollection; load(option?: string | string[]): Excel.RowColumnPivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.RowColumnPivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.RowColumnPivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RowColumnPivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.RowColumnPivotHierarchyCollectionData; } /** @@ -27281,6 +27771,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class RowColumnPivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the RowColumnPivotHierarchy. @@ -27351,6 +27843,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RowColumnPivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RowColumnPivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RowColumnPivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RowColumnPivotHierarchyData; } /** @@ -27360,6 +27856,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class FilterPivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.FilterPivotHierarchy[]; /** @@ -27420,6 +27918,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.FilterPivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.FilterPivotHierarchyCollection; load(option?: string | string[]): Excel.FilterPivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.FilterPivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.FilterPivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FilterPivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.FilterPivotHierarchyCollectionData; } /** @@ -27429,6 +27931,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class FilterPivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the FilterPivotHierarchy. @@ -27506,6 +28010,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.FilterPivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.FilterPivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FilterPivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.FilterPivotHierarchyData; } /** @@ -27515,6 +28023,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class DataPivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.DataPivotHierarchy[]; /** @@ -27574,6 +28084,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.DataPivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.DataPivotHierarchyCollection; load(option?: string | string[]): Excel.DataPivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.DataPivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.DataPivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataPivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.DataPivotHierarchyCollectionData; } /** @@ -27583,6 +28097,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class DataPivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the DataPivotHierarchy. @@ -27674,6 +28190,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DataPivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataPivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataPivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DataPivotHierarchyData; } /** @@ -27709,6 +28229,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotFieldCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotField[]; /** @@ -27754,6 +28276,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotFieldCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotFieldCollection; load(option?: string | string[]): Excel.PivotFieldCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotFieldCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotFieldCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotFieldCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotFieldCollectionData; } /** @@ -27763,6 +28289,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotField extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the PivotField. @@ -27820,7 +28348,7 @@ declare namespace Excel { * * @param sortby Represents whether the sorting is done in an ascending or descending order. */ - sortByLabels(sortby: Excel.SortBy): void; + sortByLabels(sortby: SortBy): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -27842,6 +28370,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotField; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotField object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotFieldData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotFieldData; } /** @@ -27851,6 +28383,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotItemCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotItem[]; /** @@ -27896,6 +28430,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotItemCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotItemCollection; load(option?: string | string[]): Excel.PivotItemCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotItemCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotItemCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotItemCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotItemCollectionData; } /** @@ -27905,6 +28443,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotItem extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Id of the PivotItem. @@ -27968,6 +28508,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotItem; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotItem object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotItemData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotItemData; } /** @@ -28073,7 +28617,7 @@ declare namespace Excel { product = "Product", /** * - * Aggregate using the count of numbers in the data, equivalent to the COUNTA function. + * Aggregate using the count of numbers in the data, equivalent to the COUNT function. * */ countNumbers = "CountNumbers", @@ -28214,6 +28758,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class DocumentProperties extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Gets the collection of custom properties of the workbook. Read only. @@ -28333,6 +28879,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DocumentProperties; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DocumentProperties object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DocumentPropertiesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DocumentPropertiesData; } /** @@ -28342,6 +28892,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class CustomProperty extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Gets the key of the custom property. Read only. @@ -28405,6 +28957,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CustomProperty; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CustomProperty object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomPropertyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CustomPropertyData; } /** @@ -28414,6 +28970,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class CustomPropertyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.CustomProperty[]; /** @@ -28476,6 +29034,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.CustomPropertyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.CustomPropertyCollection; load(option?: string | string[]): Excel.CustomPropertyCollection; load(option?: OfficeExtension.LoadOption): Excel.CustomPropertyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.CustomPropertyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomPropertyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.CustomPropertyCollectionData; } /** @@ -28485,6 +29047,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalFormatCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ConditionalFormat[]; /** @@ -28556,6 +29120,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ConditionalFormatCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ConditionalFormatCollection; load(option?: string | string[]): Excel.ConditionalFormatCollection; load(option?: OfficeExtension.LoadOption): Excel.ConditionalFormatCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ConditionalFormatCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalFormatCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ConditionalFormatCollectionData; } /** @@ -28565,6 +29133,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the cell value conditional format properties if the current conditional format is a CellValue type. @@ -28772,6 +29342,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalFormatData; } /** @@ -28781,6 +29355,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class DataBarConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Representation of all values to the left of the axis in an Excel data bar. Read-only. @@ -28873,6 +29449,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DataBarConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataBarConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataBarConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DataBarConditionalFormatData; } /** @@ -28882,6 +29462,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalDataBarPositiveFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -28939,6 +29521,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalDataBarPositiveFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalDataBarPositiveFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalDataBarPositiveFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalDataBarPositiveFormatData; } /** @@ -28948,6 +29534,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalDataBarNegativeFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -29012,6 +29600,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalDataBarNegativeFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalDataBarNegativeFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalDataBarNegativeFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalDataBarNegativeFormatData; } /** @@ -29043,6 +29635,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class CustomConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. Read-only. @@ -29092,6 +29686,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CustomConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CustomConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CustomConditionalFormatData; } /** @@ -29101,6 +29699,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalFormatRule extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The formula, if required, to evaluate the conditional format rule on. @@ -29157,6 +29757,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalFormatRule; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalFormatRule object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalFormatRuleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalFormatRuleData; } /** @@ -29166,6 +29770,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class IconSetConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * An array of Criteria and IconSets for the rules and potential custom icons for conditional icons. Note that for the first criterion only the custom icon can be modified, while type, formula, and operator will be ignored when set. @@ -29193,7 +29799,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.6] */ - style: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + style: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. * * @remarks @@ -29229,6 +29835,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.IconSetConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.IconSetConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.IconSetConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.IconSetConditionalFormatData; } /** @@ -29274,6 +29884,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ColorScaleConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The criteria of the color scale. Midpoint is optional when using a two point color scale. @@ -29323,6 +29935,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ColorScaleConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ColorScaleConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ColorScaleConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ColorScaleConditionalFormatData; } /** @@ -29390,6 +30006,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class TopBottomConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. Read-only. @@ -29439,6 +30057,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TopBottomConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TopBottomConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TopBottomConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TopBottomConditionalFormatData; } /** @@ -29470,6 +30092,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class PresetCriteriaConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. @@ -29519,6 +30143,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PresetCriteriaConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PresetCriteriaConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PresetCriteriaConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PresetCriteriaConditionalFormatData; } /** @@ -29543,6 +30171,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class TextConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. Read-only. @@ -29592,6 +30222,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TextConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TextConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TextConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TextConditionalFormatData; } /** @@ -29623,6 +30257,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class CellValueConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. @@ -29672,6 +30308,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CellValueConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CellValueConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CellValueConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CellValueConditionalFormatData; } /** @@ -29710,6 +30350,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Collection of border objects that apply to the overall conditional format range. Read-only. @@ -29773,6 +30415,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeFormatData; } /** @@ -29782,6 +30428,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeFont extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the bold status of font. @@ -29859,6 +30507,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeFont; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeFont object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeFontData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeFontData; } /** @@ -29868,6 +30520,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeFill extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the fill, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -29917,6 +30571,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeFill; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeFill object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeFillData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeFillData; } /** @@ -29926,6 +30584,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeBorder extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -29982,6 +30642,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeBorder; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeBorder object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeBorderData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeBorderData; } /** @@ -29991,6 +30655,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeBorderCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Gets the bottom border. Read-only. @@ -30073,6 +30739,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ConditionalRangeBorderCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ConditionalRangeBorderCollection; load(option?: string | string[]): Excel.ConditionalRangeBorderCollection; load(option?: OfficeExtension.LoadOption): Excel.ConditionalRangeBorderCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ConditionalRangeBorderCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeBorderCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ConditionalRangeBorderCollectionData; } /** @@ -30082,6 +30752,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class Style extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * A Border collection of four Border objects that represent the style of the four borders. @@ -30285,9 +30957,12 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Style; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Style object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.StyleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.StyleData; } - /** * * Represents a collection of all the styles. WARNING: The StyleCollection items array has a known issue when loading items from the collection. Do not use `StyleCollection.items`, any `load()` method, and the `toJSON()` method. @@ -30295,6 +30970,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class StyleCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * WARNING: The StyleCollection items array has a known issue when loading items from the collection. Do not use `StyleCollection.items`, any `load()` method, and the `toJSON()` method. */ @@ -30335,6 +31012,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class DataConnectionCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Refreshes all the Data Connections in the collection. @@ -30342,6 +31021,10 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ refreshAll(): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataConnectionCollection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataConnectionCollectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -30761,6 +31444,15 @@ declare namespace Excel { rows = "Rows", columns = "Columns", } + /** + * [Api set: ExcelApi 1.8] + */ + enum ChartSplitType { + splitByPosition = "SplitByPosition", + splitByValue = "SplitByValue", + splitByPercentValue = "SplitByPercentValue", + splitByCustomSplit = "SplitByCustomSplit", + } /** * [Api set: ExcelApi 1.8] */ @@ -31317,6 +32009,8 @@ declare namespace Excel { threeStars = "ThreeStars", threeTriangles = "ThreeTriangles", fiveBoxes = "FiveBoxes", + linkedEntityFinanceIcon = "LinkedEntityFinanceIcon", + linkedEntityMapIcon = "LinkedEntityMapIcon", } /** * [Api set: ExcelApi 1.2] @@ -31639,6 +32333,18 @@ declare namespace Excel { * */ visualChange = "VisualChange", + /** + * + * WorkbookAutoSaveSettingChanged represents the type of event registered on workbook, and occurs when there is an auto save setting change. + * + */ + workbookAutoSaveSettingChanged = "WorkbookAutoSaveSettingChanged", + /** + * + * WorksheetFormatChanged represents the type of event registered on worksheet, and occurs when there is a format changed. + * + */ + worksheetFormatChanged = "WorksheetFormatChanged", } /** * [Api set: ExcelApi 1.7] @@ -31836,6 +32542,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class FunctionResult extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Error value (such as "#DIV/0") representing the error. If the error string is not set, then the function succeeded, and its result is written to the Value field. The error is always in the English locale. @@ -31871,6 +32579,10 @@ declare namespace Excel { select?: string; expand?: string; }): FunctionResult; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original FunctionResult object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Interfaces.FunctionResultData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Interfaces.FunctionResultData; } /** @@ -31880,6 +32592,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class Functions extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the absolute value of a number, a number without its sign. @@ -35616,6 +36330,10 @@ declare namespace Excel { * @param sigma Is the population (known) standard deviation. If omitted, the sample standard deviation is used. */ z_Test(array: number | Excel.Range | Excel.RangeReference | Excel.FunctionResult, x: number | Excel.Range | Excel.RangeReference | Excel.FunctionResult, sigma?: number | Excel.Range | Excel.RangeReference | Excel.FunctionResult): FunctionResult; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Functions object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FunctionsData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -35633,6 +36351,7 @@ declare namespace Excel { invalidSelection = "InvalidSelection", itemAlreadyExists = "ItemAlreadyExists", itemNotFound = "ItemNotFound", + nonBlankCellOffSheet = "NonBlankCellOffSheet", notImplemented = "NotImplemented", unsupportedOperation = "UnsupportedOperation", invalidOperationInCellEditMode = "InvalidOperationInCellEditMode", @@ -36578,7 +37297,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.8] */ - splitType?: "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; + splitType?: Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; /** * * True if Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series. Read/Write. @@ -36738,13 +37457,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ categoryType?: Excel.ChartAxisCategoryType | "Automatic" | "TextAxis" | "DateAxis"; - /** - * [DEPRECATED; kept for back-compat with existing first-party solutions]. Please use `Position` instead. - * Represents the specified axis where the other axis crosses. See Excel.ChartAxisPosition for details. - * - * [Api set: ExcelApi 1.7] - */ - crosses?: Excel.ChartAxisPosition | "Automatic" | "Maximum" | "Minimum" | "Custom"; /** * * Represents the axis display unit. See Excel.ChartAxisDisplayUnit for details. @@ -38441,7 +39153,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.6] */ - style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; } /** An interface for updating data on the ColorScaleConditionalFormat object, for use in "colorScaleConditionalFormat.set({ ... })". */ interface ColorScaleConditionalFormatUpdateData { @@ -38818,13 +39530,6 @@ declare namespace Excel { } /** An interface describing the data returned by calling "workbook.toJSON()". */ interface WorkbookData { - /** - * - * Represents the Excel application instance that contains this workbook. Read-only. - * - * [Api set: ExcelApi 1.1] - */ - application?: Excel.Interfaces.ApplicationData; /** * * Represents a collection of bindings that are part of the workbook. Read-only. @@ -38922,13 +39627,6 @@ declare namespace Excel { } /** An interface describing the data returned by calling "workbookCreated.toJSON()". */ interface WorkbookCreatedData { - /** - * - * Returns a value that uniquely identifies the WorkbookCreated object. - * - * [Api set: ExcelApi 1.8] - */ - id?: string; } /** An interface describing the data returned by calling "worksheet.toJSON()". */ interface WorksheetData { @@ -39080,13 +39778,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ format?: Excel.Interfaces.RangeFormatData; - /** - * - * The worksheet containing the current range. Read-only. - * - * [Api set: ExcelApi 1.1] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). Read-only. @@ -39375,20 +40066,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ arrayValues?: Excel.Interfaces.NamedItemArrayValuesData; - /** - * - * Returns the worksheet on which the named item is scoped to. Throws an error if the item is scoped to the workbook instead. - * - * [Api set: ExcelApi 1.4] - */ - worksheet?: Excel.Interfaces.WorksheetData; - /** - * - * Returns the worksheet on which the named item is scoped to. Returns a null object if the item is scoped to the workbook instead. - * - * [Api set: ExcelApi 1.4] - */ - worksheetOrNullObject?: Excel.Interfaces.WorksheetData; /** * * Represents the comment associated with this name. @@ -39504,13 +40181,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ sort?: Excel.Interfaces.TableSortData; - /** - * - * The worksheet containing the current table. Read-only. - * - * [Api set: ExcelApi 1.2] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Indicates whether the first column contains special formatting. @@ -39956,13 +40626,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ title?: Excel.Interfaces.ChartTitleData; - /** - * - * The worksheet containing the current chart. Read-only. - * - * [Api set: ExcelApi 1.2] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Returns or sets a ChartCategoryLabelLevel enumeration constant referring to @@ -40265,7 +40928,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.8] */ - splitType?: "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; + splitType?: Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; /** * * True if Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series. Read/Write. @@ -40439,20 +41102,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ categoryType?: Excel.ChartAxisCategoryType | "Automatic" | "TextAxis" | "DateAxis"; - /** - * [DEPRECATED; kept for back-compat with existing first-party solutions]. Please use `Position` instead. - * Represents the specified axis where the other axis crosses. See Excel.ChartAxisPosition for details. - * - * [Api set: ExcelApi 1.7] - */ - crosses?: Excel.ChartAxisPosition | "Automatic" | "Maximum" | "Minimum" | "Custom"; - /** - * [DEPRECATED; kept for back-compat with existing first-party solutions]. Please use `PositionAt` instead. - * Represents the specified axis where the other axis crosses at. Read Only. Set to this property should use SetCrossesAt(double) method. - * - * [Api set: ExcelApi 1.7] - */ - crossesAt?: number; /** * * Represents the custom axis display unit value. Read-only. To set this property, please use the SetCustomDisplayUnit(double) method. @@ -41745,25 +42394,11 @@ declare namespace Excel { hierarchies?: Excel.Interfaces.PivotHierarchyData[]; /** * - * The PivotLayout describing the layout and visual structure of the PivotTable. - * - * [Api set: ExcelApi 1.8] - */ - layout?: Excel.Interfaces.PivotLayoutData; - /** - * * The Row Pivot Hierarchies of the PivotTable. * * [Api set: ExcelApi 1.8] */ rowHierarchies?: Excel.Interfaces.RowColumnPivotHierarchyData[]; - /** - * - * The worksheet containing the current PivotTable. - * - * [Api set: ExcelApi 1.3] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Id of the PivotTable. Read-only. @@ -42508,7 +43143,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.6] */ - style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; } /** An interface describing the data returned by calling "colorScaleConditionalFormat.toJSON()". */ interface ColorScaleConditionalFormatData { @@ -49004,6 +49639,7 @@ declare namespace Excel { + //////////////////////////////////////////////////////////////// From 8515615be78eecfcf2918b197d38e0a2236d382e Mon Sep 17 00:00:00 2001 From: Andy Chen Date: Wed, 9 Jan 2019 14:59:47 -0800 Subject: [PATCH 242/646] fix missing variable in type defination --- types/sharp/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/sharp/index.d.ts b/types/sharp/index.d.ts index f461f4c429..a7cfeedfd0 100644 --- a/types/sharp/index.d.ts +++ b/types/sharp/index.d.ts @@ -98,6 +98,7 @@ declare namespace sharp { const gravity: GravityEnum; const strategy: StrategyEnum; const kernel: KernelEnum; + const fit: FitEnum; const bool: BoolEnum; interface Sharp extends Duplex { From 901587f71fec2d696a96c236f4252f51940e9b5e Mon Sep 17 00:00:00 2001 From: M0Bruno Date: Thu, 10 Jan 2019 00:18:28 +0100 Subject: [PATCH 243/646] fix typo on "readOnly" props --- types/react-draft-wysiwyg/index.d.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/types/react-draft-wysiwyg/index.d.ts b/types/react-draft-wysiwyg/index.d.ts index a5c6e07065..938cd236ee 100644 --- a/types/react-draft-wysiwyg/index.d.ts +++ b/types/react-draft-wysiwyg/index.d.ts @@ -1,11 +1,12 @@ // Type definitions for react-draft-wysiwyg 1.12 // Project: https://github.com/jpuri/react-draft-wysiwyg#readme // Definitions by: imechZhangLY +// brunoMaurice // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import * as React from 'react'; -import * as Draft from 'draft-js'; +import * as React from "react"; +import * as Draft from "draft-js"; export type SyntheticKeyboardEvent = React.KeyboardEvent<{}>; export type SyntheticEvent = React.SyntheticEvent<{}>; @@ -51,7 +52,7 @@ export interface EditorProps { mention?: object; hashtag?: object; textAlignment?: string; - readonly?: boolean; + readOnly?: boolean; tabIndex?: number; placeholder?: string; ariaLabel?: string; @@ -65,7 +66,12 @@ export interface EditorProps { wrapperId?: number; customDecorators?: object[]; editorRef?(ref: object): void; - handlePastedText?(text: string, html: string, editorState: EditorState, onChange: (editorState: EditorState) => void): boolean; + handlePastedText?( + text: string, + html: string, + editorState: EditorState, + onChange: (editorState: EditorState) => void + ): boolean; } export class Editor extends React.Component { From 44b9084edaab31dd9e347b57bb23bcb6d0751e50 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Thu, 10 Jan 2019 01:05:01 +0100 Subject: [PATCH 244/646] [string-similarity] Move v1 types to sub-dir --- types/string-similarity/{ => v1}/index.d.ts | 0 .../{ => v1}/string-similarity-tests.ts | 0 types/string-similarity/{ => v1}/tsconfig.json | 11 ++++++++--- types/string-similarity/{ => v1}/tslint.json | 0 4 files changed, 8 insertions(+), 3 deletions(-) rename types/string-similarity/{ => v1}/index.d.ts (100%) rename types/string-similarity/{ => v1}/string-similarity-tests.ts (100%) rename types/string-similarity/{ => v1}/tsconfig.json (72%) rename types/string-similarity/{ => v1}/tslint.json (100%) diff --git a/types/string-similarity/index.d.ts b/types/string-similarity/v1/index.d.ts similarity index 100% rename from types/string-similarity/index.d.ts rename to types/string-similarity/v1/index.d.ts diff --git a/types/string-similarity/string-similarity-tests.ts b/types/string-similarity/v1/string-similarity-tests.ts similarity index 100% rename from types/string-similarity/string-similarity-tests.ts rename to types/string-similarity/v1/string-similarity-tests.ts diff --git a/types/string-similarity/tsconfig.json b/types/string-similarity/v1/tsconfig.json similarity index 72% rename from types/string-similarity/tsconfig.json rename to types/string-similarity/v1/tsconfig.json index a2a3f2f5eb..7b2f445d02 100644 --- a/types/string-similarity/tsconfig.json +++ b/types/string-similarity/v1/tsconfig.json @@ -8,10 +8,15 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], + "paths": { + "string-similarity": [ + "string-similarity/v1" + ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -20,4 +25,4 @@ "index.d.ts", "string-similarity-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/string-similarity/tslint.json b/types/string-similarity/v1/tslint.json similarity index 100% rename from types/string-similarity/tslint.json rename to types/string-similarity/v1/tslint.json From 7958a0ac4fab4a0aa2050e31b39867cd4f22f584 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Thu, 10 Jan 2019 01:14:11 +0100 Subject: [PATCH 245/646] [string-similarity] Add types for v3 --- types/string-similarity/index.d.ts | 36 +++++++++++++++++++ .../string-similarity-tests.ts | 27 ++++++++++++++ types/string-similarity/tsconfig.json | 23 ++++++++++++ types/string-similarity/tslint.json | 1 + 4 files changed, 87 insertions(+) create mode 100644 types/string-similarity/index.d.ts create mode 100644 types/string-similarity/string-similarity-tests.ts create mode 100644 types/string-similarity/tsconfig.json create mode 100644 types/string-similarity/tslint.json diff --git a/types/string-similarity/index.d.ts b/types/string-similarity/index.d.ts new file mode 100644 index 0000000000..d38ecc9f4f --- /dev/null +++ b/types/string-similarity/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for string-similarity 3.0 +// Project: https://github.com/aceakash/string-similarity#readme +// Definitions by: ragtime +// BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Returns a fraction between 0 and 1, which indicates the degree of similarity between the two strings. + * `0` indicates completely different strings, `1` indicates identical strings. The comparison is case-insensitive. + * + * @param string1 The first string + * @param string2 The second string + * @returns A fraction from 0 to 1, both inclusive. Higher number indicates more similarity. + */ +export function compareTwoStrings(string1: string, string2: string): number; + +/** + * Compares `mainString` against each string in `targetStrings`. + * + * @argument mainString: The string to match each target string against. + * @argument targetStrings: Each string in this array will be matched against the main string. + * @returns An object with a `ratings` property, which gives a similarity rating for each target string, + * a `bestMatch` property, which specifies which target string was most similar to the main string, + * and a `bestMatchIndex` property, which specifies the index of the `bestMatch` in the `targetStrings` array. + */ +export function findBestMatch(mainString: string, targetStrings: string[]): BestMatch; + +export interface Rating { + target: string; + rating: number; +} +export interface BestMatch { + ratings: Rating[]; + bestMatch: Rating; + bestMatchIndex: number; +} diff --git a/types/string-similarity/string-similarity-tests.ts b/types/string-similarity/string-similarity-tests.ts new file mode 100644 index 0000000000..06ae159f35 --- /dev/null +++ b/types/string-similarity/string-similarity-tests.ts @@ -0,0 +1,27 @@ +import stringSimilarity = require('string-similarity'); + +stringSimilarity.compareTwoStrings('test', 'test'); // $ExpectType number + +const match = stringSimilarity.findBestMatch( + 'Olive-green table for sale, in extremely good condition.', + [ + 'For sale: green Subaru Impreza, 210,000 miles', + 'For sale: table in very good condition, olive green in colour.', + 'Wanted: mountain bike with at least 21 gears.', + ] +); + +match; // $ExpectType BestMatch +match.ratings; // $ExpectType Rating[] +match.bestMatch; // $ExpectType Rating +match.bestMatchIndex; // $ExpectType number + +// ratings accessible +for (const rating of match.ratings) { + rating.target; // $ExpectType string + rating.rating; // $ExpectType number +} + +// bestMatch accessible +match.bestMatch.rating; +match.bestMatch.target; diff --git a/types/string-similarity/tsconfig.json b/types/string-similarity/tsconfig.json new file mode 100644 index 0000000000..a1d43553cb --- /dev/null +++ b/types/string-similarity/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", + "string-similarity-tests.ts" + ] +} diff --git a/types/string-similarity/tslint.json b/types/string-similarity/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/string-similarity/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 501329c62e59636fb72db3c6ae28a6728de8c30d Mon Sep 17 00:00:00 2001 From: Colin King Date: Wed, 9 Jan 2019 16:54:33 -0800 Subject: [PATCH 246/646] Make integrations values more permissive --- types/analytics-node/analytics-node-tests.ts | 14 ++++++++++---- types/analytics-node/index.d.ts | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/types/analytics-node/analytics-node-tests.ts b/types/analytics-node/analytics-node-tests.ts index 6740aaccff..7ad1e372ff 100644 --- a/types/analytics-node/analytics-node-tests.ts +++ b/types/analytics-node/analytics-node-tests.ts @@ -135,22 +135,28 @@ function testGroup(): void { function testIntegrations(): void { analytics.track({ - event: 'Upgraded Membershipt', + event: 'Upgraded Membership', userId: '97234974', integrations: { 'All': false, 'Vero': true, - 'Google Analytics': false + 'Google Analytics': false, + 'AppsFlyer': { + 'appsflyer_id': 'example-id' + } } }); analytics.track({ - event: 'Upgraded Membershipt', + event: 'Upgraded Membership', userId: '97234974', integrations: { 'All': false, 'Vero': true, - 'Google Analytics': false + 'Google Analytics': false, + 'AppsFlyer': { + 'appsflyer_id': 'example-id' + } } }, (err, data) => { if (err) { diff --git a/types/analytics-node/index.d.ts b/types/analytics-node/index.d.ts index cc9e5386e2..7b70f21571 100644 --- a/types/analytics-node/index.d.ts +++ b/types/analytics-node/index.d.ts @@ -33,9 +33,11 @@ declare namespace AnalyticsNode { } interface Integrations { - [index: string]: boolean; + [integration_name: string]: IntegrationValue } + type IntegrationValue = boolean | { [integration_key: string] : any }; + export class Analytics { constructor(writeKey: string, opts?: { flushAt?: number, From 89d5b23f199598c63aabb4327f38ad483a5ce0e0 Mon Sep 17 00:00:00 2001 From: Cody Eilar Date: Wed, 9 Jan 2019 21:59:09 -0700 Subject: [PATCH 247/646] Fix type for tag Tag is not a Uint8Array but rather a number. --- types/libsodium-wrappers/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/libsodium-wrappers/index.d.ts b/types/libsodium-wrappers/index.d.ts index e9213da782..7bdc066501 100644 --- a/types/libsodium-wrappers/index.d.ts +++ b/types/libsodium-wrappers/index.d.ts @@ -890,14 +890,14 @@ export function crypto_secretstream_xchacha20poly1305_pull( cipher?: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: Uint8ArrayOutputFormat | null, -): { message: Uint8Array; tag: Uint8Array }; +): { message: Uint8Array; tag: number }; export function crypto_secretstream_xchacha20poly1305_pull( state_address?: secretstream_xchacha20poly1305_state_address, cipher?: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: StringOutputFormat | null, -): { message: string; tag: Uint8Array }; +): { message: string; tag: number }; export function crypto_secretstream_xchacha20poly1305_push( state_address?: secretstream_xchacha20poly1305_state_address, From 7aa45c4b2c2c12e39d092f4cc2201855f3836411 Mon Sep 17 00:00:00 2001 From: Usira Asanka Kodithuwakku Date: Thu, 10 Jan 2019 11:59:00 +0530 Subject: [PATCH 248/646] Update index.d.ts Add resource param which is required for create folders --- types/gapi.client.drive/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/gapi.client.drive/index.d.ts b/types/gapi.client.drive/index.d.ts index 1b2a939a7d..ca28f228e7 100644 --- a/types/gapi.client.drive/index.d.ts +++ b/types/gapi.client.drive/index.d.ts @@ -1042,6 +1042,8 @@ declare namespace gapi.client { }): Request; /** Creates a new file. */ create(request: { + /** Resource Parameter for folder creation */ + resource?: any; /** Data format for the response. */ alt?: string; /** Selector specifying which fields to include in a partial response. */ From 1d7a611d80963df33626ad4cf109e309239645e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 09:35:07 +0200 Subject: [PATCH 249/646] fix: Transaction Memo type --- types/stellar-sdk/index.d.ts | 2 +- types/stellar-sdk/stellar-sdk-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index d632b6c0a2..bd28677bf0 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -371,7 +371,7 @@ export namespace StellarBase { function decodeSha256Hash(data: string): Buffer; } - class Transaction { + class Transaction { constructor(envelope: string | xdr.TransactionEnvelope) hash(): Buffer; sign(...keypairs: Keypair[]): void; diff --git a/types/stellar-sdk/stellar-sdk-tests.ts b/types/stellar-sdk/stellar-sdk-tests.ts index 143ccdaba4..2533fefaa4 100644 --- a/types/stellar-sdk/stellar-sdk-tests.ts +++ b/types/stellar-sdk/stellar-sdk-tests.ts @@ -6,7 +6,7 @@ const account = new StellarSdk.Account(sourceKey.publicKey(), '1'); const transaction = new StellarSdk.TransactionBuilder(account) .addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()})) .addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo")) - .build(); // $ExpectType () => Transaction + .build(); // $ExpectType () => Transaction, TransactionOperation[]> StellarSdk.StellarTomlResolver.resolve("example.com", {allowHttp: true, timeout: 100}) .then(toml => toml.FEDERATION_SERVER); From f61e047579989394203e074e8c54064fabe56fab Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 10 Jan 2019 08:50:14 +0100 Subject: [PATCH 250/646] react-is: fix type guard return type --- types/react-is/index.d.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/types/react-is/index.d.ts b/types/react-is/index.d.ts index b7cce65e18..962d3e1a13 100644 --- a/types/react-is/index.d.ts +++ b/types/react-is/index.d.ts @@ -8,7 +8,12 @@ export as namespace ReactIs; -import { ReactElement, ReactType } from 'react'; +import { + LazyExoticComponent, + MemoExoticComponent, + ReactElement, + ReactType +} from "react"; export function typeOf(value: any): symbol | undefined; export function isValidElementType(value: any): value is ReactType; @@ -18,8 +23,8 @@ export function isContextProvider(value: any): value is ReactElement; export function isElement(value: any): value is ReactElement; export function isForwardRef(value: any): value is ReactElement; export function isFragment(value: any): value is ReactElement; -export function isLazy(value: any): value is ReactElement; -export function isMemo(value: any): value is ReactElement; +export function isLazy(value: any): value is LazyExoticComponent; +export function isMemo(value: any): value is MemoExoticComponent; export function isProfiler(value: any): value is ReactElement; export function isPortal(value: any): value is ReactElement; export function isStrictMode(value: any): value is ReactElement; From 1364dee3e6ac5129d493c84dc72fb8be59b419b6 Mon Sep 17 00:00:00 2001 From: M0Bruno Date: Thu, 10 Jan 2019 10:15:30 +0100 Subject: [PATCH 251/646] apply lint --- types/react-draft-wysiwyg/index.d.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/types/react-draft-wysiwyg/index.d.ts b/types/react-draft-wysiwyg/index.d.ts index 938cd236ee..7b9b3577d8 100644 --- a/types/react-draft-wysiwyg/index.d.ts +++ b/types/react-draft-wysiwyg/index.d.ts @@ -5,8 +5,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import * as React from "react"; -import * as Draft from "draft-js"; +import * as React from 'react'; +import * as Draft from 'draft-js'; export type SyntheticKeyboardEvent = React.KeyboardEvent<{}>; export type SyntheticEvent = React.SyntheticEvent<{}>; @@ -66,12 +66,7 @@ export interface EditorProps { wrapperId?: number; customDecorators?: object[]; editorRef?(ref: object): void; - handlePastedText?( - text: string, - html: string, - editorState: EditorState, - onChange: (editorState: EditorState) => void - ): boolean; + handlePastedText?(text: string, html: string, editorState: EditorState, onChange: (editorState: EditorState) => void): boolean; } export class Editor extends React.Component { From 9d2b982eaa6fb6a8bd71b693a9c21febcc48ccad Mon Sep 17 00:00:00 2001 From: Luminos MacBook Pro Date: Thu, 10 Jan 2019 11:29:17 +0200 Subject: [PATCH 252/646] Add priority to react-native-push-nottification --- types/react-native-push-notification/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/react-native-push-notification/index.d.ts b/types/react-native-push-notification/index.d.ts index 4f58cd7385..825d5d11e6 100644 --- a/types/react-native-push-notification/index.d.ts +++ b/types/react-native-push-notification/index.d.ts @@ -14,7 +14,7 @@ export interface PushNotificationPermissions { export interface PushNotification { foreground: boolean; userInteraction: boolean; - message: string|object; + message: string | object; data: object; badge: number; alert: object; @@ -23,7 +23,7 @@ export interface PushNotification { } export interface PushNotificationOptions { - onRegister?: (token: { os: string, token: string }) => void; + onRegister?: (token: { os: string; token: string }) => void; onNotification?: (notification: PushNotification) => void; senderID?: string; permissions?: PushNotificationPermissions; @@ -31,6 +31,7 @@ export interface PushNotificationOptions { requestPermissions?: boolean; } +export type PriorityType = 'max' | 'high' | 'low' | 'min' | 'default'; export type RepeatType = 'week' | 'day' | 'hour' | 'minute' | 'time'; export class PushNotificationObject { @@ -48,6 +49,7 @@ export class PushNotificationObject { tag?: string; group?: string; ongoing?: boolean; + priority?: PriorityType; /* iOS only properties */ alertAction?: any; From 4ede6d6049ab82bcd711e72b2ee47d0c52754e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 10:31:50 +0200 Subject: [PATCH 253/646] feat: new module stellar-base --- types/stellar-base/index.d.ts | 439 ++++++++++++++++++++ types/stellar-base/stellar-base-tests.ts | 40 ++ types/stellar-base/tsconfig.json | 23 ++ types/stellar-base/tslint.json | 3 + types/stellar-sdk/index.d.ts | 488 ++--------------------- types/stellar-sdk/stellar-sdk-tests.ts | 39 -- 6 files changed, 537 insertions(+), 495 deletions(-) create mode 100644 types/stellar-base/index.d.ts create mode 100644 types/stellar-base/stellar-base-tests.ts create mode 100644 types/stellar-base/tsconfig.json create mode 100644 types/stellar-base/tslint.json diff --git a/types/stellar-base/index.d.ts b/types/stellar-base/index.d.ts new file mode 100644 index 0000000000..4b86065c40 --- /dev/null +++ b/types/stellar-base/index.d.ts @@ -0,0 +1,439 @@ +// Type definitions for stellar-base 0.10 +// Project: https://github.com/stellar/js-stellar-sdk +// Definitions by: Carl Foster +// Triston Jones +// Paul Selden +// Max Bause +// Timur Ramazanov +// Kalvis Kalniņš +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +/// + +export class Account { + constructor(accountId: string, sequence: string | number) + accountId(): string; + sequenceNumber(): string; + incrementSequenceNumber(): void; +} + +export enum ASSET_TYPE { + native = 'native', + credit4 = 'credit_alphanum4', + credit12 = 'credit_alphanum12', +} +export class Asset { + static native(): Asset; + static fromOperation(xdr: xdr.Asset): Asset; + + constructor(code: string, issuer: string); + + getCode(): string; + getIssuer(): string; + getAssetType(): ASSET_TYPE; + isNative(): boolean; + equals(other: Asset): boolean; + toXDRObject(): xdr.Asset; + + code: string; + issuer: string; +} + +export const FastSigning: boolean; + +export class Keypair { + static fromRawEd25519Seed(secretSeed: Buffer): Keypair; + static fromBase58Seed(secretSeed: string): Keypair; + static fromSecret(secretKey: string): Keypair; + static master(): Keypair; + static fromPublicKey(publicKey: string): Keypair; + static random(): Keypair; + + constructor(keys: { type: 'ed25519', secretKey: string } | { type: 'ed25519', Key: string }) + + publicKey(): string; + secret(): string; + rawPublicKey(): Buffer; + rawSecretKey(): Buffer; + canSign(): boolean; + sign(data: Buffer): Buffer; + signDecorated(data: Buffer): xdr.DecoratedSignature; + signatureHint(): xdr.SignatureHint; + verify(data: Buffer, signature: Buffer): boolean; +} + +export const MemoNone = 'none'; +export const MemoID = 'id'; +export const MemoText = 'text'; +export const MemoHash = 'hash'; +export const MemoReturn = 'return'; +export type MemoNone = 'none'; +export type MemoID = 'id'; +export type MemoText = 'text'; +export type MemoHash = 'hash'; +export type MemoReturn = 'return'; +export class Memo { + static fromXDRObject(memo: xdr.Memo): Memo; + static hash(hash: string): Memo; + static id(id: string): Memo; + static none(): Memo; + static return(hash: string): Memo; + static text(text: string): Memo; + + constructor(type: MemoNone, value?: null); + constructor(type: MemoHash | MemoReturn, value: Buffer) + constructor(type: MemoHash | MemoReturn | MemoID | MemoText, value: string) + constructor(type: T, value: Memo.AnyValue) + + type: T; + value: + T extends MemoNone ? null : + T extends MemoID ? string : + T extends MemoText ? string : + T extends MemoHash ? Buffer : + T extends MemoReturn ? Buffer : + Memo.AnyValue; + + toXDRObject(): xdr.Memo; +} +export namespace Memo { + type AnyType = MemoNone | MemoID | MemoText | MemoHash | MemoReturn; + type AnyValue = null | string | Buffer; +} + +export enum Networks { + PUBLIC = 'Public Global Stellar Network ; September 2015', + TESTNET = 'Test SDF Network ; September 2015', +} + +export class Network { + static use(network: Network): void; + static usePublicNetwork(): void; + static useTestNetwork(): void; + static current(): Network; + + constructor(passphrase: string) + + networkPassphrase(): string; + networkId(): string; +} + +export const AuthRequiredFlag: 1; +export const AuthRevocableFlag: 2; +export const AuthImmutableFlag: 4; + +export type TransactionOperation = + Operation.CreateAccount + | Operation.Payment + | Operation.PathPayment + | Operation.CreatePassiveOffer + | Operation.ManageOffer + | Operation.SetOptions + | Operation.ChangeTrust + | Operation.AllowTrust + | Operation.AccountMerge + | Operation.Inflation + | Operation.ManageData + | Operation.BumpSequence; + +export enum OperationType { + createAccount = 'createAccount', + payment = 'payment', + pathPayment = 'pathPayment', + createPassiveOffer = 'createPassiveOffer', + manageOffer = 'manageOffer', + setOptions = 'setOptions', + changeTrust = 'changeTrust', + allowTrust = 'allowTrust', + accountMerge = 'accountMerge', + inflation = 'inflation', + manageData = 'manageData', + bumpSequence = 'bumpSequence', +} + +export namespace Operation { + interface Operation { + type: T; + source?: string; + } + interface OperationOptions { + source?: string; + } + + interface AccountMerge extends Operation { + destination: string; + } + interface AccountMergeOptions extends OperationOptions { + destination: string; + } + function accountMerge(options: AccountMergeOptions): xdr.Operation; + + interface AllowTrust extends Operation { + trustor: string; + assetCode: string; + authorize: boolean | undefined; + } + interface AllowTrustOptions extends OperationOptions { + trustor: string; + assetCode: string; + authorize?: boolean; + } + function allowTrust(options: AllowTrustOptions): xdr.Operation; + + interface ChangeTrust extends Operation { + line: Asset; + limit: string; + } + interface ChangeTrustOptions extends OperationOptions { + asset: Asset; + limit?: string; + } + function changeTrust(options: ChangeTrustOptions): xdr.Operation; + + interface CreateAccount extends Operation { + destination: string; + startingBalance: string; + } + interface CreateAccountOptions extends OperationOptions { + destination: string; + startingBalance: string; + } + function createAccount(options: CreateAccountOptions): xdr.Operation; + + interface CreatePassiveOffer extends Operation { + selling: Asset; + buying: Asset; + amount: string; + price: string; + } + interface CreatePassiveOfferOptions extends OperationOptions { + selling: Asset; + buying: Asset; + amount: string; + price: number | string | object /* bignumber.js */; + } + function createPassiveOffer(options: CreatePassiveOfferOptions): xdr.Operation; + + interface Inflation extends Operation { + } + interface InflationOptions extends OperationOptions { // tslint:disable-line + } + function inflation(options: InflationOptions): xdr.Operation; + + interface ManageData extends Operation { + name: string; + value: Buffer; + } + interface ManageDataOptions extends OperationOptions { + name: string; + value: string | Buffer; + } + function manageData(options: ManageDataOptions): xdr.Operation; + + interface ManageOffer extends Operation { + selling: Asset; + buying: Asset; + amount: string; + price: string; + offerId: string; + } + interface ManageOfferOptions extends CreatePassiveOfferOptions { + offerId?: number | string; + } + function manageOffer(options: ManageOfferOptions): xdr.Operation; + + interface PathPayment extends Operation { + sendAsset: Asset; + sendMax: string; + destination: string; + destAsset: Asset; + destAmount: string; + path: Asset[]; + } + interface PathPaymentOptions extends OperationOptions { + sendAsset: Asset; + sendMax: string; + destination: string; + destAsset: Asset; + destAmount: string; + path?: Asset[]; + } + function pathPayment(options: PathPaymentOptions): xdr.Operation; + + interface Payment extends Operation { + amount: string; + asset: Asset; + destination: string; + } + interface PaymentOptions extends OperationOptions { + amount: string; + asset: Asset; + destination: string; + } + function payment(options: PaymentOptions): xdr.Operation; + + /* + * Required = 1 << 0 + * Revocable = 1 << 1 + * Immutable = 1 << 2 + */ + enum AuthFlags { + Required = 1, + Revocable = 2, + Immutable = 4, + } + interface SignerEd25519PublicKey { + ed25519PublicKey: string; + weight: number | undefined; + } + interface SignerSha256Hash { + sha256Hash: Buffer; + weight: number | undefined; + } + interface SignerPreAuthTx { + preAuthTx: Buffer; + weight: number | undefined; + } + type Signer = SignerEd25519PublicKey | SignerSha256Hash | SignerPreAuthTx; + interface SignerEd25519PublicKeyOptions { + ed25519PublicKey: string; + weight?: number | string; + } + interface SignerSha256HashOptions { + sha256Hash: Buffer | string; + weight?: number | string; + } + interface SignerPreAuthTxOptions { + preAuthTx: Buffer | string; + weight?: number | string; + } + type SignerOptions = SignerEd25519PublicKeyOptions | SignerSha256HashOptions | SignerPreAuthTxOptions; + type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; + interface SetOptions extends Operation { + inflationDest?: string; + clearFlags?: AuthFlags; + setFlags?: AuthFlags; + masterWeight?: number; + lowThreshold?: number; + medThreshold?: number; + highThreshold?: number; + homeDomain?: string; + signer: + T extends {ed25519PublicKey: any} ? SignerEd25519PublicKey : + T extends {sha256Hash: any} ? SignerSha256Hash : + T extends {preAuthTx: any} ? SignerPreAuthTx : + never; + } + interface SetOptionsOptions extends OperationOptions { + inflationDest?: string; + clearFlags?: AuthFlags; + setFlags?: AuthFlags; + masterWeight?: number | string; + lowThreshold?: number | string; + medThreshold?: number | string; + highThreshold?: number | string; + homeDomain?: string; + signer?: T; + } + function setOptions(options: SetOptionsOptions): xdr.Operation>; + + interface BumpSequence extends Operation { + bumpTo: string; + } + interface BumpSequenceOptions extends OperationOptions { + bumpTo: string; + } + function bumpSequence(options: BumpSequenceOptions): xdr.Operation; + + function fromXDRObject(xdrOperation: xdr.Operation): T; +} + +export namespace StrKey { + function encodeEd25519PublicKey(data: Buffer): string; + function decodeEd25519PublicKey(data: string): Buffer; + function isValidEd25519PublicKey(Key: string): boolean; + + function encodeEd25519SecretSeed(data: Buffer): string; + function decodeEd25519SecretSeed(data: string): Buffer; + function isValidEd25519SecretSeed(seed: string): boolean; + + function encodePreAuthTx(data: Buffer): string; + function decodePreAuthTx(data: string): Buffer; + + function encodeSha256Hash(data: Buffer): string; + function decodeSha256Hash(data: string): Buffer; +} + +export class Transaction { + constructor(envelope: string | xdr.TransactionEnvelope) + hash(): Buffer; + sign(...keypairs: Keypair[]): void; + signatureBase(): Buffer; + signHashX(preimage: Buffer | string): void; + toEnvelope(): xdr.TransactionEnvelope; + + operations: TOps; + sequence: number; + fee: number; + source: string; + memo: TMemo; + signatures: xdr.DecoratedSignature[]; +} + +export class TransactionBuilder { + constructor(sourceAccount: Account, options?: TransactionBuilder.TransactionBuilderOptions) + addOperation(operation: xdr.Operation): this; + addMemo(memo: Memo): this; + build(): Transaction; +} + +export namespace TransactionBuilder { + interface TransactionBuilderOptions { + fee?: number; + timebounds?: { + minTime?: number | string + maxTime?: number | string + }; + memo?: Memo; + } +} + +export namespace xdr { + class XDRStruct { + static fromXDR(xdr: Buffer): XDRStruct; + + toXDR(base?: string): Buffer; + toXDR(encoding: string): string; + } + class Operation extends XDRStruct { + static fromXDR(xdr: Buffer): Operation; + } + class Asset extends XDRStruct { + static fromXDR(xdr: Buffer): Asset; + } + class Memo extends XDRStruct { + static fromXDR(xdr: Buffer): Memo; + } + class TransactionEnvelope extends XDRStruct { + static fromXDR(xdr: Buffer): TransactionEnvelope; + } + class DecoratedSignature extends XDRStruct { + static fromXDR(xdr: Buffer): DecoratedSignature; + + constructor(keys: { hint: SignatureHint, signature: Signature }) + + hint(): SignatureHint; + signature(): Buffer; + } + type SignatureHint = Buffer; + type Signature = Buffer; + + class TransactionResult extends XDRStruct { + static fromXDR(xdr: Buffer): TransactionResult; + } +} + +export function hash(data: Buffer): Buffer; +export function sign(data: Buffer, rawSecret: Buffer): Buffer; +export function verify(data: Buffer, signature: Buffer, rawPublicKey: Buffer): boolean; diff --git a/types/stellar-base/stellar-base-tests.ts b/types/stellar-base/stellar-base-tests.ts new file mode 100644 index 0000000000..0a8176919c --- /dev/null +++ b/types/stellar-base/stellar-base-tests.ts @@ -0,0 +1,40 @@ +import * as StellarSdk from 'stellar-base'; + +const sourceKey = StellarSdk.Keypair.random(); // $ExpectType Keypair +const destKey = StellarSdk.Keypair.random(); +const account = new StellarSdk.Account(sourceKey.publicKey(), '1'); +const transaction = new StellarSdk.TransactionBuilder(account) + .addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()})) + .addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo")) + .build(); // $ExpectType () => Transaction, TransactionOperation[]> + +const sig = StellarSdk.xdr.DecoratedSignature.fromXDR(Buffer.of(1, 2)); // $ExpectType DecoratedSignature +sig.hint(); // $ExpectType Buffer +sig.signature(); // $ExpectType Buffer + +StellarSdk.Memo.none(); // $ExpectType Memo<"none"> +StellarSdk.Memo.text('asdf'); // $ExpectType Memo<"text"> +StellarSdk.Memo.id('asdf'); // $ExpectType Memo<"id"> +StellarSdk.Memo.return('asdf'); // $ExpectType Memo<"return"> +StellarSdk.Memo.hash('asdf'); // $ExpectType Memo<"hash"> +StellarSdk.Memo.none().value; // $ExpectType null +StellarSdk.Memo.id('asdf').value; // $ExpectType string +StellarSdk.Memo.text('asdf').value; // $ExpectType string +StellarSdk.Memo.return('asdf').value; // $ExpectType Buffer +StellarSdk.Memo.hash('asdf').value; // $ExpectType Buffer + +// P.S. don't use Memo constructor +(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).value; // $ExpectType AnyValue +(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).type; // $ExpectType AnyType + +const noSignerXDR = StellarSdk.Operation.setOptions({lowThreshold: 1}); +StellarSdk.Operation.fromXDRObject(noSignerXDR).signer; // $ExpectType never + +const newSignerXDR1 = StellarSdk.Operation.setOptions({signer: {ed25519PublicKey: sourceKey.publicKey(), weight: '1'}}); +StellarSdk.Operation.fromXDRObject(newSignerXDR1).signer; // $ExpectType SignerEd25519PublicKey + +const newSignerXDR2 = StellarSdk.Operation.setOptions({signer: {sha256Hash: Buffer.from(''), weight: '1'}}); +StellarSdk.Operation.fromXDRObject(newSignerXDR2).signer; // $ExpectType SignerSha256Hash + +const newSignerXDR3 = StellarSdk.Operation.setOptions({signer: {preAuthTx: '', weight: 1}}); +StellarSdk.Operation.fromXDRObject(newSignerXDR3).signer; // $ExpectType SignerPreAuthTx diff --git a/types/stellar-base/tsconfig.json b/types/stellar-base/tsconfig.json new file mode 100644 index 0000000000..ea8f34b1d4 --- /dev/null +++ b/types/stellar-base/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", + "stellar-base-tests.ts" + ] +} diff --git a/types/stellar-base/tslint.json b/types/stellar-base/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/stellar-base/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index bd28677bf0..d0f3d86023 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -11,464 +11,40 @@ /// -// Dependency -export type Key = string|number|symbol; -export type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; - -export namespace StellarBase { - class Account { - constructor(accountId: string, sequence: string | number) - accountId(): string; - sequenceNumber(): string; - incrementSequenceNumber(): void; - } - - enum ASSET_TYPE { - native = 'native', - credit4 = 'credit_alphanum4', - credit12 = 'credit_alphanum12', - } - class Asset { - static native(): Asset; - static fromOperation(xdr: xdr.Asset): Asset; - - constructor(code: string, issuer: string); - - getCode(): string; - getIssuer(): string; - getAssetType(): ASSET_TYPE; - isNative(): boolean; - equals(other: Asset): boolean; - toXDRObject(): xdr.Asset; - - code: string; - issuer: string; - } - - const FastSigning: boolean; - - class Keypair { - static fromRawEd25519Seed(secretSeed: Buffer): Keypair; - static fromBase58Seed(secretSeed: string): Keypair; - static fromSecret(secretKey: string): Keypair; - static master(): Keypair; - static fromPublicKey(publicKey: string): Keypair; - static random(): Keypair; - - constructor(keys: { type: 'ed25519', secretKey: string } | { type: 'ed25519', Key: string }) - - publicKey(): string; - secret(): string; - rawPublicKey(): Buffer; - rawSecretKey(): Buffer; - canSign(): boolean; - sign(data: Buffer): Buffer; - signDecorated(data: Buffer): xdr.DecoratedSignature; - signatureHint(): xdr.SignatureHint; - verify(data: Buffer, signature: Buffer): boolean; - } - - const MemoNone = 'none'; - const MemoID = 'id'; - const MemoText = 'text'; - const MemoHash = 'hash'; - const MemoReturn = 'return'; - type MemoNone = 'none'; - type MemoID = 'id'; - type MemoText = 'text'; - type MemoHash = 'hash'; - type MemoReturn = 'return'; - class Memo { - static fromXDRObject(memo: xdr.Memo): Memo; - static hash(hash: string): Memo; - static id(id: string): Memo; - static none(): Memo; - static return(hash: string): Memo; - static text(text: string): Memo; - - constructor(type: MemoNone, value?: null); - constructor(type: MemoHash | MemoReturn, value: Buffer) - constructor(type: MemoHash | MemoReturn | MemoID | MemoText, value: string) - constructor(type: T, value: Memo.AnyValue) - - type: T; - value: - T extends MemoNone ? null : - T extends MemoID ? string : - T extends MemoText ? string : - T extends MemoHash ? Buffer : - T extends MemoReturn ? Buffer : - Memo.AnyValue; - - toXDRObject(): xdr.Memo; - } - namespace Memo { - type AnyType = MemoNone | MemoID | MemoText | MemoHash | MemoReturn; - type AnyValue = null | string | Buffer; - } - - enum Networks { - PUBLIC = 'Public Global Stellar Network ; September 2015', - TESTNET = 'Test SDF Network ; September 2015', - } - - class Network { - static use(network: Network): void; - static usePublicNetwork(): void; - static useTestNetwork(): void; - static current(): Network; - - constructor(passphrase: string) - - networkPassphrase(): string; - networkId(): string; - } - - const AuthRequiredFlag: 1; - const AuthRevocableFlag: 2; - const AuthImmutableFlag: 4; - - type TransactionOperation = - Operation.CreateAccount - | Operation.Payment - | Operation.PathPayment - | Operation.CreatePassiveOffer - | Operation.ManageOffer - | Operation.SetOptions - | Operation.ChangeTrust - | Operation.AllowTrust - | Operation.AccountMerge - | Operation.Inflation - | Operation.ManageData - | Operation.BumpSequence; - - enum OperationType { - createAccount = 'createAccount', - payment = 'payment', - pathPayment = 'pathPayment', - createPassiveOffer = 'createPassiveOffer', - manageOffer = 'manageOffer', - setOptions = 'setOptions', - changeTrust = 'changeTrust', - allowTrust = 'allowTrust', - accountMerge = 'accountMerge', - inflation = 'inflation', - manageData = 'manageData', - bumpSequence = 'bumpSequence', - } - - namespace Operation { - interface Operation { - type: T; - source?: string; - } - interface OperationOptions { - source?: string; - } - - interface AccountMerge extends Operation { - destination: string; - } - interface AccountMergeOptions extends OperationOptions { - destination: string; - } - function accountMerge(options: AccountMergeOptions): xdr.Operation; - - interface AllowTrust extends Operation { - trustor: string; - assetCode: string; - authorize: boolean | undefined; - } - interface AllowTrustOptions extends OperationOptions { - trustor: string; - assetCode: string; - authorize?: boolean; - } - function allowTrust(options: AllowTrustOptions): xdr.Operation; - - interface ChangeTrust extends Operation { - line: Asset; - limit: string; - } - interface ChangeTrustOptions extends OperationOptions { - asset: Asset; - limit?: string; - } - function changeTrust(options: ChangeTrustOptions): xdr.Operation; - - interface CreateAccount extends Operation { - destination: string; - startingBalance: string; - } - interface CreateAccountOptions extends OperationOptions { - destination: string; - startingBalance: string; - } - function createAccount(options: CreateAccountOptions): xdr.Operation; - - interface CreatePassiveOffer extends Operation { - selling: Asset; - buying: Asset; - amount: string; - price: string; - } - interface CreatePassiveOfferOptions extends OperationOptions { - selling: Asset; - buying: Asset; - amount: string; - price: number | string | object /* bignumber.js */; - } - function createPassiveOffer(options: CreatePassiveOfferOptions): xdr.Operation; - - interface Inflation extends Operation { - } - interface InflationOptions extends OperationOptions { // tslint:disable-line - } - function inflation(options: InflationOptions): xdr.Operation; - - interface ManageData extends Operation { - name: string; - value: Buffer; - } - interface ManageDataOptions extends OperationOptions { - name: string; - value: string | Buffer; - } - function manageData(options: ManageDataOptions): xdr.Operation; - - interface ManageOffer extends Operation { - selling: Asset; - buying: Asset; - amount: string; - price: string; - offerId: string; - } - interface ManageOfferOptions extends CreatePassiveOfferOptions { - offerId?: number | string; - } - function manageOffer(options: ManageOfferOptions): xdr.Operation; - - interface PathPayment extends Operation { - sendAsset: Asset; - sendMax: string; - destination: string; - destAsset: Asset; - destAmount: string; - path: Asset[]; - } - interface PathPaymentOptions extends OperationOptions { - sendAsset: Asset; - sendMax: string; - destination: string; - destAsset: Asset; - destAmount: string; - path?: Asset[]; - } - function pathPayment(options: PathPaymentOptions): xdr.Operation; - - interface Payment extends Operation { - amount: string; - asset: Asset; - destination: string; - } - interface PaymentOptions extends OperationOptions { - amount: string; - asset: Asset; - destination: string; - } - function payment(options: PaymentOptions): xdr.Operation; - - /* - * Required = 1 << 0 - * Revocable = 1 << 1 - * Immutable = 1 << 2 - */ - enum AuthFlags { - Required = 1, - Revocable = 2, - Immutable = 4, - } - interface SignerEd25519PublicKey { - ed25519PublicKey: string; - weight: number | undefined; - } - interface SignerSha256Hash { - sha256Hash: Buffer; - weight: number | undefined; - } - interface SignerPreAuthTx { - preAuthTx: Buffer; - weight: number | undefined; - } - type Signer = SignerEd25519PublicKey | SignerSha256Hash | SignerPreAuthTx; - interface SignerEd25519PublicKeyOptions { - ed25519PublicKey: string; - weight?: number | string; - } - interface SignerSha256HashOptions { - sha256Hash: Buffer | string; - weight?: number | string; - } - interface SignerPreAuthTxOptions { - preAuthTx: Buffer | string; - weight?: number | string; - } - type SignerOptions = SignerEd25519PublicKeyOptions | SignerSha256HashOptions | SignerPreAuthTxOptions; - type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; - interface SetOptions extends Operation { - inflationDest?: string; - clearFlags?: AuthFlags; - setFlags?: AuthFlags; - masterWeight?: number; - lowThreshold?: number; - medThreshold?: number; - highThreshold?: number; - homeDomain?: string; - signer: - T extends {ed25519PublicKey: any} ? SignerEd25519PublicKey : - T extends {sha256Hash: any} ? SignerSha256Hash : - T extends {preAuthTx: any} ? SignerPreAuthTx : - never; - } - interface SetOptionsOptions extends OperationOptions { - inflationDest?: string; - clearFlags?: AuthFlags; - setFlags?: AuthFlags; - masterWeight?: number | string; - lowThreshold?: number | string; - medThreshold?: number | string; - highThreshold?: number | string; - homeDomain?: string; - signer?: T; - } - function setOptions(options: SetOptionsOptions): xdr.Operation>; - - interface BumpSequence extends Operation { - bumpTo: string; - } - interface BumpSequenceOptions extends OperationOptions { - bumpTo: string; - } - function bumpSequence(options: BumpSequenceOptions): xdr.Operation; - - function fromXDRObject(xdrOperation: xdr.Operation): T; - } - - namespace StrKey { - function encodeEd25519PublicKey(data: Buffer): string; - function decodeEd25519PublicKey(data: string): Buffer; - function isValidEd25519PublicKey(Key: string): boolean; - - function encodeEd25519SecretSeed(data: Buffer): string; - function decodeEd25519SecretSeed(data: string): Buffer; - function isValidEd25519SecretSeed(seed: string): boolean; - - function encodePreAuthTx(data: Buffer): string; - function decodePreAuthTx(data: string): Buffer; - - function encodeSha256Hash(data: Buffer): string; - function decodeSha256Hash(data: string): Buffer; - } - - class Transaction { - constructor(envelope: string | xdr.TransactionEnvelope) - hash(): Buffer; - sign(...keypairs: Keypair[]): void; - signatureBase(): Buffer; - signHashX(preimage: Buffer | string): void; - toEnvelope(): xdr.TransactionEnvelope; - - operations: TOps; - sequence: number; - fee: number; - source: string; - memo: TMemo; - signatures: xdr.DecoratedSignature[]; - } - - class TransactionBuilder { - constructor(sourceAccount: Account, options?: TransactionBuilder.TransactionBuilderOptions) - addOperation(operation: xdr.Operation): this; - addMemo(memo: Memo): this; - build(): Transaction; - } - - namespace TransactionBuilder { - interface TransactionBuilderOptions { - fee?: number; - timebounds?: { - minTime?: number | string - maxTime?: number | string - }; - memo?: Memo; - } - } - - namespace xdr { - class XDRStruct { - static fromXDR(xdr: Buffer): XDRStruct; - - toXDR(base?: string): Buffer; - toXDR(encoding: string): string; - } - class Operation extends XDRStruct { - static fromXDR(xdr: Buffer): Operation; - } - class Asset extends XDRStruct { - static fromXDR(xdr: Buffer): Asset; - } - class Memo extends XDRStruct { - static fromXDR(xdr: Buffer): Memo; - } - class TransactionEnvelope extends XDRStruct { - static fromXDR(xdr: Buffer): TransactionEnvelope; - } - class DecoratedSignature extends XDRStruct { - static fromXDR(xdr: Buffer): DecoratedSignature; - - constructor(keys: { hint: SignatureHint, signature: Signature }) - - hint(): SignatureHint; - signature(): Buffer; - } - type SignatureHint = Buffer; - type Signature = Buffer; - - class TransactionResult extends XDRStruct { - static fromXDR(xdr: Buffer): TransactionResult; - } - } - - function hash(data: Buffer): Buffer; - function sign(data: Buffer, rawSecret: Buffer): Buffer; - function verify(data: Buffer, signature: Buffer, rawPublicKey: Buffer): boolean; -} +import { ASSET_TYPE, Asset, Memo, Transaction } from 'stellar-base'; // Re-StellarBase -export import Account = StellarBase.Account; -export import ASSET_TYPE = StellarBase.ASSET_TYPE; -export import Asset = StellarBase.Asset; -export import FastSigning = StellarBase.FastSigning; -export import Keypair = StellarBase.Keypair; -export import Memo = StellarBase.Memo; -export import MemoHash = StellarBase.MemoHash; -export import MemoID = StellarBase.MemoID; -export import MemoNone = StellarBase.MemoNone; -export import MemoReturn = StellarBase.MemoReturn; -export import MemoText = StellarBase.MemoText; -export import Network = StellarBase.Network; -export import Networks = StellarBase.Networks; -export import Operation = StellarBase.Operation; -export import OperationType = StellarBase.OperationType; -export import StrKey = StellarBase.StrKey; -export import Transaction = StellarBase.Transaction; -export import TransactionBuilder = StellarBase.TransactionBuilder; -export import TransactionOperation = StellarBase.TransactionOperation; -export import hash = StellarBase.hash; -export import sign = StellarBase.sign; -export import verify = StellarBase.verify; -export import xdr = StellarBase.xdr; +export { + Account, + ASSET_TYPE, + Asset, + FastSigning, + Keypair, + Memo, + MemoHash, + MemoID, + MemoNone, + MemoReturn, + MemoText, + Network, + Networks, + Operation, + OperationType, + StrKey, + Transaction, + TransactionBuilder, + TransactionOperation, + hash, + sign, + verify, + xdr +} from 'stellar-base'; + +// Shorthands, not-to-export. +export {}; +type Key = string|number|symbol; +type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; +type Omit = Pick>; export class NetworkError extends Error { private response: any; diff --git a/types/stellar-sdk/stellar-sdk-tests.ts b/types/stellar-sdk/stellar-sdk-tests.ts index 2533fefaa4..d531fc850f 100644 --- a/types/stellar-sdk/stellar-sdk-tests.ts +++ b/types/stellar-sdk/stellar-sdk-tests.ts @@ -1,43 +1,4 @@ import * as StellarSdk from 'stellar-sdk'; -const sourceKey = StellarSdk.Keypair.random(); // $ExpectType Keypair -const destKey = StellarSdk.Keypair.random(); -const account = new StellarSdk.Account(sourceKey.publicKey(), '1'); -const transaction = new StellarSdk.TransactionBuilder(account) - .addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()})) - .addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo")) - .build(); // $ExpectType () => Transaction, TransactionOperation[]> - StellarSdk.StellarTomlResolver.resolve("example.com", {allowHttp: true, timeout: 100}) .then(toml => toml.FEDERATION_SERVER); - -const sig = StellarSdk.xdr.DecoratedSignature.fromXDR(Buffer.of(1, 2)); // $ExpectType DecoratedSignature -sig.hint(); // $ExpectType Buffer -sig.signature(); // $ExpectType Buffer - -StellarSdk.Memo.none(); // $ExpectType Memo<"none"> -StellarSdk.Memo.text('asdf'); // $ExpectType Memo<"text"> -StellarSdk.Memo.id('asdf'); // $ExpectType Memo<"id"> -StellarSdk.Memo.return('asdf'); // $ExpectType Memo<"return"> -StellarSdk.Memo.hash('asdf'); // $ExpectType Memo<"hash"> -StellarSdk.Memo.none().value; // $ExpectType null -StellarSdk.Memo.id('asdf').value; // $ExpectType string -StellarSdk.Memo.text('asdf').value; // $ExpectType string -StellarSdk.Memo.return('asdf').value; // $ExpectType Buffer -StellarSdk.Memo.hash('asdf').value; // $ExpectType Buffer - -// P.S. don't use Memo constructor -(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).value; // $ExpectType AnyValue -(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).type; // $ExpectType AnyType - -const noSignerXDR = StellarSdk.Operation.setOptions({lowThreshold: 1}); -StellarSdk.Operation.fromXDRObject(noSignerXDR).signer; // $ExpectType never - -const newSignerXDR1 = StellarSdk.Operation.setOptions({signer: {ed25519PublicKey: sourceKey.publicKey(), weight: '1'}}); -StellarSdk.Operation.fromXDRObject(newSignerXDR1).signer; // $ExpectType SignerEd25519PublicKey - -const newSignerXDR2 = StellarSdk.Operation.setOptions({signer: {sha256Hash: Buffer.from(''), weight: '1'}}); -StellarSdk.Operation.fromXDRObject(newSignerXDR2).signer; // $ExpectType SignerSha256Hash - -const newSignerXDR3 = StellarSdk.Operation.setOptions({signer: {preAuthTx: '', weight: 1}}); -StellarSdk.Operation.fromXDRObject(newSignerXDR3).signer; // $ExpectType SignerPreAuthTx From 314226a267dceeaebc489205ccc60db3eef2233e Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Thu, 10 Jan 2019 10:14:24 +0100 Subject: [PATCH 254/646] fix(libsodium-wrappers): Add updates for v0.7.4 --- types/libsodium-wrappers-sumo/index.d.ts | 28 ++++++++++++++++++++++-- types/libsodium-wrappers/index.d.ts | 16 +++++++------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/types/libsodium-wrappers-sumo/index.d.ts b/types/libsodium-wrappers-sumo/index.d.ts index ceeadd5980..5341cca299 100644 --- a/types/libsodium-wrappers-sumo/index.d.ts +++ b/types/libsodium-wrappers-sumo/index.d.ts @@ -7,10 +7,12 @@ export * from 'libsodium-wrappers'; import { - Uint8ArrayOutputFormat, - StringOutputFormat, + KeyPair, onetimeauth_state_address, state_address, + StringKeyPair, + StringOutputFormat, + Uint8ArrayOutputFormat, } from 'libsodium-wrappers'; export const crypto_auth_hmacsha256_BYTES: number; @@ -77,6 +79,12 @@ export const crypto_stream_xchacha20_KEYBYTES: number; export const crypto_stream_xchacha20_NONCEBYTES: number; +export const crypto_box_curve25519xchacha20poly1305_NONCEBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES: number; + export function crypto_auth_hmacsha256( message: string | Uint8Array, key: Uint8Array, @@ -113,6 +121,18 @@ export function crypto_auth_hmacsha512_keygen(outputFormat?: StringOutputFormat export function crypto_auth_hmacsha512_verify(tag: Uint8Array, message: string | Uint8Array, key: Uint8Array): boolean; +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): KeyPair; + +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): StringKeyPair; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + export function crypto_hash_sha256( message: string | Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null, @@ -240,6 +260,10 @@ export function crypto_sign_ed25519_sk_to_seed( outputFormat?: StringOutputFormat | null, ): string; +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + export function crypto_stream_chacha20_ietf_xor( input_message: string | Uint8Array, nonce: Uint8Array, diff --git a/types/libsodium-wrappers/index.d.ts b/types/libsodium-wrappers/index.d.ts index e9213da782..864aa2369f 100644 --- a/types/libsodium-wrappers/index.d.ts +++ b/types/libsodium-wrappers/index.d.ts @@ -886,30 +886,30 @@ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: Uint export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: StringOutputFormat | null): string; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: Uint8ArrayOutputFormat | null, ): { message: Uint8Array; tag: Uint8Array }; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: StringOutputFormat | null, ): { message: string; tag: Uint8Array }; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: Uint8ArrayOutputFormat | null, ): Uint8Array; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: StringOutputFormat | null, From 7d36f72435e8868f74c87e9d0f59f8d278c94411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 11:51:54 +0200 Subject: [PATCH 255/646] fix: change fake enums into type+namespace --- types/stellar-base/index.d.ts | 143 ++++++++++++++--------- types/stellar-base/stellar-base-tests.ts | 6 +- types/stellar-sdk/index.d.ts | 42 ++++--- 3 files changed, 112 insertions(+), 79 deletions(-) diff --git a/types/stellar-base/index.d.ts b/types/stellar-base/index.d.ts index 4b86065c40..b0815017c6 100644 --- a/types/stellar-base/index.d.ts +++ b/types/stellar-base/index.d.ts @@ -18,11 +18,17 @@ export class Account { incrementSequenceNumber(): void; } -export enum ASSET_TYPE { - native = 'native', - credit4 = 'credit_alphanum4', - credit12 = 'credit_alphanum12', +export namespace AssetType { + type native = 'native'; + type credit4 = 'credit_alphanum4'; + type credit12 = 'credit_alphanum12'; } +export type AssetType = + | AssetType.native + | AssetType.credit4 + | AssetType.credit12 +; + export class Asset { static native(): Asset; static fromOperation(xdr: xdr.Asset): Asset; @@ -31,7 +37,7 @@ export class Asset { getCode(): string; getIssuer(): string; - getAssetType(): ASSET_TYPE; + getAssetType(): AssetType; isNative(): boolean; equals(other: Asset): boolean; toXDRObject(): xdr.Asset; @@ -68,39 +74,46 @@ export const MemoID = 'id'; export const MemoText = 'text'; export const MemoHash = 'hash'; export const MemoReturn = 'return'; -export type MemoNone = 'none'; -export type MemoID = 'id'; -export type MemoText = 'text'; -export type MemoHash = 'hash'; -export type MemoReturn = 'return'; -export class Memo { - static fromXDRObject(memo: xdr.Memo): Memo; - static hash(hash: string): Memo; - static id(id: string): Memo; - static none(): Memo; - static return(hash: string): Memo; - static text(text: string): Memo; +export namespace MemoType { + type None = typeof MemoNone; + type ID = typeof MemoID; + type Text = typeof MemoText; + type Hash = typeof MemoHash; + type Return = typeof MemoReturn; +} +export type MemoType = + | MemoType.None + | MemoType.ID + | MemoType.Text + | MemoType.Hash + | MemoType.Return +; +export type MemoValue = null | string | Buffer; - constructor(type: MemoNone, value?: null); - constructor(type: MemoHash | MemoReturn, value: Buffer) - constructor(type: MemoHash | MemoReturn | MemoID | MemoText, value: string) - constructor(type: T, value: Memo.AnyValue) +export class Memo { + static fromXDRObject(memo: xdr.Memo): Memo; + static hash(hash: string): Memo; + static id(id: string): Memo; + static none(): Memo; + static return(hash: string): Memo; + static text(text: string): Memo; + + constructor(type: MemoType.None, value?: null); + constructor(type: MemoType.Hash | MemoType.Return, value: Buffer) + constructor(type: MemoType.Hash | MemoType.Return | MemoType.ID | MemoType.Text, value: string) + constructor(type: T, value: MemoValue) type: T; value: - T extends MemoNone ? null : - T extends MemoID ? string : - T extends MemoText ? string : - T extends MemoHash ? Buffer : - T extends MemoReturn ? Buffer : - Memo.AnyValue; + T extends MemoType.None ? null : + T extends MemoType.ID ? string : + T extends MemoType.Text ? string : + T extends MemoType.Hash ? Buffer : + T extends MemoType.Return ? Buffer : + MemoValue; toXDRObject(): xdr.Memo; } -export namespace Memo { - type AnyType = MemoNone | MemoID | MemoText | MemoHash | MemoReturn; - type AnyValue = null | string | Buffer; -} export enum Networks { PUBLIC = 'Public Global Stellar Network ; September 2015', @@ -122,6 +135,16 @@ export class Network { export const AuthRequiredFlag: 1; export const AuthRevocableFlag: 2; export const AuthImmutableFlag: 4; +export namespace AuthFlag { + type required = typeof AuthRequiredFlag; + type revocable = typeof AuthRevocableFlag; + type rmmutable = typeof AuthImmutableFlag; +} +export type AuthFlag = + | AuthFlag.required + | AuthFlag.revocable + | AuthFlag.rmmutable +; export type TransactionOperation = Operation.CreateAccount @@ -137,20 +160,34 @@ export type TransactionOperation = | Operation.ManageData | Operation.BumpSequence; -export enum OperationType { - createAccount = 'createAccount', - payment = 'payment', - pathPayment = 'pathPayment', - createPassiveOffer = 'createPassiveOffer', - manageOffer = 'manageOffer', - setOptions = 'setOptions', - changeTrust = 'changeTrust', - allowTrust = 'allowTrust', - accountMerge = 'accountMerge', - inflation = 'inflation', - manageData = 'manageData', - bumpSequence = 'bumpSequence', +export namespace OperationType { + type createAccount = 'createAccount'; + type payment = 'payment'; + type pathPayment = 'pathPayment'; + type createPassiveOffer = 'createPassiveOffer'; + type manageOffer = 'manageOffer'; + type setOptions = 'setOptions'; + type changeTrust = 'changeTrust'; + type allowTrust = 'allowTrust'; + type accountMerge = 'accountMerge'; + type inflation = 'inflation'; + type manageData = 'manageData'; + type bumpSequence = 'bumpSequence'; } +export type OperationType = + | OperationType.createAccount + | OperationType.payment + | OperationType.pathPayment + | OperationType.createPassiveOffer + | OperationType.manageOffer + | OperationType.setOptions + | OperationType.changeTrust + | OperationType.allowTrust + | OperationType.accountMerge + | OperationType.inflation + | OperationType.manageData + | OperationType.bumpSequence +; export namespace Operation { interface Operation { @@ -273,16 +310,6 @@ export namespace Operation { } function payment(options: PaymentOptions): xdr.Operation; - /* - * Required = 1 << 0 - * Revocable = 1 << 1 - * Immutable = 1 << 2 - */ - enum AuthFlags { - Required = 1, - Revocable = 2, - Immutable = 4, - } interface SignerEd25519PublicKey { ed25519PublicKey: string; weight: number | undefined; @@ -312,8 +339,8 @@ export namespace Operation { type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; interface SetOptions extends Operation { inflationDest?: string; - clearFlags?: AuthFlags; - setFlags?: AuthFlags; + clearFlags?: AuthFlag; + setFlags?: AuthFlag; masterWeight?: number; lowThreshold?: number; medThreshold?: number; @@ -327,8 +354,8 @@ export namespace Operation { } interface SetOptionsOptions extends OperationOptions { inflationDest?: string; - clearFlags?: AuthFlags; - setFlags?: AuthFlags; + clearFlags?: AuthFlag; + setFlags?: AuthFlag; masterWeight?: number | string; lowThreshold?: number | string; medThreshold?: number | string; diff --git a/types/stellar-base/stellar-base-tests.ts b/types/stellar-base/stellar-base-tests.ts index 0a8176919c..8b703d4c84 100644 --- a/types/stellar-base/stellar-base-tests.ts +++ b/types/stellar-base/stellar-base-tests.ts @@ -6,7 +6,7 @@ const account = new StellarSdk.Account(sourceKey.publicKey(), '1'); const transaction = new StellarSdk.TransactionBuilder(account) .addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()})) .addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo")) - .build(); // $ExpectType () => Transaction, TransactionOperation[]> + .build(); // $ExpectType () => Transaction, TransactionOperation[]> const sig = StellarSdk.xdr.DecoratedSignature.fromXDR(Buffer.of(1, 2)); // $ExpectType DecoratedSignature sig.hint(); // $ExpectType Buffer @@ -24,8 +24,8 @@ StellarSdk.Memo.return('asdf').value; // $ExpectType Buffer StellarSdk.Memo.hash('asdf').value; // $ExpectType Buffer // P.S. don't use Memo constructor -(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).value; // $ExpectType AnyValue -(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).type; // $ExpectType AnyType +(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).value; // $ExpectType MemoValue +(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).type; // $ExpectType MemoType const noSignerXDR = StellarSdk.Operation.setOptions({lowThreshold: 1}); StellarSdk.Operation.fromXDRObject(noSignerXDR).signer; // $ExpectType never diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index d0f3d86023..5afec167cd 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -11,16 +11,22 @@ /// -import { ASSET_TYPE, Asset, Memo, Transaction } from 'stellar-base'; +import { AssetType, Asset, Memo, MemoType, Transaction } from 'stellar-base'; // Re-StellarBase export { Account, - ASSET_TYPE, Asset, + AssetType, + AuthFlag, + AuthImmutableFlag, + AuthRequiredFlag, + AuthRevocableFlag, FastSigning, Keypair, Memo, + MemoType, + MemoValue, MemoHash, MemoID, MemoNone, @@ -157,7 +163,7 @@ export namespace Server { } interface AssetRecord extends Horizon.BaseResponse { - asset_type: ASSET_TYPE.credit4 | ASSET_TYPE.credit12; + asset_type: AssetType.credit4 | AssetType.credit12; asset_code: string; asset_issuer: string; paging_token: string; @@ -452,7 +458,7 @@ export namespace Horizon { hash: string; id: string; ledger: number; - memo_type: Memo.AnyType; + memo_type: MemoType; memo?: string; operation_count: number; paging_token: string; @@ -465,18 +471,18 @@ export namespace Horizon { interface BalanceLineNative { balance: string; - asset_type: ASSET_TYPE.native; + asset_type: AssetType.native; } - interface BalanceLineAsset { + interface BalanceLineAsset { balance: string; limit: string; asset_type: T; asset_code: string; asset_issuer: string; } - type BalanceLine = - T extends ASSET_TYPE.native ? BalanceLineNative : - T extends ASSET_TYPE.credit4 | ASSET_TYPE.credit12 ? BalanceLineAsset : + type BalanceLine = + T extends AssetType.native ? BalanceLineNative : + T extends AssetType.credit4 | AssetType.credit12 ? BalanceLineAsset : BalanceLineNative | BalanceLineAsset; interface PriceR { @@ -559,7 +565,7 @@ export namespace Horizon { interface PaymentOperationResponse extends BaseOperationResponse { from: string; to: string; - asset_type: ASSET_TYPE; + asset_type: AssetType; asset_code?: string; asset_issuer?: string; amount: string; @@ -567,11 +573,11 @@ export namespace Horizon { interface PathPaymentOperationResponse extends BaseOperationResponse { from: string; to: string; - asset_type: ASSET_TYPE; + asset_type: AssetType; asset_code?: string; asset_issuer?: string; amount: string; - source_asset_type: ASSET_TYPE; + source_asset_type: AssetType; source_asset_code?: string; source_asset_issuer?: string; source_max: string; @@ -580,24 +586,24 @@ export namespace Horizon { interface ManageOfferOperationResponse extends BaseOperationResponse { offer_id: number; amount: string; - buying_asset_type: ASSET_TYPE; + buying_asset_type: AssetType; buying_asset_code?: string; buying_asset_issuer?: string; price: string; price_r: PriceR; - selling_asset_type: ASSET_TYPE; + selling_asset_type: AssetType; selling_asset_code?: string; selling_asset_issuer?: string; } interface PassiveOfferOperationResponse extends BaseOperationResponse { offer_id: number; amount: string; - buying_asset_type: ASSET_TYPE; + buying_asset_type: AssetType; buying_asset_code?: string; buying_asset_issuer?: string; price: string; price_r: PriceR; - selling_asset_type: ASSET_TYPE; + selling_asset_type: AssetType; selling_asset_code?: string; selling_asset_issuer?: string; } @@ -615,7 +621,7 @@ export namespace Horizon { clear_flags_s: Array<('auth_required_flag' | 'auth_revocable_flag')>; } interface ChangeTrustOperationResponse extends BaseOperationResponse { - asset_type: ASSET_TYPE.credit4 | ASSET_TYPE.credit12; + asset_type: AssetType.credit4 | AssetType.credit12; asset_code: string; asset_issuer: string; trustee: string; @@ -623,7 +629,7 @@ export namespace Horizon { limit: string; } interface AllowTrustOperationResponse extends BaseOperationResponse { - asset_type: ASSET_TYPE; + asset_type: AssetType; asset_code: string; asset_issuer: string; authorize: boolean; From be2a0cdc916d05583b60dafeaf19f62d0350c9dd Mon Sep 17 00:00:00 2001 From: deskoh Date: Thu, 10 Jan 2019 17:53:31 +0800 Subject: [PATCH 256/646] Updated argument of validator function to be optional. --- types/simpl-schema/index.d.ts | 3 ++- types/simpl-schema/simpl-schema-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/simpl-schema/index.d.ts b/types/simpl-schema/index.d.ts index b09a8fde96..c59833b12e 100644 --- a/types/simpl-schema/index.d.ts +++ b/types/simpl-schema/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/aldeed/simple-schema-js // Definitions by: Andreas Richter // Qkramer +// Deskoh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface ValidationContext extends SimpleSchemaValidationContextStatic { @@ -133,7 +134,7 @@ interface SimpleSchemaStatic { newContext(): ValidationContext; objectKeys(keyPrefix: any): any[]; validate(obj: any, options?: ValidationOption): void; - validator(options: ValidationOption): () => boolean; + validator(options?: ValidationOption): () => boolean; RegEx: { Email: RegExp; EmailWithTLD: RegExp; diff --git a/types/simpl-schema/simpl-schema-tests.ts b/types/simpl-schema/simpl-schema-tests.ts index a3555c4428..48f246261e 100644 --- a/types/simpl-schema/simpl-schema-tests.ts +++ b/types/simpl-schema/simpl-schema-tests.ts @@ -35,6 +35,12 @@ StringSchema.validate({ regExpString: "id" }, {keys: ['basicString']}); +StringSchema.validator(); + +StringSchema.validator({ + clean: true +}); + const StringSchemaWithOptions = new SimpleSchema({ basicString: { type: String From 8a8c081052ccb3a67857f84d9522bade2426ed20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 12:53:36 +0200 Subject: [PATCH 257/646] feat: TransactionOperation -> Operation --- types/stellar-base/index.d.ts | 479 ++++++++++++----------- types/stellar-base/stellar-base-tests.ts | 8 +- types/stellar-sdk/index.d.ts | 3 +- 3 files changed, 264 insertions(+), 226 deletions(-) diff --git a/types/stellar-base/index.d.ts b/types/stellar-base/index.d.ts index b0815017c6..e47c28e3e7 100644 --- a/types/stellar-base/index.d.ts +++ b/types/stellar-base/index.d.ts @@ -10,6 +10,7 @@ // TypeScript Version: 2.9 /// +export {}; export class Account { constructor(accountId: string, sequence: string | number) @@ -146,7 +147,253 @@ export type AuthFlag = | AuthFlag.rmmutable ; -export type TransactionOperation = +export namespace Signer { + interface Ed25519PublicKey { + ed25519PublicKey: string; + weight: number | undefined; + } + interface Sha256Hash { + sha256Hash: Buffer; + weight: number | undefined; + } + interface PreAuthTx { + preAuthTx: Buffer; + weight: number | undefined; + } +} +export type Signer = + | Signer.Ed25519PublicKey + | Signer.Sha256Hash + | Signer.PreAuthTx +; + +export namespace SignerOptions { + interface Ed25519PublicKey { + ed25519PublicKey: string; + weight?: number | string; + } + interface Sha256Hash { + sha256Hash: Buffer | string; + weight?: number | string; + } + interface PreAuthTx { + preAuthTx: Buffer | string; + weight?: number | string; + } +} +export type SignerOptions = + | SignerOptions.Ed25519PublicKey + | SignerOptions.Sha256Hash + | SignerOptions.PreAuthTx +; +export type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; + +export namespace OperationType { + type CreateAccount = 'createAccount'; + type Payment = 'payment'; + type PathPayment = 'pathPayment'; + type CreatePassiveOffer = 'createPassiveOffer'; + type ManageOffer = 'manageOffer'; + type SetOptions = 'setOptions'; + type ChangeTrust = 'changeTrust'; + type AllowTrust = 'allowTrust'; + type AccountMerge = 'accountMerge'; + type Inflation = 'inflation'; + type ManageData = 'manageData'; + type BumpSequence = 'bumpSequence'; +} +export type OperationType = + | OperationType.CreateAccount + | OperationType.Payment + | OperationType.PathPayment + | OperationType.CreatePassiveOffer + | OperationType.ManageOffer + | OperationType.SetOptions + | OperationType.ChangeTrust + | OperationType.AllowTrust + | OperationType.AccountMerge + | OperationType.Inflation + | OperationType.ManageData + | OperationType.BumpSequence +; + +export namespace OperationOptions { + interface BaseOptions { + source?: string; + } + interface AccountMerge extends BaseOptions { + destination: string; + } + interface AllowTrust extends BaseOptions { + trustor: string; + assetCode: string; + authorize?: boolean; + } + interface ChangeTrust extends BaseOptions { + asset: Asset; + limit?: string; + } + interface CreateAccount extends BaseOptions { + destination: string; + startingBalance: string; + } + interface CreatePassiveOffer extends BaseOptions { + selling: Asset; + buying: Asset; + amount: string; + price: number | string | object /* bignumber.js */; + } + interface ManageOffer extends CreatePassiveOffer { + offerId?: number | string; + } + interface Inflation extends BaseOptions { // tslint:disable-line + } + interface ManageData extends BaseOptions { + name: string; + value: string | Buffer; + } + interface PathPayment extends BaseOptions { + sendAsset: Asset; + sendMax: string; + destination: string; + destAsset: Asset; + destAmount: string; + path?: Asset[]; + } + interface Payment extends BaseOptions { + amount: string; + asset: Asset; + destination: string; + } + interface SetOptions extends BaseOptions { + inflationDest?: string; + clearFlags?: AuthFlag; + setFlags?: AuthFlag; + masterWeight?: number | string; + lowThreshold?: number | string; + medThreshold?: number | string; + highThreshold?: number | string; + homeDomain?: string; + signer?: T; + } + interface BumpSequence extends BaseOptions { + bumpTo: string; + } +} +export type OperationOptions = + | OperationOptions.CreateAccount + | OperationOptions.Payment + | OperationOptions.PathPayment + | OperationOptions.CreatePassiveOffer + | OperationOptions.ManageOffer + | OperationOptions.SetOptions + | OperationOptions.ChangeTrust + | OperationOptions.AllowTrust + | OperationOptions.AccountMerge + | OperationOptions.Inflation + | OperationOptions.ManageData + | OperationOptions.BumpSequence +; + +export namespace Operation { + interface BaseOperation { + type: T; + source?: string; + } + + interface AccountMerge extends BaseOperation { + destination: string; + } + function accountMerge(options: OperationOptions.AccountMerge): xdr.Operation; + + interface AllowTrust extends BaseOperation { + trustor: string; + assetCode: string; + authorize: boolean | undefined; + } + function allowTrust(options: OperationOptions.AllowTrust): xdr.Operation; + + interface ChangeTrust extends BaseOperation { + line: Asset; + limit: string; + } + function changeTrust(options: OperationOptions.ChangeTrust): xdr.Operation; + + interface CreateAccount extends BaseOperation { + destination: string; + startingBalance: string; + } + function createAccount(options: OperationOptions.CreateAccount): xdr.Operation; + + interface CreatePassiveOffer extends BaseOperation { + selling: Asset; + buying: Asset; + amount: string; + price: string; + } + function createPassiveOffer(options: OperationOptions.CreatePassiveOffer): xdr.Operation; + + interface Inflation extends BaseOperation { + } + function inflation(options: OperationOptions.Inflation): xdr.Operation; + + interface ManageData extends BaseOperation { + name: string; + value: Buffer; + } + function manageData(options: OperationOptions.ManageData): xdr.Operation; + + interface ManageOffer extends BaseOperation { + selling: Asset; + buying: Asset; + amount: string; + price: string; + offerId: string; + } + function manageOffer(options: OperationOptions.ManageOffer): xdr.Operation; + + interface PathPayment extends BaseOperation { + sendAsset: Asset; + sendMax: string; + destination: string; + destAsset: Asset; + destAmount: string; + path: Asset[]; + } + function pathPayment(options: OperationOptions.PathPayment): xdr.Operation; + + interface Payment extends BaseOperation { + amount: string; + asset: Asset; + destination: string; + } + function payment(options: OperationOptions.Payment): xdr.Operation; + + interface SetOptions extends BaseOperation { + inflationDest?: string; + clearFlags?: AuthFlag; + setFlags?: AuthFlag; + masterWeight?: number; + lowThreshold?: number; + medThreshold?: number; + highThreshold?: number; + homeDomain?: string; + signer: + T extends {ed25519PublicKey: any} ? Signer.Ed25519PublicKey : + T extends {sha256Hash: any} ? Signer.Sha256Hash : + T extends {preAuthTx: any} ? Signer.PreAuthTx : + never; + } + function setOptions(options: OperationOptions.SetOptions): xdr.Operation>; + + interface BumpSequence extends BaseOperation { + bumpTo: string; + } + function bumpSequence(options: OperationOptions.BumpSequence): xdr.Operation; + + function fromXDRObject(xdrOperation: xdr.Operation): T; +} +export type Operation = Operation.CreateAccount | Operation.Payment | Operation.PathPayment @@ -158,224 +405,9 @@ export type TransactionOperation = | Operation.AccountMerge | Operation.Inflation | Operation.ManageData - | Operation.BumpSequence; - -export namespace OperationType { - type createAccount = 'createAccount'; - type payment = 'payment'; - type pathPayment = 'pathPayment'; - type createPassiveOffer = 'createPassiveOffer'; - type manageOffer = 'manageOffer'; - type setOptions = 'setOptions'; - type changeTrust = 'changeTrust'; - type allowTrust = 'allowTrust'; - type accountMerge = 'accountMerge'; - type inflation = 'inflation'; - type manageData = 'manageData'; - type bumpSequence = 'bumpSequence'; -} -export type OperationType = - | OperationType.createAccount - | OperationType.payment - | OperationType.pathPayment - | OperationType.createPassiveOffer - | OperationType.manageOffer - | OperationType.setOptions - | OperationType.changeTrust - | OperationType.allowTrust - | OperationType.accountMerge - | OperationType.inflation - | OperationType.manageData - | OperationType.bumpSequence + | Operation.BumpSequence ; -export namespace Operation { - interface Operation { - type: T; - source?: string; - } - interface OperationOptions { - source?: string; - } - - interface AccountMerge extends Operation { - destination: string; - } - interface AccountMergeOptions extends OperationOptions { - destination: string; - } - function accountMerge(options: AccountMergeOptions): xdr.Operation; - - interface AllowTrust extends Operation { - trustor: string; - assetCode: string; - authorize: boolean | undefined; - } - interface AllowTrustOptions extends OperationOptions { - trustor: string; - assetCode: string; - authorize?: boolean; - } - function allowTrust(options: AllowTrustOptions): xdr.Operation; - - interface ChangeTrust extends Operation { - line: Asset; - limit: string; - } - interface ChangeTrustOptions extends OperationOptions { - asset: Asset; - limit?: string; - } - function changeTrust(options: ChangeTrustOptions): xdr.Operation; - - interface CreateAccount extends Operation { - destination: string; - startingBalance: string; - } - interface CreateAccountOptions extends OperationOptions { - destination: string; - startingBalance: string; - } - function createAccount(options: CreateAccountOptions): xdr.Operation; - - interface CreatePassiveOffer extends Operation { - selling: Asset; - buying: Asset; - amount: string; - price: string; - } - interface CreatePassiveOfferOptions extends OperationOptions { - selling: Asset; - buying: Asset; - amount: string; - price: number | string | object /* bignumber.js */; - } - function createPassiveOffer(options: CreatePassiveOfferOptions): xdr.Operation; - - interface Inflation extends Operation { - } - interface InflationOptions extends OperationOptions { // tslint:disable-line - } - function inflation(options: InflationOptions): xdr.Operation; - - interface ManageData extends Operation { - name: string; - value: Buffer; - } - interface ManageDataOptions extends OperationOptions { - name: string; - value: string | Buffer; - } - function manageData(options: ManageDataOptions): xdr.Operation; - - interface ManageOffer extends Operation { - selling: Asset; - buying: Asset; - amount: string; - price: string; - offerId: string; - } - interface ManageOfferOptions extends CreatePassiveOfferOptions { - offerId?: number | string; - } - function manageOffer(options: ManageOfferOptions): xdr.Operation; - - interface PathPayment extends Operation { - sendAsset: Asset; - sendMax: string; - destination: string; - destAsset: Asset; - destAmount: string; - path: Asset[]; - } - interface PathPaymentOptions extends OperationOptions { - sendAsset: Asset; - sendMax: string; - destination: string; - destAsset: Asset; - destAmount: string; - path?: Asset[]; - } - function pathPayment(options: PathPaymentOptions): xdr.Operation; - - interface Payment extends Operation { - amount: string; - asset: Asset; - destination: string; - } - interface PaymentOptions extends OperationOptions { - amount: string; - asset: Asset; - destination: string; - } - function payment(options: PaymentOptions): xdr.Operation; - - interface SignerEd25519PublicKey { - ed25519PublicKey: string; - weight: number | undefined; - } - interface SignerSha256Hash { - sha256Hash: Buffer; - weight: number | undefined; - } - interface SignerPreAuthTx { - preAuthTx: Buffer; - weight: number | undefined; - } - type Signer = SignerEd25519PublicKey | SignerSha256Hash | SignerPreAuthTx; - interface SignerEd25519PublicKeyOptions { - ed25519PublicKey: string; - weight?: number | string; - } - interface SignerSha256HashOptions { - sha256Hash: Buffer | string; - weight?: number | string; - } - interface SignerPreAuthTxOptions { - preAuthTx: Buffer | string; - weight?: number | string; - } - type SignerOptions = SignerEd25519PublicKeyOptions | SignerSha256HashOptions | SignerPreAuthTxOptions; - type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; - interface SetOptions extends Operation { - inflationDest?: string; - clearFlags?: AuthFlag; - setFlags?: AuthFlag; - masterWeight?: number; - lowThreshold?: number; - medThreshold?: number; - highThreshold?: number; - homeDomain?: string; - signer: - T extends {ed25519PublicKey: any} ? SignerEd25519PublicKey : - T extends {sha256Hash: any} ? SignerSha256Hash : - T extends {preAuthTx: any} ? SignerPreAuthTx : - never; - } - interface SetOptionsOptions extends OperationOptions { - inflationDest?: string; - clearFlags?: AuthFlag; - setFlags?: AuthFlag; - masterWeight?: number | string; - lowThreshold?: number | string; - medThreshold?: number | string; - highThreshold?: number | string; - homeDomain?: string; - signer?: T; - } - function setOptions(options: SetOptionsOptions): xdr.Operation>; - - interface BumpSequence extends Operation { - bumpTo: string; - } - interface BumpSequenceOptions extends OperationOptions { - bumpTo: string; - } - function bumpSequence(options: BumpSequenceOptions): xdr.Operation; - - function fromXDRObject(xdrOperation: xdr.Operation): T; -} - export namespace StrKey { function encodeEd25519PublicKey(data: Buffer): string; function decodeEd25519PublicKey(data: string): Buffer; @@ -392,7 +424,7 @@ export namespace StrKey { function decodeSha256Hash(data: string): Buffer; } -export class Transaction { +export class Transaction { constructor(envelope: string | xdr.TransactionEnvelope) hash(): Buffer; sign(...keypairs: Keypair[]): void; @@ -426,6 +458,13 @@ export namespace TransactionBuilder { } } +// Hidden namespace as hack to work around name collision. +declare namespace xdrHidden { // tslint:disable-line:strict-export-declare-modifiers + class Operation2 extends xdr.XDRStruct { + static fromXDR(xdr: Buffer): xdr.Operation; + } +} + export namespace xdr { class XDRStruct { static fromXDR(xdr: Buffer): XDRStruct; @@ -433,9 +472,7 @@ export namespace xdr { toXDR(base?: string): Buffer; toXDR(encoding: string): string; } - class Operation extends XDRStruct { - static fromXDR(xdr: Buffer): Operation; - } + export import Operation = xdrHidden.Operation2; // tslint:disable-line:strict-export-declare-modifiers class Asset extends XDRStruct { static fromXDR(xdr: Buffer): Asset; } diff --git a/types/stellar-base/stellar-base-tests.ts b/types/stellar-base/stellar-base-tests.ts index 8b703d4c84..9950120554 100644 --- a/types/stellar-base/stellar-base-tests.ts +++ b/types/stellar-base/stellar-base-tests.ts @@ -6,7 +6,7 @@ const account = new StellarSdk.Account(sourceKey.publicKey(), '1'); const transaction = new StellarSdk.TransactionBuilder(account) .addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()})) .addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo")) - .build(); // $ExpectType () => Transaction, TransactionOperation[]> + .build(); // $ExpectType () => Transaction, Operation[]> const sig = StellarSdk.xdr.DecoratedSignature.fromXDR(Buffer.of(1, 2)); // $ExpectType DecoratedSignature sig.hint(); // $ExpectType Buffer @@ -31,10 +31,10 @@ const noSignerXDR = StellarSdk.Operation.setOptions({lowThreshold: 1}); StellarSdk.Operation.fromXDRObject(noSignerXDR).signer; // $ExpectType never const newSignerXDR1 = StellarSdk.Operation.setOptions({signer: {ed25519PublicKey: sourceKey.publicKey(), weight: '1'}}); -StellarSdk.Operation.fromXDRObject(newSignerXDR1).signer; // $ExpectType SignerEd25519PublicKey +StellarSdk.Operation.fromXDRObject(newSignerXDR1).signer; // $ExpectType Ed25519PublicKey const newSignerXDR2 = StellarSdk.Operation.setOptions({signer: {sha256Hash: Buffer.from(''), weight: '1'}}); -StellarSdk.Operation.fromXDRObject(newSignerXDR2).signer; // $ExpectType SignerSha256Hash +StellarSdk.Operation.fromXDRObject(newSignerXDR2).signer; // $ExpectType Sha256Hash const newSignerXDR3 = StellarSdk.Operation.setOptions({signer: {preAuthTx: '', weight: 1}}); -StellarSdk.Operation.fromXDRObject(newSignerXDR3).signer; // $ExpectType SignerPreAuthTx +StellarSdk.Operation.fromXDRObject(newSignerXDR3).signer; // $ExpectType PreAuthTx diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 5afec167cd..58336bc456 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -37,9 +37,10 @@ export { Operation, OperationType, StrKey, + Signer, + SignerOptions, Transaction, TransactionBuilder, - TransactionOperation, hash, sign, verify, From 326ee2bd7c1b4ebb43dab01d05763b7bbcd86ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 12:54:49 +0200 Subject: [PATCH 258/646] refactor: simplify SignerUnion --- types/stellar-base/index.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/stellar-base/index.d.ts b/types/stellar-base/index.d.ts index e47c28e3e7..fa107e1922 100644 --- a/types/stellar-base/index.d.ts +++ b/types/stellar-base/index.d.ts @@ -186,7 +186,6 @@ export type SignerOptions = | SignerOptions.Sha256Hash | SignerOptions.PreAuthTx ; -export type SignerUnion = {ed25519PublicKey: any} | {sha256Hash: any} | {preAuthTx: any} | null; export namespace OperationType { type CreateAccount = 'createAccount'; @@ -265,7 +264,7 @@ export namespace OperationOptions { asset: Asset; destination: string; } - interface SetOptions extends BaseOptions { + interface SetOptions extends BaseOptions { inflationDest?: string; clearFlags?: AuthFlag; setFlags?: AuthFlag; @@ -369,7 +368,7 @@ export namespace Operation { } function payment(options: OperationOptions.Payment): xdr.Operation; - interface SetOptions extends BaseOperation { + interface SetOptions extends BaseOperation { inflationDest?: string; clearFlags?: AuthFlag; setFlags?: AuthFlag; @@ -384,7 +383,7 @@ export namespace Operation { T extends {preAuthTx: any} ? Signer.PreAuthTx : never; } - function setOptions(options: OperationOptions.SetOptions): xdr.Operation>; + function setOptions(options: OperationOptions.SetOptions): xdr.Operation>; interface BumpSequence extends BaseOperation { bumpTo: string; From ff90ed990cfd17bec6f7c82f702e896b4378e3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 12:59:25 +0200 Subject: [PATCH 259/646] test: disable weird-behaviour test --- types/stellar-base/stellar-base-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/stellar-base/stellar-base-tests.ts b/types/stellar-base/stellar-base-tests.ts index 9950120554..81409bb1c1 100644 --- a/types/stellar-base/stellar-base-tests.ts +++ b/types/stellar-base/stellar-base-tests.ts @@ -25,7 +25,7 @@ StellarSdk.Memo.hash('asdf').value; // $ExpectType Buffer // P.S. don't use Memo constructor (new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).value; // $ExpectType MemoValue -(new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).type; // $ExpectType MemoType +// (new StellarSdk.Memo(StellarSdk.MemoHash, 'asdf')).type; // $ExpectType MemoType // TODO: Inspect what's wrong with linter. const noSignerXDR = StellarSdk.Operation.setOptions({lowThreshold: 1}); StellarSdk.Operation.fromXDRObject(noSignerXDR).signer; // $ExpectType never From 5a23b6d05ee17e3578834ae30f269f6d0eefad3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 13:01:41 +0200 Subject: [PATCH 260/646] fix: export forgot OperationType --- types/stellar-sdk/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 58336bc456..cf05b3412d 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -35,6 +35,7 @@ export { Network, Networks, Operation, + OperationOptions, OperationType, StrKey, Signer, From c62f0dc807d4fedfa0c1a1e8ccd7ab0bd4718e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Thu, 10 Jan 2019 13:41:59 +0200 Subject: [PATCH 261/646] fix: Memo.text can be either string or Buffer --- types/stellar-base/index.d.ts | 2 +- types/stellar-base/stellar-base-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/stellar-base/index.d.ts b/types/stellar-base/index.d.ts index fa107e1922..a230c36942 100644 --- a/types/stellar-base/index.d.ts +++ b/types/stellar-base/index.d.ts @@ -108,7 +108,7 @@ export class Memo { value: T extends MemoType.None ? null : T extends MemoType.ID ? string : - T extends MemoType.Text ? string : + T extends MemoType.Text ? string | Buffer : // github.com/stellar/js-stellar-base/issues/152 T extends MemoType.Hash ? Buffer : T extends MemoType.Return ? Buffer : MemoValue; diff --git a/types/stellar-base/stellar-base-tests.ts b/types/stellar-base/stellar-base-tests.ts index 81409bb1c1..83a52cbe7b 100644 --- a/types/stellar-base/stellar-base-tests.ts +++ b/types/stellar-base/stellar-base-tests.ts @@ -19,7 +19,7 @@ StellarSdk.Memo.return('asdf'); // $ExpectType Memo<"return"> StellarSdk.Memo.hash('asdf'); // $ExpectType Memo<"hash"> StellarSdk.Memo.none().value; // $ExpectType null StellarSdk.Memo.id('asdf').value; // $ExpectType string -StellarSdk.Memo.text('asdf').value; // $ExpectType string +StellarSdk.Memo.text('asdf').value; // $ExpectType string | Buffer StellarSdk.Memo.return('asdf').value; // $ExpectType Buffer StellarSdk.Memo.hash('asdf').value; // $ExpectType Buffer From 7e2eb46961c73ecb7c5d2538bfb0b8a1f959ecf8 Mon Sep 17 00:00:00 2001 From: denis Date: Thu, 10 Jan 2019 12:57:27 +0100 Subject: [PATCH 262/646] Activate strict function types Use ExpectError CurveFactory and CurveFactoryLineOnly are know types (TS 2.2) --- types/d3-shape/d3-shape-tests.ts | 78 +++++++++++++++----------- types/d3-shape/index.d.ts | 96 ++++++++++++++------------------ types/d3-shape/tsconfig.json | 2 +- types/d3-shape/tslint.json | 3 - 4 files changed, 91 insertions(+), 88 deletions(-) diff --git a/types/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts index 8ad3e4809a..fb79b15e4a 100644 --- a/types/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -161,8 +161,9 @@ accessorArcDatumNumberOrNull = svgArc.padRadius(); // centroid(...) --------------------------------------------------------------------- -const centroid: [number, number] = svgArc.centroid(arcDatum); -// centroid = svgArc.centroid(arcDefaultDatum); // fails, wrong datum type +let centroid: [number, number] = svgArc.centroid(arcDatum); +// $ExpectError +centroid = svgArc.centroid(arcDefaultDatum); // fails, wrong datum type // generate arc ---------------------------------------------------------------------- @@ -176,10 +177,13 @@ const wrongArc1: Selection = select = select('.arc-paths'); // mock pArc.attr('d', svgArc); -// wrongArc1.attr('d', svgArc); // fails, incompatible this contexts -// wrongArc2.attr('d', svgArc); // fails, incompatible datum types +// $ExpectError +wrongArc1.attr('d', svgArc); // fails, incompatible this contexts +// $ExpectError +wrongArc2.attr('d', svgArc); // fails, incompatible datum types -// pathStringMaybe = svgArc(arcDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgArc(arcDatum); // fails, wrong this type for invocation // Use with custom object @@ -270,13 +274,13 @@ let pie: d3Shape.Pie = d3Shape.pie(); // value(...) ------------------------------------------------------------------------- -let defaultPieValueAccessor: (d: number | { valueOf(): number }, i?: number, data?: Array) => number; +let defaultPieValueAccessor: (d: number | { valueOf(): number }, i: number, data: Array) => number; defaultPie = defaultPie.value(10); defaultPieValueAccessor = defaultPie.value(); -let pieValueAccessor: (d: PieDatum, i?: number, data?: PieDatum[]) => number; +let pieValueAccessor: (d: PieDatum, i: number, data: PieDatum[]) => number; pie = pie.value((d, i, data) => { console.log(data.length > 0 ? data[0].val : 'no data'); // data type is Array @@ -364,8 +368,8 @@ interface LineDatum { missing: boolean; } -let lineXYAccessorFn: (d: LineDatum, index?: number, data?: LineDatum[]) => number; -let lineDefAccessorFn: (d: LineDatum, index?: number, data?: LineDatum[]) => boolean; +let lineXYAccessorFn: (d: LineDatum, index: number, data: LineDatum[]) => number; +let lineDefAccessorFn: (d: LineDatum, index: number, data: LineDatum[]) => boolean; interface LineRadialDatum { angle: number; @@ -373,8 +377,8 @@ interface LineRadialDatum { missing: boolean; } -let lineRadialAngRAccessorFn: (d: LineRadialDatum, index?: number, data?: LineRadialDatum[]) => number; -let lineRadialDefAccessorFn: (d: LineRadialDatum, index?: number, data?: LineRadialDatum[]) => boolean; +let lineRadialAngRAccessorFn: (d: LineRadialDatum, index: number, data: LineRadialDatum[]) => number; +let lineRadialDefAccessorFn: (d: LineRadialDatum, index: number, data: LineRadialDatum[]) => boolean; // line(...) create Line generator ===================================================== @@ -541,9 +545,9 @@ interface AreaDatum { missing: boolean; } -let areaXYAccessorFn: (d: AreaDatum, index?: number, data?: AreaDatum[]) => number; -let areaXYAccessorFnMaybe: null | ((d: AreaDatum, index?: number, data?: AreaDatum[]) => number); -let areaDefAccessorFn: (d: AreaDatum, index?: number, data?: AreaDatum[]) => boolean; +let areaXYAccessorFn: (d: AreaDatum, index: number, data: AreaDatum[]) => number; +let areaXYAccessorFnMaybe: null | ((d: AreaDatum, index: number, data: AreaDatum[]) => number); +let areaDefAccessorFn: (d: AreaDatum, index: number, data: AreaDatum[]) => boolean; interface AreaRadialDatum { startAngle: number; @@ -553,9 +557,9 @@ interface AreaRadialDatum { missing: boolean; } -let areaRadialAngRAccessorFn: (d: AreaRadialDatum, index?: number, data?: AreaRadialDatum[]) => number; -let areaRadialAngRAccessorFnMaybe: null | ((d: AreaRadialDatum, index?: number, data?: AreaRadialDatum[]) => number); -let areaRadialDefAccessorFn: (d: AreaRadialDatum, index?: number, data?: AreaRadialDatum[]) => boolean; +let areaRadialAngRAccessorFn: (d: AreaRadialDatum, index: number, data: AreaRadialDatum[]) => number; +let areaRadialAngRAccessorFnMaybe: null | ((d: AreaRadialDatum, index: number, data: AreaRadialDatum[]) => number); +let areaRadialDefAccessorFn: (d: AreaRadialDatum, index: number, data: AreaRadialDatum[]) => boolean; // area(...) create Area generator ===================================================== @@ -662,7 +666,8 @@ areaDefAccessorFn = area.defined(); defaultArea = defaultArea.curve(d3Shape.curveLinear); area = area.curve(d3Shape.curveCardinal.tension(0.5)); -// area = area.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods +// $ExpectError +area = area.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods currentCurveFactory = area.curve(); @@ -800,7 +805,8 @@ areaRadialDefAccessorFn = areaRadial.defined(); defaultAreaRadial = defaultAreaRadial.curve(d3Shape.curveLinear); areaRadial = areaRadial.curve(d3Shape.curveCardinal.tension(0.5)); -// areaRadial = areaRadial.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods +// $ExpectError +areaRadial = areaRadial.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods currentCurveFactory = areaRadial.curve(); @@ -868,7 +874,8 @@ curveBundleFactory = d3Shape.curveBundle.beta(0.5); lineOnlyGenerator = d3Shape.curveBundle.beta(0.5)(context!); // force context to be non-null with post-fix for mock lineOnlyGenerator = d3Shape.curveBundle.beta(0.5)(path()); -// curveGenerator = d3Shape.curveBundle.beta(0.5)(context); // fails, no area related methods +// $ExpectError +curveGenerator = d3Shape.curveBundle.beta(0.5)(context); // fails, no area related methods let curveCardinalFactory: d3Shape.CurveCardinalFactory; @@ -1153,22 +1160,28 @@ defaultLinkRadial(defaultLinkDatum); // vertical/horizontal pLink.attr('d', svgLink); -// wrongLink1.attr('d', svgLink); // fails, incompatible this contexts -// wrongLink2.attr('d', svgLink); // fails, incompatible datum types +// $ExpectError +wrongLink1.attr('d', svgLink); // fails, incompatible this contexts +// $ExpectError +wrongLink2.attr('d', svgLink); // fails, incompatible datum types pathStringMaybe = link(linkDatum); -// pathStringMaybe = svgLink(linkDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgLink(linkDatum); // fails, wrong this type for invocation // radial pLink.attr('d', svgLinkRadial); -// wrongLink1.attr('d', svgLinkRadial); // fails, incompatible this contexts -// wrongLink2.attr('d', svgLinkRadial); // fails, incompatible datum types +// $ExpectError +wrongLink1.attr('d', svgLinkRadial); // fails, incompatible this contexts +// $ExpectError +wrongLink2.attr('d', svgLinkRadial); // fails, incompatible datum types pathStringMaybe = radialLink(linkDatum); -// pathStringMaybe = svgLinkRadial(linkDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgLinkRadial(linkDatum); // fails, wrong this type for invocation // ----------------------------------------------------------------------------------- // Test Symbols @@ -1259,10 +1272,13 @@ const wrongSymbol1: Selection = select< const wrongSymbol2: Selection = select('.symbol-path'); // mock pSymbol.attr('d', svgSymbol); -// wrongSymbol1.attr('d', svgSymbol); // fails, incompatible this contexts -// wrongSymbol2.attr('d', svgSymbol); // fails, incompatible datum types +// $ExpectError +wrongSymbol1.attr('d', svgSymbol); // fails, incompatible this contexts +// $ExpectError +wrongSymbol2.attr('d', svgSymbol); // fails, incompatible datum types -// pathStringMaybe = svgSymbol(symbolDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgSymbol(symbolDatum); // fails, wrong this type for invocation // Use with custom object @@ -1390,11 +1406,11 @@ keysAccessor = overlyComplicatedStack.keys(); defaultStack = defaultStack.value(30); -overlyComplicatedStack = overlyComplicatedStack.value((d, key, j, data) => { +overlyComplicatedStack = overlyComplicatedStack.value((d, key, i, data) => { return d.values[key.name]; }); -let valueAccessorFn: (this: any, d: StackDatum, key: StackKey, j?: number, data?: StackDatum[]) => number; +let valueAccessorFn: (d: StackDatum, key: StackKey, i: number, data: StackDatum[]) => number; valueAccessorFn = overlyComplicatedStack.value(); // order(...) ---------------------------------------------------------------------- diff --git a/types/d3-shape/index.d.ts b/types/d3-shape/index.d.ts index 0c0e27cbd7..ed64d6f827 100644 --- a/types/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for D3JS d3-shape module 1.2 // Project: https://github.com/d3/d3-shape/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -38,7 +41,7 @@ export interface CanvasPath_D3Shape { // ----------------------------------------------------------------------------------- /** - * Interface corresponding to the minimum data type assumed by the accessor functions of the Arc generator + * Interface corresponding to the minimum data type assumed by the accessor functions of the Arc generator. */ export interface DefaultArcObject { /** @@ -385,7 +388,7 @@ export function arc(): Arc; */ export interface PieArcDatum { /** - * The input datum; the corresponding element in the input data array of the Pie generator + * The input datum; the corresponding element in the input data array of the Pie generator. */ data: T; /** @@ -439,7 +442,6 @@ export interface Pie { /** * Returns the current value accessor, which defaults to a function returning the first argument passed into it. * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. - * */ value(): (d: Datum, i: number, data: Datum[]) => number; /** @@ -455,7 +457,6 @@ export interface Pie { * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. * If your data are not simply numbers, then you should specify an accessor that returns the corresponding numeric value for a given datum. * - * * @param value A value accessor function, which is invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. * It returns a numeric value. */ @@ -506,7 +507,6 @@ export interface Pie { * @param comparator The value comparator takes two arguments a and b which are values derived from the input data array using the value accessor, not the data elements. * If the arc for a should be before the arc for b, then the comparator must return a number less than zero; * if the arc for a should be after the arc for b, then the comparator must return a number greater than zero; returning zero means that the relative order of a and b is unspecified. - * */ sortValues(comparator: (a: number, b: number) => number): this; /** @@ -737,7 +737,7 @@ export interface Line { * Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -912,7 +912,7 @@ export interface LineRadial { * Note that if a radial line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -1166,7 +1166,6 @@ export interface Area { * two-element array of numbers. * * If the y1 accessor is null, the previously-computed y0 value is reused for the y1 value. - * */ y1(): ((d: Datum, index: number, data: Datum[]) => number) | null; /** @@ -1209,9 +1208,9 @@ export interface Area { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -1228,7 +1227,7 @@ export interface Area { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, * being passed the element d, the index i, and the array data as three arguments. @@ -1248,7 +1247,6 @@ export interface Area { /** * Sets the curve factory and returns this area generator. * - * * @param curve A valid curve factory. */ curve(curve: CurveFactory): this; @@ -1470,7 +1468,6 @@ export interface AreaRadial { * two-element array of numbers. * * If the outerRadius accessor is null, the previously-computed innerRadius value is reused for the outerRadius value. - * */ outerRadius(): ((d: Datum, index: number, data: Datum[]) => number) | null; /** @@ -1515,9 +1512,9 @@ export interface AreaRadial { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -1533,7 +1530,7 @@ export interface AreaRadial { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, * being passed the element d, the index i, and the array data as three arguments. @@ -1668,16 +1665,13 @@ export interface CurveGeneratorLineOnly { /** * A factory for curve generators addressing only lines, but not areas. */ -// This is a base interface to be extended, hence the suppression of the warning -// tslint:disable-next-line:callable-types -export interface CurveFactoryLineOnly { +export type CurveFactoryLineOnly = /** * Returns a "lines only" curve generator which renders to the specified context. * - * @param context A rendering context + * @param context A rendering context. */ - (context: CanvasRenderingContext2D | Path): CurveGeneratorLineOnly; -} + (context: CanvasRenderingContext2D | Path) => CurveGeneratorLineOnly; /** * A minimal interface for a curve generator which supports the rendering of lines and areas. @@ -1704,16 +1698,13 @@ export interface CurveGenerator extends CurveGeneratorLineOnly { /** * A factory for curve generators addressing both lines and areas. */ -// This is a base interface to be extended, hence the suppression of the warning -// tslint:disable-next-line:callable-types -export interface CurveFactory { +export type CurveFactory = /** * Returns a curve generator which renders to the specified context. * - * @param context A rendering context + * @param context A rendering context. */ - (context: CanvasRenderingContext2D | Path): CurveGenerator; -} + (context: CanvasRenderingContext2D | Path) => CurveGenerator; /** * A curve factory for cubic basis spline generators. @@ -1924,7 +1915,7 @@ export const curveStepBefore: CurveFactory; /** * An interface describing the default Link Data structure expected - * by the Link and LinkRadial generators + * by the Link and LinkRadial generators. */ export interface DefaultLinkObject { /** @@ -2077,7 +2068,7 @@ export function linkHorizontal(): Link * * The first generic corresponds to the datum type of the link object for which the link is to be generated. * - * The second generic corresponds to the datum type of the source/target node contained in the link object + * The second generic corresponds to the datum type of the source/target node contained in the link object. */ export function linkHorizontal(): Link; /** @@ -2091,7 +2082,7 @@ export function linkHorizontal(): Link(): Link; @@ -2111,7 +2102,7 @@ export function linkVertical(): Link; * * The first generic corresponds to the datum type of the link object for which the link is to be generated. * - * The second generic corresponds to the datum type of the source/target node contained in the link object + * The second generic corresponds to the datum type of the source/target node contained in the link object. */ export function linkVertical(): Link; /** @@ -2125,7 +2116,7 @@ export function linkVertical(): Link(): Link; @@ -2262,7 +2253,7 @@ export function linkRadial(): LinkRadial(): LinkRadial; /** @@ -2276,7 +2267,7 @@ export function linkRadial(): LinkRadial(): LinkRadial; @@ -2289,7 +2280,7 @@ export function linkRadial(): LinkRadial { /** * Sets the symbol type to the specified symbol type and returns this symbol generator. * - * * @param type A constant symbol type. */ type(type: SymbolType): this; @@ -2485,7 +2475,7 @@ export function pointRadial(angle: number, radius: number): [number, number]; * the difference between y0 and y1 corresponds to the computed value for this point. * * SeriesPoint is a [number, number] two-element Array with added data and index properties - * related to the data element which formed the basis for theSeriesPoint + * related to the data element which formed the basis for theSeriesPoint. */ export interface SeriesPoint extends Array { /** @@ -2510,11 +2500,11 @@ export interface SeriesPoint extends Array { */ export interface Series extends Array> { /** - * Key of the series + * Key of the series. */ key: Key; /** - * Index of the series in the series array returned by stack generator + * Index of the series in the series array returned by stack generator. */ index: number; } @@ -2578,7 +2568,7 @@ export interface Stack { * * Thus, by default the stack generator assumes that the input data is an array of objects, with each object exposing named properties with numeric values; see stack for an example. */ - value(): (d: Datum, key: Key, j: number, data: Datum[]) => number; + value(): (d: Datum, key: Key, i: number, data: Datum[]) => number; /** * Sets the value accessor to the specified number and returns this stack generator. * @@ -2591,7 +2581,7 @@ export interface Stack { * @param value A value accessor function which returns the numeric value for a given data element and key combination. The accessor function is invoked for each data element and key being passed * the datum, the key, index of the data element in the input data array, and the complete data array. */ - value(value: (d: Datum, key: Key, j: number, data: Datum[]) => number): this; + value(value: (d: Datum, key: Key, i: number, data: Datum[]) => number): this; /** * Returns the current order accessor, which defaults to stackOrderNone; this uses the order given by the key accessor. @@ -2683,14 +2673,14 @@ export function stack(): Stack; /** * Returns a series order such that the smallest series (according to the sum of values) is at the bottom. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderAscending(series: Series): number[]; /** * Returns a series order such that the largest series (according to the sum of values) is at the bottom. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderDescending(series: Series): number[]; @@ -2698,28 +2688,28 @@ export function stackOrderDescending(series: Series): number[]; * Returns a series order such that the larger series (according to the sum of values) are on the inside and the smaller series are on the outside. * This order is recommended for streamgraphs in conjunction with the wiggle offset. See Stacked Graphs—Geometry & Aesthetics by Byron & Wattenberg for more information. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderInsideOut(series: Series): number[]; /** * Returns the given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderNone(series: Series): number[]; /** * Returns the reverse of the given series order [n - 1, n - 2, … 0] where n is the number of elements in series. Thus, the stack order is given by the reverse of the key accessor. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderReverse(series: Series): number[]; /** * Applies a zero baseline and normalizes the values for each point such that the topline is always one. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetExpand(series: Series, order: number[]): void; @@ -2727,7 +2717,7 @@ export function stackOffsetExpand(series: Series, order: number[]): vo /** * Positive values are stacked above zero, while negative values are stacked below zero. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetDiverging(series: Series, order: number[]): void; @@ -2735,7 +2725,7 @@ export function stackOffsetDiverging(series: Series, order: number[]): /** * Applies a zero baseline. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetNone(series: Series, order: number[]): void; @@ -2743,7 +2733,7 @@ export function stackOffsetNone(series: Series, order: number[]): void /** * Shifts the baseline down such that the center of the streamgraph is always at zero. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetSilhouette(series: Series, order: number[]): void; @@ -2752,7 +2742,7 @@ export function stackOffsetSilhouette(series: Series, order: number[]) * Shifts the baseline so as to minimize the weighted wiggle of layers. This offset is recommended for streamgraphs in conjunction with the inside-out order. * See Stacked Graphs—Geometry & Aesthetics by Bryon & Wattenberg for more information. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetWiggle(series: Series, order: number[]): void; diff --git a/types/d3-shape/tsconfig.json b/types/d3-shape/tsconfig.json index 0436aafd66..093e9b98c3 100644 --- a/types/d3-shape/tsconfig.json +++ b/types/d3-shape/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-shape/tslint.json b/types/d3-shape/tslint.json index b1ba182ba6..54efb0b84e 100644 --- a/types/d3-shape/tslint.json +++ b/types/d3-shape/tslint.json @@ -1,10 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - // TODO - "no-this-assignment": false, "unified-signatures": false, - "callable-types": false, "no-unnecessary-generics": false } } From dd7d86df5397c277839c3fe605f1ec89be7f2075 Mon Sep 17 00:00:00 2001 From: Daniel Schopf Date: Wed, 9 Jan 2019 16:55:40 +0100 Subject: [PATCH 263/646] added userResHeaderDecorator --- types/express-http-proxy/express-http-proxy-tests.ts | 8 ++++++++ types/express-http-proxy/index.d.ts | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/express-http-proxy/express-http-proxy-tests.ts b/types/express-http-proxy/express-http-proxy-tests.ts index 16e03cc974..56156369cc 100644 --- a/types/express-http-proxy/express-http-proxy-tests.ts +++ b/types/express-http-proxy/express-http-proxy-tests.ts @@ -16,5 +16,13 @@ proxy('www.google.com', { console.log(proxyReqOpts.headers, proxyReqOpts.method); console.log(srcReq.url, srcReq.cookies); return proxyReqOpts; + }, + userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes) { + console.log(userReq.url, userRes.statusCode); + console.log(proxyReq.url, proxyRes.statusCode); + if (headers["content-type"] === "image/png") { + headers["x-custom-header"] = "additional-info"; + } + return headers; } }); diff --git a/types/express-http-proxy/index.d.ts b/types/express-http-proxy/index.d.ts index 031be01485..3a74bef6db 100644 --- a/types/express-http-proxy/index.d.ts +++ b/types/express-http-proxy/index.d.ts @@ -1,15 +1,18 @@ // Type definitions for express-http-proxy 1.5 // Project: https://github.com/villadora/express-http-proxy#readme -// Definitions by: ulrichb +// Definitions by: ulrichb +// Daniel Schopf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 import { RequestHandler, Request } from "express"; -import { RequestOptions } from "http"; +import { RequestOptions, IncomingHttpHeaders, OutgoingHttpHeaders } from "http"; +import { Response } from "express-serve-static-core"; interface ProxyOptions { proxyReqPathResolver?: (req: Request) => string; proxyReqOptDecorator?: (proxyReqOpts: RequestOptions, srcReq: Request) => RequestOptions; + userResHeaderDecorator?: (headers: IncomingHttpHeaders, userReq: Request, userRes: Response, proxyReq: Request, proxyRes: Response) => OutgoingHttpHeaders; } declare function proxy(host: string, options?: ProxyOptions): RequestHandler; From 9d17c7aee088283ebe06ebc58556b0bdc9e5f31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Thu, 10 Jan 2019 15:02:24 +0100 Subject: [PATCH 264/646] Removing myself as a maintainer of react-virtualized types --- types/react-virtualized/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index 6293d20c9e..31bcec8eb7 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -4,7 +4,6 @@ // John Gunther // Konstantin Nesterov // Szőke Szabolcs -// Kræn Hansen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 From 6526d47516029f3f38e9e6efc50e7b1aec5b1769 Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Wed, 9 Jan 2019 10:38:28 -0500 Subject: [PATCH 265/646] Add type for qunit's `assert.rejects` --- types/qunit/index.d.ts | 28 +++++++++++++++++++++++ types/qunit/qunit-tests.ts | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/types/qunit/index.d.ts b/types/qunit/index.d.ts index 120c61d667..2b8851848c 100644 --- a/types/qunit/index.d.ts +++ b/types/qunit/index.d.ts @@ -236,6 +236,34 @@ interface Assert { throws(block: () => void, expected?: any, message?: any): void; raises(block: () => void, expected?: any, message?: any): void; + /** + * Test if the provided promise rejects, and optionally compare the + * rejection value. + * + * When testing code that is expected to return a rejected promise based on + * a specific set of circumstances, use assert.rejects() for testing and + * comparison. + * + * The expectedMatcher argument can be: + * A function that returns true when the assertion should be considered passing. + * An Error object + * A base constructor to use ala rejectionValue instanceof expectedMatcher + * A RegExp that matches (or partially matches) rejectionValue.toString() + * + * Note: in order to avoid confusion between the message and the expectedMatcher, + * the expectedMatcher can not be a string. + * + * @param promise promise to test for rejection + * @param expectedMatcher Rejection value matcher + * @param message A short description of the assertion + */ + rejects(promise: Promise, message?: string): void; + rejects( + promise: Promise, + expectedMatcher?: any, + message?: string, + ): void; + /** * A marker for progress in a given test. * diff --git a/types/qunit/qunit-tests.ts b/types/qunit/qunit-tests.ts index ae519cd0bc..b90346a325 100644 --- a/types/qunit/qunit-tests.ts +++ b/types/qunit/qunit-tests.ts @@ -562,6 +562,53 @@ QUnit.test( "throws", function( assert ) { ); }); +QUnit.test( "rejects", function( assert ) { + + assert.rejects(Promise.reject("some error description")); + + assert.rejects( + Promise.reject(new Error("some error description")), + "rejects with just a message, not using the 'expectedMatcher' argument" + ); + + assert.rejects( + Promise.reject(new Error("some error description")), + /description/, + "`rejectionValue.toString()` contains `description`" + ); + + // Using a custom error like object + class CustomError { + message?: string; + constructor(message?: string) { + this.message = message; + } + toString() { + return this.message; + } + } + + assert.rejects( + Promise.reject(new CustomError()), + CustomError, + "raised error is an instance of CustomError" + ); + + assert.rejects( + Promise.reject(new CustomError("some error description")), + new CustomError("some error description"), + "raised error instance matches the CustomError instance" + ); + + assert.rejects( + Promise.reject(new CustomError("some error description")), + function( err ) { + return err.toString() === "some error description"; + }, + "raised error instance satisfies the callback function" + ); +}); + QUnit.module( "module", { beforeEach: function( assert ) { assert.ok( true, "one extra assert per test" ); From 92bf1b0a82c317e0d0611a69d52eb056821625e2 Mon Sep 17 00:00:00 2001 From: James Lismore Date: Thu, 10 Jan 2019 13:46:54 -0500 Subject: [PATCH 266/646] Add offset to VictoryGroup prop --- types/victory/index.d.ts | 7 +++++++ types/victory/victory-tests.tsx | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 956477e7ef..74ab293ac1 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -1529,6 +1529,13 @@ declare module "victory" { * or horizontal if the prop is set to true. */ horizontal?: boolean; + /** + * The offset prop determines the number of pixels each element in a group should + * be offset from its original position of the on the independent axis. In the + * case of groups of bars, this number should be equal to the width of the bar + * plus the desired spacing between bars. + */ + offset?:number /** * The style prop specifies styles for your grouped chart. These styles will be * applied to all grouped children diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index 83be8dd38d..88e2dbbcd2 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -12,7 +12,8 @@ import { VictoryScatter, VictoryPie, VictoryTheme, - VictoryLegend + VictoryLegend, + VictoryGroup } from "victory"; // VictoryAnimation test @@ -418,6 +419,23 @@ test = ( ); +// VictoryGroup test +test = ( + + + + + +); + // VictoryLine test test = ( Date: Thu, 10 Jan 2019 14:07:08 -0500 Subject: [PATCH 267/646] [ember-qunit] Add `options` parameter to `setupTest` and friends --- types/ember-qunit/ember-qunit-tests.ts | 7 +++++++ types/ember-qunit/index.d.ts | 14 +++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/types/ember-qunit/ember-qunit-tests.ts b/types/ember-qunit/ember-qunit-tests.ts index acd9650f98..9e85253ae9 100644 --- a/types/ember-qunit/ember-qunit-tests.ts +++ b/types/ember-qunit/ember-qunit-tests.ts @@ -139,4 +139,11 @@ module('foo service', function(hooks) { setupTest(hooks); }); +// RFC-232 equivalent of https://github.com/ember-engines/ember-engines#unitintegration-testing-for-in-repo-engines +module('engine foo component', function(hooks) { + setupTest(hooks, { + resolver: Ember.Resolver.create() + }); +}); + start(); diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index 6b3188fdfc..1ce6f90483 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Derek Wickern // Mike North // Steve Calvert +// Dan Freeman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -46,6 +47,13 @@ declare module 'ember-qunit' { */ export function setResolver(resolver: Ember.Resolver): void; + interface SetupTestOptions { + /** + * The resolver to use when instantiating container-managed entities in the test. + */ + resolver?: Ember.Resolver; + } + /** * Sets up acceptance tests. * @@ -58,7 +66,7 @@ declare module 'ember-qunit' { * * `this.pauseTest` and `this.resumeTest` - allow easy pausing/resuming of tests. * * `this.element` which returns the DOM element representing the application's root element. */ - export function setupApplicationTest(hooks: NestedHooks): void; + export function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions): void; /** * Sets up tests that need to render snippets of templates. @@ -79,7 +87,7 @@ declare module 'ember-qunit' { * * this.$(...) - When jQuery is present, executes a jQuery selector with * the current this.element as its root */ - export function setupRenderingTest(hooks: NestedHooks): void; + export function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions): void; /** * Sets up tests that do not need to render snippets of templates. @@ -94,7 +102,7 @@ declare module 'ember-qunit' { * * this.set / this.setProperties - Allows setting values on the test context. * * this.get / this.getProperties - Retrieves values from the test context. */ - export function setupTest(hooks: NestedHooks): void; + export function setupTest(hooks: NestedHooks, options?: SetupTestOptions): void; export class QUnitAdapter extends Ember.Test.Adapter { } From c52608e5b4dcfaefadfb961cc089dccf7fedf837 Mon Sep 17 00:00:00 2001 From: Christian Ruigrok Date: Thu, 10 Jan 2019 20:25:41 +0100 Subject: [PATCH 268/646] Update match-sorter to 2.3 and fix issues with keys --- types/match-sorter/index.d.ts | 26 +-- types/match-sorter/match-sorter-tests.ts | 208 +++++++++++++---------- 2 files changed, 131 insertions(+), 103 deletions(-) diff --git a/types/match-sorter/index.d.ts b/types/match-sorter/index.d.ts index e1a7e8efe4..9d48e0b880 100644 --- a/types/match-sorter/index.d.ts +++ b/types/match-sorter/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for match-sorter 2.2 +// Type definitions for match-sorter 2.3 // Project: https://github.com/kentcdodds/match-sorter#readme // Definitions by: Claas Ahlrichs +// Christian Ruigrok // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace matchSorter { @@ -18,24 +19,15 @@ declare namespace matchSorter { } } -interface MinRanking { - minRanking: number; - key: string; -} - -interface MaxRanking { - maxRanking: number; - key: string; -} - -interface MinMaxRanking { - minRanking: number; - maxRanking: number; - key: string; +interface ExtendedKeyOptions { + minRanking?: number; + maxRanking?: number; + treshold?: number; + key: string | ((item: T) => string); } interface Options { - keys?: Array<(string | ((item: T) => string) | MinRanking | MaxRanking | MinMaxRanking)>; + keys?: Array string) | ExtendedKeyOptions>; threshold?: number; keepDiacritics?: boolean; } @@ -47,6 +39,6 @@ interface Options { * @param options - Some options to configure the sorter * @return the new sorted array */ -declare function matchSorter(items: T[], value: string, options?: Options): T[]; +declare function matchSorter(items: ReadonlyArray, value: string, options?: Options): T[]; export = matchSorter; diff --git a/types/match-sorter/match-sorter-tests.ts b/types/match-sorter/match-sorter-tests.ts index e1496cba9f..a6529f7998 100644 --- a/types/match-sorter/match-sorter-tests.ts +++ b/types/match-sorter/match-sorter-tests.ts @@ -2,129 +2,165 @@ import matchSorter = require('match-sorter'); // # Basic Sample { - const list = ['hi', 'hey', 'hello', 'sup', 'yo']; - matchSorter(list, 'h'); // ['hi', 'hey', 'hello'] - matchSorter(list, 'y'); // ['yo', 'hey'] - matchSorter(list, 'z'); // [] + const list = ['hi', 'hey', 'hello', 'sup', 'yo']; + matchSorter(list, 'h'); // ['hi', 'hey', 'hello'] + matchSorter(list, 'y'); // ['yo', 'hey'] + matchSorter(list, 'z'); // [] } // # Advanced options // ## keys: [string] { - const objList = [ - {name: 'Janice', color: 'Green'}, - {name: 'Fred', color: 'Orange'}, - {name: 'George', color: 'Blue'}, - {name: 'Jen', color: 'Red'}, - ]; - matchSorter(objList, 'g', {keys: ['name', 'color']}); - // [{name: 'George', color: 'Blue'}, {name: 'Janice', color: 'Green'}, {name: 'Fred', color: 'Orange'}] + const objList = [ + { name: 'Janice', color: 'Green' }, + { name: 'Fred', color: 'Orange' }, + { name: 'George', color: 'Blue' }, + { name: 'Jen', color: 'Red' } + ]; + matchSorter(objList, 'g', { keys: ['name', 'color'] }); + // [{name: 'George', color: 'Blue'}, {name: 'Janice', color: 'Green'}, {name: 'Fred', color: 'Orange'}] - matchSorter(objList, 're', {keys: ['color', 'name']}); - // [{name: 'Jen', color: 'Red'}, {name: 'Janice', color: 'Green'}, {name: 'Fred', color: 'Orange'}, {name: 'George', color: 'Blue'}] + matchSorter(objList, 're', { keys: ['color', 'name'] }); + // [{name: 'Jen', color: 'Red'}, {name: 'Janice', color: 'Green'}, {name: 'Fred', color: 'Orange'}, {name: 'George', color: 'Blue'}] } // ### Array of values { - const iceCreamYum = [ - {favoriteIceCream: ['mint', 'chocolate']}, - {favoriteIceCream: ['candy cane', 'brownie']}, - {favoriteIceCream: ['birthday cake', 'rocky road', 'strawberry']}, - ]; - matchSorter(iceCreamYum, 'cc', {keys: ['favoriteIceCream']}); - // [{favoriteIceCream: ['candy cane', 'brownie']}, {favoriteIceCream: ['mint', 'chocolate']}] + const iceCreamYum = [ + { favoriteIceCream: ['mint', 'chocolate'] }, + { favoriteIceCream: ['candy cane', 'brownie'] }, + { favoriteIceCream: ['birthday cake', 'rocky road', 'strawberry'] } + ]; + matchSorter(iceCreamYum, 'cc', { keys: ['favoriteIceCream'] }); + // [{favoriteIceCream: ['candy cane', 'brownie']}, {favoriteIceCream: ['mint', 'chocolate']}] } // ### Nested Keys { - const nestedObjList = [ - {name: {first: 'Janice'}}, - {name: {first: 'Fred'}}, - {name: {first: 'George'}}, - {name: {first: 'Jen'}}, - ]; - matchSorter(nestedObjList, 'j', {keys: ['name.first']}); - // [{name: {first: 'Janice'}}, {name: {first: 'Jen'}}] + const nestedObjList = [ + { name: { first: 'Janice' } }, + { name: { first: 'Fred' } }, + { name: { first: 'George' } }, + { name: { first: 'Jen' } } + ]; + matchSorter(nestedObjList, 'j', { keys: ['name.first'] }); + // [{name: {first: 'Janice'}}, {name: {first: 'Jen'}}] } { - const nestedObjList = [ - {name: [{first: 'Janice'}]}, - {name: [{first: 'Fred'}]}, - {name: [{first: 'George'}]}, - {name: [{first: 'Jen'}]}, - ]; - matchSorter(nestedObjList, 'j', {keys: ['name.0.first']}); - // [{name: {first: 'Janice'}}, {name: {first: 'Jen'}}] - // matchSorter(nestedObjList, 'j', {keys: ['name[0].first']}) does not work + const nestedObjList = [ + { name: [{ first: 'Janice' }] }, + { name: [{ first: 'Fred' }] }, + { name: [{ first: 'George' }] }, + { name: [{ first: 'Jen' }] } + ]; + matchSorter(nestedObjList, 'j', { keys: ['name.0.first'] }); + // [{name: {first: 'Janice'}}, {name: {first: 'Jen'}}] + // matchSorter(nestedObjList, 'j', {keys: ['name[0].first']}) does not work } // ### Property Callbacks { - const list = [{name: 'Janice'}, {name: 'Fred'}, {name: 'George'}, {name: 'Jen'}]; - matchSorter(list, 'j', {keys: [item => item.name]}); - // [{name: 'Janice'}, {name: 'Jen'}] + const list = [ + { name: 'Janice' }, + { name: 'Fred' }, + { name: 'George' }, + { name: 'Jen' } + ]; + matchSorter(list, 'j', { keys: [item => item.name] }); + // [{name: 'Janice'}, {name: 'Jen'}] } // ### Min and Max Ranking { - const tea = [ - {tea: 'Earl Grey', alias: 'A'}, - {tea: 'Assam', alias: 'B'}, - {tea: 'Black', alias: 'C'}, - ]; - matchSorter(tea, 'A', { - keys: ['tea', {maxRanking: matchSorter.rankings.STARTS_WITH, key: 'alias'}], - }); - // without maxRanking, Earl Grey would come first because the alias "A" would be CASE_SENSITIVE_EQUAL - // `tea` key comes before `alias` key, so Assam comes first even though both match as STARTS_WITH - // [{tea: 'Assam', alias: 'B'}, {tea: 'Earl Grey', alias: 'A'},{tea: 'Black', alias: 'C'}] + const tea = [ + { tea: 'Earl Grey', alias: 'A' }, + { tea: 'Assam', alias: 'B' }, + { tea: 'Black', alias: 'C' } + ]; + matchSorter(tea, 'A', { + keys: [ + 'tea', + { maxRanking: matchSorter.rankings.STARTS_WITH, key: 'alias' } + ] + }); + // without maxRanking, Earl Grey would come first because the alias "A" would be CASE_SENSITIVE_EQUAL + // `tea` key comes before `alias` key, so Assam comes first even though both match as STARTS_WITH + // [{tea: 'Assam', alias: 'B'}, {tea: 'Earl Grey', alias: 'A'},{tea: 'Black', alias: 'C'}] } { - const tea = [ - {tea: 'Milk', alias: 'moo'}, - {tea: 'Oolong', alias: 'B'}, - {tea: 'Green', alias: 'C'}, - ]; - matchSorter(tea, 'oo', { - keys: ['tea', {minRanking: matchSorter.rankings.EQUAL, key: 'alias'}], - }); - // minRanking bumps Milk up to EQUAL from CONTAINS (alias) - // Oolong matches as STARTS_WITH - // Green is missing due to no match - // [{tea: 'Milk', alias: 'moo'}, {tea: 'Oolong', alias: 'B'}] + const tea = [ + { tea: 'Milk', alias: 'moo' }, + { tea: 'Oolong', alias: 'B' }, + { tea: 'Green', alias: 'C' } + ]; + matchSorter(tea, 'oo', { + keys: ['tea', { minRanking: matchSorter.rankings.EQUAL, key: 'alias' }] + }); + // minRanking bumps Milk up to EQUAL from CONTAINS (alias) + // Oolong matches as STARTS_WITH + // Green is missing due to no match + // [{tea: 'Milk', alias: 'moo'}, {tea: 'Oolong', alias: 'B'}] +} + +// # key: methods +{ + const tea = [ + { tea: 'Milk', alias: 'moo' }, + { tea: 'Oolong', alias: 'B' }, + { tea: 'Green', alias: 'C' } + ]; + matchSorter(tea, 'oo', { + keys: [ + item => item.tea, + { minRanking: matchSorter.rankings.EQUAL, key: item => item.alias } + ] + }); + // minRanking bumps Milk up to EQUAL from CONTAINS (alias) + // Oolong matches as STARTS_WITH + // Green is missing due to no match + // [{tea: 'Milk', alias: 'moo'}, {tea: 'Oolong', alias: 'B'}] } // ## threshold: number { - const fruit = ['orange', 'apple', 'grape', 'banana']; - matchSorter(fruit, 'ap', {threshold: matchSorter.rankings.NO_MATCH}); - // ['apple', 'grape', 'orange', 'banana'] (returns all items, just sorted by best match) + const fruit = ['orange', 'apple', 'grape', 'banana']; + matchSorter(fruit, 'ap', { threshold: matchSorter.rankings.NO_MATCH }); + // ['apple', 'grape', 'orange', 'banana'] (returns all items, just sorted by best match) - const things = ['google', 'airbnb', 'apple', 'apply', 'app']; - matchSorter(things, 'app', {threshold: matchSorter.rankings.EQUAL}); - // ['app'] (only items that are equal) + const things = ['google', 'airbnb', 'apple', 'apply', 'app']; + matchSorter(things, 'app', { threshold: matchSorter.rankings.EQUAL }); + // ['app'] (only items that are equal) - const otherThings = ['fiji apple', 'google', 'app', 'crabapple', 'apple', 'apply']; - matchSorter(otherThings, 'app', {threshold: matchSorter.rankings.WORD_STARTS_WITH}); - // ['app', 'apple', 'apply', 'fiji apple'] (everything that matches with "word starts with" or better) + const otherThings = [ + 'fiji apple', + 'google', + 'app', + 'crabapple', + 'apple', + 'apply' + ]; + matchSorter(otherThings, 'app', { + threshold: matchSorter.rankings.WORD_STARTS_WITH + }); + // ['app', 'apple', 'apply', 'fiji apple'] (everything that matches with "word starts with" or better) } // ## keepDiacritics: boolean { - const thingsWithDiacritics = [ - 'jalapeño', - 'à la carte', - 'café', - 'papier-mâché', - 'à la mode', - ]; - matchSorter(thingsWithDiacritics, 'aa'); - // ['jalapeño', 'à la carte', 'à la mode', 'papier-mâché'] + const thingsWithDiacritics = [ + 'jalapeño', + 'à la carte', + 'café', + 'papier-mâché', + 'à la mode' + ]; + matchSorter(thingsWithDiacritics, 'aa'); + // ['jalapeño', 'à la carte', 'à la mode', 'papier-mâché'] - matchSorter(thingsWithDiacritics, 'aa', {keepDiacritics: true}); - // ['jalapeño', 'à la carte'] + matchSorter(thingsWithDiacritics, 'aa', { keepDiacritics: true }); + // ['jalapeño', 'à la carte'] - matchSorter(thingsWithDiacritics, 'à', {keepDiacritics: true}); - // ['à la carte', 'à la mode'] + matchSorter(thingsWithDiacritics, 'à', { keepDiacritics: true }); + // ['à la carte', 'à la mode'] } From fc55fdb2067908c54ee18c3bac900201fe7f86a1 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Thu, 10 Jan 2019 21:01:12 +0100 Subject: [PATCH 269/646] [is-online] Add types --- types/is-online/index.d.ts | 34 ++++++++++++++++++++++++++++++ types/is-online/is-online-tests.ts | 6 ++++++ types/is-online/tsconfig.json | 23 ++++++++++++++++++++ types/is-online/tslint.json | 1 + 4 files changed, 64 insertions(+) create mode 100644 types/is-online/index.d.ts create mode 100644 types/is-online/is-online-tests.ts create mode 100644 types/is-online/tsconfig.json create mode 100644 types/is-online/tslint.json diff --git a/types/is-online/index.d.ts b/types/is-online/index.d.ts new file mode 100644 index 0000000000..04fa123c44 --- /dev/null +++ b/types/is-online/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for is-online 8.0 +// Project: https://github.com/sindresorhus/is-online#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isOnline; + +/** + * Check if the internet connection is up. + * + * The following checks are run in parallel: + * - Retrieve [icanhazip.com](https://github.com/major/icanhaz) via HTTPS + * - Query `myip.opendns.com` on OpenDNS (Node.js only) + * - Retrieve Apple's Captive Portal test page (Node.js only) + * + * When the first check succeeds, the returned Promise is resolved to `true`. + */ +declare function isOnline(options?: isOnline.Options): Promise; + +declare namespace isOnline { + interface Options { + /** + * Milliseconds to wait for a server to respond. + * @default 5000 + */ + timeout?: number; + /** + * Internet Protocol version to use. This is an advanced option that is usually not necessary to be set, + * but it can prove useful to specifically assert IPv6 connectivity. + * @default 'v4' + */ + version?: 'v4' | 'v6'; + } +} diff --git a/types/is-online/is-online-tests.ts b/types/is-online/is-online-tests.ts new file mode 100644 index 0000000000..74dbda5efa --- /dev/null +++ b/types/is-online/is-online-tests.ts @@ -0,0 +1,6 @@ +import isOnline = require('is-online'); + +isOnline(); // $ExpectType Promise +isOnline({ timeout: 10 }); // $ExpectType Promise +isOnline({ version: 'v4' }); // $ExpectType Promise +isOnline({ version: 'v6' }); // $ExpectType Promise diff --git a/types/is-online/tsconfig.json b/types/is-online/tsconfig.json new file mode 100644 index 0000000000..7009c26024 --- /dev/null +++ b/types/is-online/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", + "is-online-tests.ts" + ] +} diff --git a/types/is-online/tslint.json b/types/is-online/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-online/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 41b13522b9c14183f8b9090302e6adf38dbf3577 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Thu, 10 Jan 2019 21:14:52 +0100 Subject: [PATCH 270/646] [is-reachable] Add types --- types/is-reachable/index.d.ts | 39 ++++++++++++++++++++++++ types/is-reachable/is-reachable-tests.ts | 4 +++ types/is-reachable/tsconfig.json | 23 ++++++++++++++ types/is-reachable/tslint.json | 1 + 4 files changed, 67 insertions(+) create mode 100644 types/is-reachable/index.d.ts create mode 100644 types/is-reachable/is-reachable-tests.ts create mode 100644 types/is-reachable/tsconfig.json create mode 100644 types/is-reachable/tslint.json diff --git a/types/is-reachable/index.d.ts b/types/is-reachable/index.d.ts new file mode 100644 index 0000000000..6e2ea2d62f --- /dev/null +++ b/types/is-reachable/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for is-reachable 3.0 +// Project: https://github.com/sindresorhus/is-reachable#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isReachable; + +/** + * Check if servers are reachable. + * + * The Node.js version will do a TCP handshake with the target's port. It attempts to detect cases where a router + * redirects the request to itself. + * + * The browser version is limited by the fact that browsers cannot connect to arbitrary ports. It only supports + * HTTP and HTTPS and the check relies on the `/favicon.ico` path being present. + * + * @param targets One or more targets to check. Can either be a full [URL](https://nodejs.org/api/url.html) + * like `https://hostname`, `hostname:port` or just `hostname`. When the protocol is missing from a target + * `http` is assumed. + * + * [Well-known protocols](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml) + * are supported (e.g. `ftp://`, `mysql://`, `redis://` and more). + * + * @returns A `Promise` for a `boolean` which is `true` if any of the `targets` are reachable. + */ +declare function isReachable( + targets: string | string[], + options?: isReachable.Options +): Promise; + +declare namespace isReachable { + interface Options { + /** + * Timeout in milliseconds after which a request is considered failed. + * @default 5000 + */ + timeout?: number; + } +} diff --git a/types/is-reachable/is-reachable-tests.ts b/types/is-reachable/is-reachable-tests.ts new file mode 100644 index 0000000000..d497d004f2 --- /dev/null +++ b/types/is-reachable/is-reachable-tests.ts @@ -0,0 +1,4 @@ +import isReachable = require('is-reachable'); + +isReachable('sindresorhus.com'); // $ExpectType Promise +isReachable('google.com:80', { timeout: 10 }); // $ExpectType Promise diff --git a/types/is-reachable/tsconfig.json b/types/is-reachable/tsconfig.json new file mode 100644 index 0000000000..c30236ebd5 --- /dev/null +++ b/types/is-reachable/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", + "is-reachable-tests.ts" + ] +} diff --git a/types/is-reachable/tslint.json b/types/is-reachable/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-reachable/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3fb2a3bbcfc79a9d19c400d09937b5d1727a1842 Mon Sep 17 00:00:00 2001 From: Mohamed Shaaban Date: Thu, 10 Jan 2019 14:59:29 +0100 Subject: [PATCH 271/646] Fix signature of redux-form `blur` and `change` actions --- types/redux-form/index.d.ts | 1 + types/redux-form/lib/actions.d.ts | 4 ++-- types/redux-form/v6/index.d.ts | 6 +++++- types/redux-form/v6/lib/actions.d.ts | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 5851728369..6915032138 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -11,6 +11,7 @@ // Tim de Koning // Maddi Joyce // Kamil Wojcik +// Mohamed Shaaban // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 import { diff --git a/types/redux-form/lib/actions.d.ts b/types/redux-form/lib/actions.d.ts index dbe75106e4..955d3d3f5e 100644 --- a/types/redux-form/lib/actions.d.ts +++ b/types/redux-form/lib/actions.d.ts @@ -18,8 +18,8 @@ export declare function arraySplice(form: string, field: string, index: number, export declare function arraySwap(form: string, field: string, indexA: number, indexB: number): FormAction; export declare function arrayUnshift(form: string, field: string, value: any): FormAction; export declare function autofill(form: string, field: string, value: any): FormAction; -export declare function blur(form: string, field: string, value: any): FormAction; -export declare function change(form: string, field: string, value: any): FormAction; +export declare function blur(form: string, field: string, value: any, touch?: boolean): FormAction; +export declare function change(form: string, field: string, value: any, touch?: boolean, persistentSubmitErrors?: boolean): FormAction; export declare function destroy(...form: string[]): FormAction; export declare function focus(form: string, field: string): FormAction; diff --git a/types/redux-form/v6/index.d.ts b/types/redux-form/v6/index.d.ts index 5127457884..63921312b8 100644 --- a/types/redux-form/v6/index.d.ts +++ b/types/redux-form/v6/index.d.ts @@ -1,6 +1,10 @@ // Type definitions for redux-form 6.6 // Project: https://github.com/erikras/redux-form -// Definitions by: Carson Full , Daniel Lytkin , Karol Janyst , Luka Zakrajsek +// Definitions by: Carson Full +// Daniel Lytkin +// Karol Janyst +// Luka Zakrajsek +// Mohamed Shaaban // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 diff --git a/types/redux-form/v6/lib/actions.d.ts b/types/redux-form/v6/lib/actions.d.ts index 7e7ea5762a..2c43296ef5 100644 --- a/types/redux-form/v6/lib/actions.d.ts +++ b/types/redux-form/v6/lib/actions.d.ts @@ -66,12 +66,12 @@ export function autofill(form: string, field: string, value: any): FormAction; /** * Saves the value to the field */ -export function blur(form: string, field: string, value: any): FormAction; +export function blur(form: string, field: string, value: any, touch?: boolean): FormAction; /** * Saves the value to the field */ -export function change(form: string, field: string, value: any): FormAction; +export function change(form: string, field: string, value: any, touch?: boolean, persistentSubmitErrors?: boolean): FormAction; /** * Destroys the form, removing all it's state From 041ce08d6b1d766783a6edb2ef78ba326af3543c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gaul?= Date: Thu, 10 Jan 2019 21:22:47 +0100 Subject: [PATCH 272/646] fix(mongodb): make $where condition optional --- types/mongodb/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 15e21d2b43..a3725382e4 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1022,7 +1022,7 @@ export type Condition = { $caseSensitive?: boolean; $diacraticSensitive?: boolean; }; - $where: Object; + $where?: Object; $geoIntersects?: Object; $geoWithin?: Object; $near?: Object; From 8480879762c7e78a2e4a193cdc69921f0e17b9f5 Mon Sep 17 00:00:00 2001 From: Marc Knaup Date: Thu, 10 Jan 2019 21:34:13 +0100 Subject: [PATCH 273/646] Updated types of facebook-js-sdk to version 3.2 & works around bogus documentation --- types/facebook-js-sdk/facebook-js-sdk-tests.ts | 8 ++++++++ types/facebook-js-sdk/index.d.ts | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/types/facebook-js-sdk/facebook-js-sdk-tests.ts b/types/facebook-js-sdk/facebook-js-sdk-tests.ts index 46b9f331f5..db8b13686e 100644 --- a/types/facebook-js-sdk/facebook-js-sdk-tests.ts +++ b/types/facebook-js-sdk/facebook-js-sdk-tests.ts @@ -22,6 +22,14 @@ FB.getLoginStatus(function(response: fb.StatusResponse) { const authResponse: fb.AuthResponse = FB.getAuthResponse(); console.log(authResponse.accessToken); +FB.login(); + +FB.login(function(response: fb.StatusResponse) { + console.log(response); + console.log(response.status); + console.log(response.authResponse.accessToken); +}); + FB.login(function(response: fb.StatusResponse) { console.log(response); console.log(response.status); diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index 86ca521c88..c4f3b78c31 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for the Facebook Javascript SDK 3.1 +// Type definitions for the Facebook Javascript SDK 3.2 // Project: https://developers.facebook.com/docs/javascript // Definitions by: Amrit Kahlon // Mahmoud Zohdi @@ -50,7 +50,7 @@ declare namespace facebook { * @param callback function to handle the response. * @param options optional ILoginOption to add params such as scope. */ - login(callback: (response: StatusResponse) => void, options: LoginOptions): void; + login(callback: (response: StatusResponse) => void, options?: LoginOptions): void; /** * Use this function to log the user in @@ -61,12 +61,12 @@ declare namespace facebook { * * @param options optional ILoginOption to add params such as scope. */ - login(options: LoginOptions): void; + login(options?: LoginOptions): void; /** * The method FB.logout() logs the user out of your site and, in some cases, Facebook. * - * @param callback function to handle the response + * @param callback optional function to handle the response */ logout(callback?: (response: StatusResponse) => void): void; From f7b54b3fa9be492f91c4cdec25668874b245d3fc Mon Sep 17 00:00:00 2001 From: Drew Powers Date: Thu, 10 Jan 2019 13:42:32 -0700 Subject: [PATCH 274/646] Make variant optional for from_base64 / to_base64 The library will safely fall back to `URLSAFE_NO_PADDING` if not specified. --- types/libsodium-wrappers/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/libsodium-wrappers/index.d.ts b/types/libsodium-wrappers/index.d.ts index 864aa2369f..38705b6702 100644 --- a/types/libsodium-wrappers/index.d.ts +++ b/types/libsodium-wrappers/index.d.ts @@ -1031,7 +1031,7 @@ export function crypto_stream_keygen(outputFormat?: Uint8ArrayOutputFormat | nul export function crypto_stream_keygen(outputFormat?: StringOutputFormat | null): string; -export function from_base64(input: string, variant: base64_variants): Uint8Array; +export function from_base64(input: string, variant?: base64_variants): Uint8Array; export function from_hex(input: string): Uint8Array; @@ -1077,7 +1077,7 @@ export function sodium_version_string(): string; export function symbols(): string[]; -export function to_base64(input: string | Uint8Array, variant: base64_variants): string; +export function to_base64(input: string | Uint8Array, variant?: base64_variants): string; export function to_hex(input: string | Uint8Array): string; From 8bd80cab811bd85fb28f548149942c654cda34c7 Mon Sep 17 00:00:00 2001 From: Alex Petty Date: Thu, 10 Jan 2019 14:44:56 -0600 Subject: [PATCH 275/646] Correct cluster options type to match what's actually happening within ioredis. Non-Numbers can be returned to end the retry loop --- types/ioredis/index.d.ts | 3 ++- types/ioredis/ioredis-tests.ts | 9 +++++++++ types/ioredis/v3/index.d.ts | 3 ++- types/ioredis/v3/ioredis-tests.ts | 9 +++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index acd380e7db..7794f9a5f1 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -10,6 +10,7 @@ // Dmitry Motovilov // Oleg Repin // Ting-Wai To +// Alex Petty // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -972,7 +973,7 @@ declare namespace IORedis { } interface ClusterOptions { - clusterRetryStrategy?(times: number): number; + clusterRetryStrategy?(times: number): number | null; enableOfflineQueue?: boolean; enableReadyCheck?: boolean; scaleReads?: string; diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index df8e37aca8..e2700ebcfb 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -192,3 +192,12 @@ redis.xread('STREAMS', 'streamName', '0-0'); redis.xreadgroup('GROUP', 'groupName', 'consumerName', 'STREAMS', 'streamName', '>'); redis.xrevrange('streamName', '+', '-', 'COUNT', 1); redis.xtrim('streamName', 'MAXLEN', '~', 1000); + +// ClusterRetryStrategy can return non-numbers to stop retrying +new Redis.Cluster([], { + clusterRetryStrategy: () => null +}); + +new Redis.Cluster([], { + clusterRetryStrategy: () => 1 +}); diff --git a/types/ioredis/v3/index.d.ts b/types/ioredis/v3/index.d.ts index ee2777c92c..03667cd071 100644 --- a/types/ioredis/v3/index.d.ts +++ b/types/ioredis/v3/index.d.ts @@ -7,6 +7,7 @@ // Shahar Mor // Whemoon Jang // Francis Gulotta +// Alex Petty // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -894,7 +895,7 @@ declare namespace IORedis { } interface ClusterOptions { - clusterRetryStrategy?(times: number): number; + clusterRetryStrategy?(times: number): number | null; enableOfflineQueue?: boolean; enableReadyCheck?: boolean; scaleReads?: string; diff --git a/types/ioredis/v3/ioredis-tests.ts b/types/ioredis/v3/ioredis-tests.ts index b77192e3b8..ec5bb8a8ce 100644 --- a/types/ioredis/v3/ioredis-tests.ts +++ b/types/ioredis/v3/ioredis-tests.ts @@ -153,3 +153,12 @@ new Redis.Cluster([{ host: 'localhost', port: 6379 }]); + +// ClusterRetryStrategy can return non-numbers to stop retrying +new Redis.Cluster([], { + clusterRetryStrategy: () => null +}); + +new Redis.Cluster([], { + clusterRetryStrategy: () => 1 +}); From f39fd15de185b5d1c9cb2d3cd1faaed235c9f7df Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Thu, 10 Jan 2019 22:17:54 +0100 Subject: [PATCH 276/646] Add types for jsonabc --- types/jsonabc/index.d.ts | 20 ++++++++++++++++++++ types/jsonabc/jsonabc-tests.ts | 9 +++++++++ types/jsonabc/tsconfig.json | 23 +++++++++++++++++++++++ types/jsonabc/tslint.json | 1 + 4 files changed, 53 insertions(+) create mode 100644 types/jsonabc/index.d.ts create mode 100644 types/jsonabc/jsonabc-tests.ts create mode 100644 types/jsonabc/tsconfig.json create mode 100644 types/jsonabc/tslint.json diff --git a/types/jsonabc/index.d.ts b/types/jsonabc/index.d.ts new file mode 100644 index 0000000000..41a785d015 --- /dev/null +++ b/types/jsonabc/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for jsonabc 2.3 +// Project: http://novicelab.org/jsonabc +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * Sort the JSON (clean, parse, sort, stringify). + * @param noArray Sort or don't sort arrays + */ +export function sort(inputStr: string, noArray?: boolean): string; + +/** + * Sort the JSON (clean, parse, sort, stringify). + * @param noArray Sort or don't sort arrays + */ +export function sortObj(input: object, noArray?: boolean): object; + +/** Remove trailing commas */ +export function cleanJSON(input: string): string; diff --git a/types/jsonabc/jsonabc-tests.ts b/types/jsonabc/jsonabc-tests.ts new file mode 100644 index 0000000000..8d51d94bac --- /dev/null +++ b/types/jsonabc/jsonabc-tests.ts @@ -0,0 +1,9 @@ +import * as myJsonAbc from 'jsonabc'; + +myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }); +myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }, false); + +myJsonAbc.sort('{ c: 0, b: 1, a: 0 }'); +myJsonAbc.sort('{ c: 0, b: 1, a: 0 }', true); + +myJsonAbc.cleanJSON('{ c: 0, b: 1, a: 0 }'); diff --git a/types/jsonabc/tsconfig.json b/types/jsonabc/tsconfig.json new file mode 100644 index 0000000000..072c667a18 --- /dev/null +++ b/types/jsonabc/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsonabc-tests.ts" + ] +} diff --git a/types/jsonabc/tslint.json b/types/jsonabc/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonabc/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6f34bce22f2222a2d83a23e3cb33e26a40fd5a0d Mon Sep 17 00:00:00 2001 From: Jonathan Viney Date: Fri, 11 Jan 2019 11:32:34 +1300 Subject: [PATCH 277/646] fix video.js: add nativeControlsForTouch to player options --- types/video.js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/video.js/index.d.ts b/types/video.js/index.d.ts index 09f9b28d0d..62bbf83362 100644 --- a/types/video.js/index.d.ts +++ b/types/video.js/index.d.ts @@ -4613,6 +4613,7 @@ declare namespace videojs { languages?: { [code: string]: LanguageTranslations }; loop?: boolean; muted?: boolean; + nativeControlsForTouch?: boolean; notSupportedMessage?: string; playbackRates?: number[]; plugins?: any; From 0b03528b263ed24f398d4c7f9c3743fa7b398d96 Mon Sep 17 00:00:00 2001 From: Ifiok Jr Date: Wed, 12 Dec 2018 17:37:59 +0000 Subject: [PATCH 278/646] add types for mangopay2-nodejs-sdk --- types/mangopay2-nodejs-sdk/index.d.ts | 4383 +++++++++++++++++ .../mangopay2-nodejs-sdk-tests.ts | 721 +++ types/mangopay2-nodejs-sdk/tsconfig.json | 20 + types/mangopay2-nodejs-sdk/tslint.json | 10 + types/mangopay2-nodejs-sdk/types.d.ts | 565 +++ 5 files changed, 5699 insertions(+) create mode 100644 types/mangopay2-nodejs-sdk/index.d.ts create mode 100644 types/mangopay2-nodejs-sdk/mangopay2-nodejs-sdk-tests.ts create mode 100644 types/mangopay2-nodejs-sdk/tsconfig.json create mode 100644 types/mangopay2-nodejs-sdk/tslint.json create mode 100644 types/mangopay2-nodejs-sdk/types.d.ts diff --git a/types/mangopay2-nodejs-sdk/index.d.ts b/types/mangopay2-nodejs-sdk/index.d.ts new file mode 100644 index 0000000000..e0c5d5c0e2 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/index.d.ts @@ -0,0 +1,4383 @@ +// Type definitions for mangopay2-nodejs-sdk 1.9 +// Project: https://github.com/MangoPay/mangopay2-nodejs-sdk +// Definitions by: Ifiok Jr. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +import { + ApiMethod, + CountryISO, + CurrencyISO, + MakeKeysRequired, + Omit, + OmitType, + PickPartialRequired, + ValueOf, + PickPartial, + DeepPartial +} from "./types"; + +export = MangoPay; + +declare class MangoPay { + constructor(config: MangoPay.Config); + config: MangoPay.Config; + requestOptions: MangoPay.RequestOptions; + Users: MangoPay.Users; + BankAccounts: MangoPay.BankAccounts; + BankingAliases: MangoPay.BankingAliases; + DisputeDocuments: MangoPay.DisputeDocuments; + Wallets: MangoPay.Wallets; + KycDocuments: MangoPay.KycDocuments; + UboDeclarations: MangoPay.UboDeclarations; + Cards: MangoPay.Cards; + CardRegistrations: MangoPay.CardRegistrations; + CardPreAuthorizations: MangoPay.CardPreAuthorizations; + PayIns: MangoPay.PayIns; + Transfers: MangoPay.Transfers; + PayOuts: MangoPay.PayOuts; + Refunds: MangoPay.Refunds; + Clients: MangoPay.Clients; + Disputes: MangoPay.Disputes; + Repudiations: MangoPay.Repudiations; + Events: MangoPay.Events; + Responses: MangoPay.Responses; + Mandates: MangoPay.Mandates; + Hooks: MangoPay.Hooks; + Reports: MangoPay.Reports; + + models: typeof MangoPay.models; + + Log(...args: any[]): void; + authorize(callback: (data: MangoPay.AuthorizationData) => void): void; + authorize(): Promise; + buildRequestData(entity: any): any; + canReadSubRequestData(entity: any, propertyName: any): boolean; + isExpired(): boolean; + method( + method: ApiMethod, + callback: (...args: any[]) => void, + options: MangoPay.RequestOptions + ): any; +} + +declare namespace MangoPay { + interface AuthorizationData { + access_token: string; + token_type: string; + expires_in: number; + } + + interface Headers { + "Content-Type": string; + "User-Agent": string; + "Idempotency-Key": string; + Authorization: string; + [header: string]: string | undefined; + } + + /** A UTC timestamp in seconds */ + type Timestamp = number; + type ColumnAndDirection = "ASC" | "DESC"; + type AVSResult = + | "NO_CHECK" + | "NO_MATCH" + | "ADDRESS_MATCH_ONLY" + | "POSTAL_CODE_MATCH_ONLY" + | "FULL_MATCH"; + type SecureMode = "DEFAULT" | "FORCE"; + type PreAuthorizationExecutionType = "DIRECT"; + type PaymentStatus = "WAITING" | "CANCELED" | "EXPIRED" | "VALIDATED"; + type PreAuthorizationStatus = "CREATED" | "SUCCEEDED" | "FAILED"; + interface BillingData { + Address: models.Address | address.AddressData | string; + } + + interface SecurityInfoData { + AVSResult: AVSResult; + } + + interface MoneyData { + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + + /** + * An amount of money in the smallest sub-division of the currency, e.g. 12.60 EUR would be represented as 1260 whereas 12 JPY would be represented as just 12) + */ + Amount: number; + } + + interface WithResponse { + statusCode: number; + body: T; + headers: Headers; + } + + interface NoArgMethodOverload { + (options: MethodOptionWithResponse): Promise>; + (options?: MethodOptionWithoutResponse): Promise; + ( + callback: (data: WithResponse) => void, + options?: MethodOptionWithResponse + ): void; + (callback: (data: R) => void, options?: MethodOptionWithoutResponse): void; + } + + interface MethodOverload { + (data: T, options: MethodOptionWithResponse): Promise>; + (data: T, options?: MethodOptionWithoutResponse): Promise; + ( + data: T, + callback: (data: WithResponse) => void, + options: MethodOptionWithResponse + ): void; + ( + data: T, + callback: (data: R) => void, + options?: MethodOptionWithoutResponse + ): void; + } + + interface TwoArgsMethodOverload { + (data: T, extra: U, options: MethodOptionWithResponse): Promise< + WithResponse + >; + (data: T, extra: U, options?: MethodOptionWithoutResponse): Promise; + ( + data: T, + extra: U, + callback: (data: WithResponse) => void, + options?: MethodOptionWithResponse + ): void; + ( + data: T, + extra: U, + callback: (data: R) => void, + options?: MethodOptionWithoutResponse + ): void; + } + + interface ThreeArgsMethodOverload { + (data: T, extra: U, lastArg: V, options: MethodOptionWithResponse): Promise< + WithResponse + >; + ( + data: T, + extra: U, + lastArg: V, + options?: MethodOptionWithoutResponse + ): Promise; + ( + data: T, + extra: U, + lastArg: V, + callback: (data: WithResponse) => void, + options?: MethodOptionWithResponse + ): void; + ( + data: T, + extra: U, + lastArg: V, + callback: (data: R) => void, + options?: MethodOptionWithoutResponse + ): void; + } + + interface Config { + /** + * API Client Id + */ + clientId: string; + + /** + * API Client Api Key + */ + clientApiKey: string; + + /** + * API Base URL.The fault base value points to sandbox. + * Production is 'https://api.mangopay.com' + * + * @default "https://api.sandbox.mangopay.com" + */ + baseUrl?: string; + + /** + * Active debugging + * @default false + */ + debugMode?: boolean; + + /** + * Log function to be used for debug + * @default `console.log` + */ + logClass?(...args: any[]): void; + + /** + * Set the connection timeout limit(in milliseconds) + * @default 30000 + */ + connectionTimeout?: number; + + /** + * Set the response timeout limit(in milliseconds) + * @default 80000 + */ + responseTimeout?: number; + + /** + * API Version + * @default 'v2.01' + */ + apiVersion?: string; + + /** + * Set a custom error handler + * @default `console.error` + */ + errorHandler?(options: any, err: any): void; + } + + interface RequestOptions { + requestConfig: { + timeout: number; + }; + responseConfig: { + timeout: number; + }; + + /** + * Path options are replacing the ${placeholders} from apiMethods + */ + path: { + clientId: string; + apiVersion: string; + readonly id: string; + }; + headers: Partial; + } + + type WithToJson = T & { toJSON(): any }; + + // Determines the shape of the response + interface ReadResponseHeaders { + readResponseHeaders: true; + } + + interface PaginationOptions { + /** + * The page number of results you wish to return + * @default 1 + */ + Page?: number; + + /** + * The number of results to return per page: Max 100; + * @default 10 + */ + Per_Page?: number; + } + + interface FilterOptions extends Record { + /** + * The column to sort against and direction - only CreationDate (or Date for the events) is available and ASC or DESC for the direction + */ + Sort?: ColumnAndDirection; + + /** + * To return only resources that have CreationDate BEFORE this date + */ + BeforeDate?: Timestamp; + + /** + * To return only resources that have CreationDate AFTER this date + */ + AfterDate?: Timestamp; + } + + interface MethodOptions extends DeepPartial { + data?: WithToJson | string; + parameters?: FilterOptions & PaginationOptions; + } + + interface MethodOptionWithResponse extends MethodOptions { + readResponseHeaders: true; + } + + interface MethodOptionWithoutResponse extends MethodOptions { + readResponseHeaders?: false; + } + + interface DependsObject { + dependsPropertyName: string; + propertyName: string; + propertyValueMapping: Record; + } + + interface ModelMethods { + initialize(): void; + + /** + * Returns object property value + * @param attribute + */ + getData(attribute: K): T[K]; + + /** + * @param attribute - attribute's value to be set or hash of properties with values + * @param value - value to be set + */ + setData(attribute: K, value: T[K]): this; + setData(attribute: Partial): this; + + getReadOnlyProperties(): Array; + getDependsObjects(): DependsObject[]; + parse(): void; + } + + namespace models { + const PayInExecutionType: IPayInExecutionType; + const PayInPaymentType: IPayInPaymentType; + const MandateStatus: IMandateStatus; + const LegalPersonType: ILegalPersonType; + const PersonType: IPersonType; + const BankAccountType: IBankAccountType; + const DeclaredUboStatus: IDeclaredUboStatus; + const KycDocumentStatus: IKycDocumentStatus; + const KycDocumentType: IKycDocumentType; + const PayOutPaymentType: IPayOutPaymentType; + const PlatformType: IPlatformType; + const UboDeclarationRefusedReasonType: IUboDeclarationRefusedReasonType; + const UboDeclarationStatus: IUboDeclarationStatus; + const UboRefusedReasonType: IUboRefusedReasonType; + const UserNaturalCapacity: IUserNaturalCapacity; + class DeclaredUbo extends Model { + constructor(data: Partial); + } + + class Model implements ModelMethods { + initialize(): void; + getData(attribute: K): T[K]; + setData(attribute: K, value: T[K]): this; + setData(attribute: Partial): this; + setData(attribute: any, value?: any): this; + getReadOnlyProperties(): Array; + getDependsObjects(): DependsObject[]; + parse(): void; + constructor(data: T); + } + + class EntityBase extends Model { + initialize(): void; + + /** + * Returns object property value + */ + getData(attribute: K): T[K]; + + /** + * @param attribute - attribute's value to be set or hash of properties with values + * @param value - value to be set + */ + setData(attribute: K, value: T[K]): this; + setData(attribute: Partial): this; + + getReadOnlyProperties(): Array; + getDependsObjects(): DependsObject[]; + parse(): void; + toJSON(): any; + } + + class Money extends EntityBase { + constructor(data: MoneyData); + } + + class Billing extends EntityBase { + constructor(data: BillingData); + } + + class Address extends EntityBase { + constructor(data: Partial); + } + + interface Address extends address.AddressData {} + + class BankingAlias extends EntityBase { + constructor(data: Partial); + } + + class BankingAliasIBAN extends BankingAlias {} + + interface BankingAlias extends bankingAlias.IBANBankingAliasData {} + + class BankAccount extends EntityBase { + constructor(data: bankAccount.CreationDetails); + } + interface BankAccount extends bankAccount.DataIntersection {} + + class BankAccountDetails { + constructor(data: any); + } + + class BankAccountDetailsCA extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsCA extends bankAccount.CADetails {} + + class BankAccountDetailsOther extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsOther extends bankAccount.OtherDetails {} + + class BankAccountDetailsGB extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsGB extends bankAccount.GBDetails {} + + class BankAccountDetailsIBAN extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsIBAN extends bankAccount.IBANDetails {} + + class BankAccountDetailsUS extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsUS extends bankAccount.USDetails {} + + class Transaction extends EntityBase { + constructor(data: transaction.TransactionData); + } + + interface Transaction extends transaction.TransactionData {} + + class ClientWallet extends EntityBase {} + + class Wallet extends EntityBase { + constructor(data: wallet.CreateWallet | wallet.UpdateWallet); + } + + class DocumentPageConsult extends Model { + constructor(data: Partial); + } + + interface DocumentPageConsult extends disputeDocument.DocumentPageConsult {} + + class Document extends EntityBase { + constructor(data: any); + } + + class DisputeDocument extends Document {} + + interface DisputeDocument extends disputeDocument.DisputeDocumentData {} + + class DisputeDocumentPage extends EntityBase { + constructor(data: disputeDocument.CreateDisputeDocumentPage); + } + + interface DisputeDocumentPage + extends disputeDocument.CreateDisputeDocumentPage {} + + class KycDocument extends EntityBase { + constructor(data: Partial); + } + + interface KycDocument extends kycDocument.KycDocumentData {} + + class KycPage { + constructor(data: kycDocument.CreateKycPage); + } + + interface KycPage extends kycDocument.CreateKycPage {} + + class EMoney { + constructor(data: eMoney.EMoneyData); + } + + interface EMoney extends eMoney.EMoneyData {} + + class UboDeclaration extends EntityBase { + constructor( + data: + | uboDeclaration.CreateUboDeclaration + | uboDeclaration.UpdateUboDeclaration + ); + } + + interface UboDeclaration extends uboDeclaration.UboDeclarationData {} + + class CardRegistration extends EntityBase< + cardRegistration.CardRegistrationData + > { + constructor( + data: + | cardRegistration.CreateCardRegistration + | cardRegistration.UpdateCardRegistration + ); + } + + interface CardRegistration extends cardRegistration.CardRegistrationData {} + + class Card extends EntityBase { + constructor(data: card.CardData); + } + + interface Card extends card.CardData {} + + class CardPreAuthorization { + constructor( + data: + | cardPreAuthorization.CardPreAuthorizationData + | cardPreAuthorization.UpdateCardPreAuthorization + ); + } + + interface CardPreAuthorization + extends cardPreAuthorization.CardPreAuthorizationData {} + + class SecurityInfo extends EntityBase< + SecurityInfo & entityBase.EntityBaseData + > { + constructor(data: SecurityInfo); + } + + class UserLegal extends EntityBase { + PersonType: "LEGAL"; + constructor( + data: MakeKeysRequired< + Partial, + user.RequiredUserLegalData + > + ); + + /** + * Sets the person type for the model + * @param personType + */ + setPersonType(type: user.PersonType): void; + } + + interface UserLegal extends user.UserLegalData {} + + class UserNatural extends EntityBase { + PersonType: "NATURAL"; + constructor( + data: MakeKeysRequired< + Partial, + user.RequiredUserNaturalData + > + ); + + /** + * Sets the person type for the model + * @param personType + */ + setPersonType(type: user.PersonType): void; + } + + interface UserNatural extends user.UserNaturalData {} + + class User extends EntityBase { + constructor(data: user.UserData); + + /** + * Sets the person type for the model + * @param personType + */ + setPersonType(type: user.PersonType): void; + } + + interface User extends user.UserData {} + + class PayIn extends EntityBase { + constructor(data: any); + } + + interface PayIn extends payIn.BasePayInData {} + + class PayInPaymentDetails extends EntityBase { + constructor(data: any); + } + + class PayInExecutionDetails extends EntityBase { + constructor(data: any); + } + + class PayInExecutionDetailsDirect extends PayInExecutionDetails { + constructor(data: any); + } + + class PayInExecutionDetailsWeb extends PayInExecutionDetails { + constructor(data: any); + } + + class PayInPaymentDetailsBankWire extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsBankingAlias extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsCard extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsCardDirect extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsCardWeb extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsDirectDebitDirect extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsDirectDebitWeb extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsPayPal extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsPreAuthorized extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInTemplateURLOptions extends EntityBase { + constructor(data: any); + } + + class Refund extends EntityBase { + constructor(data: refund.CreatePayInRefund | refund.CreateTransferRefund); + } + + class RefundReasonDetails extends EntityBase { + constructor(data: any); + } + + class Repudiation extends EntityBase { + constructor(data: Partial); + } + + interface Repudiation extends repudiation.RepudiationData {} + + class Client extends EntityBase { + constructor(data?: Partial); + } + + interface Client extends client.ClientData {} + + class PlatformCategorization extends EntityBase< + client.PlatformCategorization + > { + constructor(data: client.PlatformCategorization); + } + + class Dispute extends EntityBase { + constructor(data: Partial); + } + + interface Dispute extends dispute.DisputeData {} + + class DisputeReason extends Model { + constructor(data: any); + } + + class SettlementTransfer extends EntityBase< + settlementTransfer.SettlementTransferData + > { + constructor(data: Partial); + } + + interface SettlementTransfer + extends settlementTransfer.SettlementTransferData {} + + class Transfer extends EntityBase { + constructor(data: Partial); + } + + interface Transfer extends transfer.TransferData {} + + class PayOut extends EntityBase { + constructor(data: Partial); + } + // interface PayOut extends PayOut.PayoutData {} + + class PayOutPaymentDetails extends EntityBase { + constructor(data?: any); + } + + class PayOutPaymentDetailsBankWire extends PayOutPaymentDetails { + constructor(data?: any); + } + + class Mandate extends EntityBase { + constructor(data?: Partial); + } + + interface Mandate extends mandate.MandateData {} + + class Hook extends EntityBase { + constructor(data?: Partial); + } + + interface Hook extends hook.HookData {} + + class Report extends EntityBase { + constructor(data?: Partial); + } + + interface Report extends report.ReportData {} + + class ReportFilter extends Model { + constructor(data?: Partial); + } + + interface Report extends report.Filters {} + } + + interface IPayInExecutionType { + Direct: "DIRECT"; + Web: "WEB"; + } + + interface IPayInPaymentType { + BankWire: "BANK_WIRE"; + Card: "CARD"; + DirectDebit: "DIRECT_DEBIT"; + Preauthorized: "PREAUTHORIZED"; + PayPal: "PAYPAL"; + } + + interface IMandateStatus { + Created: "CREATED"; + Submitted: "SUBMITTED"; + Active: "ACTIVE"; + Failed: "FAILED"; + } + + interface ILegalPersonType { + NotSpecified: "NotSpecified"; + Business: "BUSINESS"; + Organization: "ORGANIZATION"; + Soletrader: "SOLETRADER"; + } + + interface IPersonType { + NotSpecified: "NotSpecified"; + Natural: "NATURAL"; + Legal: "LEGAL"; + } + + interface IBankAccountType { + NotSpecified: "NotSpecified"; + IBAN: "IBAN"; + GB: "GB"; + US: "US"; + CA: "CA"; + OTHER: "OTHER"; + } + + interface IDeclaredUboStatus { + Created: "CREATED"; + Validated: "VALIDATED"; + Refused: "REFUSED"; + } + + interface IKycDocumentStatus { + Created: "CREATED"; + ValidationAsked: "VALIDATION_ASKED"; + Validated: "VALIDATED"; + Refused: "REFUSED"; + } + + interface IKycDocumentType { + IdentityProof: "IDENTITY_PROOF"; + RegistrationProof: "REGISTRATION_PROOF"; + ArticlesOfAssociation: "ARTICLES_OF_ASSOCIATION"; + ShareholderDeclaration: "SHAREHOLDER_DECLARATION"; + AddressProof: "ADDRESS_PROOF"; + } + + interface IPayOutPaymentType { + BankWire: "BANK_WIRE"; + } + + interface IPlatformType { + NotSpecified: "NotSpecified"; + MARKETPLACE: "MARKETPLACE"; + P2P_PAYMENT: "P2P_PAYMENT"; + CROWDFUNDING_DONATION: "CROWDFUNDING_DONATION"; + CROWDFUNDING_REWARD: "CROWDFUNDING_REWARD"; + CROWDFUNDING_EQUITY: "CROWDFUNDING_EQUITY"; + CROWDFUNDING_LOAN: "CROWDFUNDING_LOAN"; + OTHER: "OTHER"; + } + + interface IUboDeclarationRefusedReasonType { + /** + * When at least one natural user is missing on the declaration + */ + MissingUbo: "MISSING_UBO"; + + /** + * When at least one natural user should not be declared as UBO + */ + InvalidDeclaredUbo: "INVALID_DECLARED_UBO"; + + /** + * When at least one natural user declared as UBO has been created + * with wrong details (i.e. date of birth, country of residence) + */ + InvalidUboDetails: "INVALID_UBO_DETAILS"; + } + + interface IUboDeclarationStatus { + /** + * When the UBO declaration was created + */ + Created: "CREATED"; + + /** + * When validation has been requested for the UBO declaration + */ + ValidationAsked: "VALIDATION_ASKED"; + + /** + * When the UBO declaration was validated + */ + Validated: "VALIDATED"; + + /** + * When the UBO declaration was refused + */ + Refused: "REFUSED"; + } + + interface IUboRefusedReasonType { + /** + * When user should not be declared as UBO + */ + InvalidDeclaredUbo: "INVALID_DECLARED_UBO"; + + /** + * When user declared as UBO was created with wrong + * details (i.e. date of birth, country of residence) + */ + InvalidUboDetails: "INVALID_UBO_DETAILS"; + } + + interface IUserNaturalCapacity { + /** + * Real customer + */ + Normal: "NORMAL"; + + /** + * User used only for declaration purpose + */ + Declarative: "DECLARATIVE"; + } + + namespace entityBase { + interface EntityBaseData { + Id: string; + Tag: string; + CreationDate: number; + } + } + + namespace address { + interface AddressData { + AddressLine1: string; + AddressLine2: string; + City: string; + Region: string; + PostalCode: string; + Country: string; + } + type AddressType = string | AddressData | models.Address; + } + + namespace bankingAlias { + type BankingAliasType = "IBAN"; + interface BankingAliasData extends entityBase.EntityBaseData { + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The ID of a wallet + */ + WalletId: string; + + /** + * The Country of the Address + */ + Country: CountryISO; + + /** + * The type of banking alias (note that only IBAN is available at present) + */ + Type: BankingAliasType; + + /** + * The owner of the wallet/banking alias + */ + OwnerName: string; + + /** + * Whether the banking alias is active or not + */ + Active: boolean; + } + + interface IBANBankingAliasData extends BankingAliasData { + /** + * The type of banking alias (note that only IBAN is available at present) + */ + Type: "IBAN"; + + /** + * The IBAN of the banking alias + */ + IBAN: string; + + /** + * The BIC of the banking alias + */ + BIC: string; + } + + interface CreateIBANBankingAlias + extends PickPartialRequired< + IBANBankingAliasData, + "Tag" | "CreditedUserId", + "OwnerName" | "Country" + > {} + } + + namespace bankAccount { + type BankAccountType = "IBAN" | "GB" | "US" | "CA" | "OTHER"; + type DepositAccountType = "CHECKING" | "SAVINGS"; + + interface BaseData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The type of bank account + */ + Type: BankAccountType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * @deprecated + */ + Details?: models.BankAccountDetails; + + /** + * Whether the bank account is active or not + */ + Active: boolean; + } + + interface IBANDetails { + Type: "IBAN"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The IBAN of the bank account + */ + IBAN: string; + + /** + * The BIC of the bank account + */ + BIC?: string; + } + + type IBANData = BaseData & IBANDetails; + + interface USDetails { + Type: "US"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The account number of the bank account. US account numbers must be digits only. + */ + AccountNumber: string; + + /** + * The ABA of the bank account. Must be numbers only, and 9 digits long + */ + ABA: string; + + /** + * The type of account + */ + DepositAccountType?: DepositAccountType; + } + + type USData = BaseData & USDetails; + + interface CADetails { + Type: "CA"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The branch code of the bank where the bank account. Must be numbers only, and 5 digits long + */ + BranchCode: string; + + /** + * The institution number of the bank account. Must be numbers only, and 3 or 4 digits long + */ + InstitutionNumber: string; + + /** + * The account number of the bank account. Must be numbers only. Canadian account numbers must be a maximum of 20 digits. + */ + AccountNumber: string; + + /** + * The name of the bank where the account is held. Must be letters or numbers only and maximum 50 characters long. + */ + BankName: string; + } + + type CAData = BaseData & CADetails; + + interface GBDetails { + Type: "GB"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The sort code of the bank account. Must be numbers only, and 6 digits long + */ + SortCode: string; + + /** + * The account number of the bank account. Must be numbers only. GB account numbers must be 8 digits long. + */ + AccountNumber: string; + } + + type GBData = BaseData & GBDetails; + + interface OtherDetails { + Type: "OTHER"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The Country of the Address + */ + Country: string; + + /** + * The BIC of the bank account + */ + BIC: string; + + /** + * The account number of the bank account. Must be numbers only. Canadian account numbers must be a maximum of 20 digits. + */ + AccountNumber: string; + } + + type OtherData = BaseData & OtherDetails; + + type Data = OtherData | CAData | GBData | IBANData | USData; + type DataIntersection = OtherData & CAData & GBData & IBANData & USData; + type CreationDetails = + | OtherDetails + | CADetails + | GBDetails + | IBANDetails + | USDetails; + } + + namespace transaction { + type TransactionNature = + | "REGULAR" + | "REPUDIATION" + | "REFUND" + | "SETTLEMENT"; + type TransactionType = "PAYIN" | "TRANSFER" | "PAYOUT"; + type TransactionStatus = "CREATED" | "SUCCEEDED" | "FAILED"; + + interface TransactionData extends entityBase.EntityBaseData { + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Details about the funds that are being credited (DebitedFunds – Fees = CreditedFunds) + */ + CreditedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The nature of the transaction + */ + Nature: TransactionNature; + + /** + * The status of the transaction + */ + Status: TransactionStatus; + + /** + * When the transaction happened + */ + ExecutionDate: Timestamp; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The type of the transaction + */ + Type: TransactionType; + } + } + + namespace wallet { + type ClientFundsType = "FEES" | "CREDIT"; + type FundsType = "DEFAULT" | ClientFundsType; + + interface WalletData extends entityBase.EntityBaseData { + /** + * An array of userIDs of who own's the wallet. For now, you only can set up a unique owner. + */ + Owners: [string]; + + /** + * The current balance of the wallet + */ + Balance: MoneyData; + + /** + * The type of funds in the wallet + */ + FundsType: FundsType; + + /** + * A desciption of the wallet + */ + Description: string; + + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + } + + interface ClientWalletData + extends Omit { + FundsType: ClientFundsType; + } + + type CreateWallet = UpdateWallet & + Pick; + type UpdateWallet = PickPartial; + } + + namespace disputeDocument { + type DisputeDocumentType = + | "DELIVERY_PROOF" + | "INVOICE" + | "REFUND_PROOF" + | "USER_CORRESPONDANCE" + | "USER_ACCEPTANCE_PROOF" + | "PRODUCT_REPLACEMENT_PROOF" + | "OTHER"; + + type DocumentStatus = + | "CREATED" + | "VALIDATION_ASKED" + | "VALIDATED" + | "REFUSED"; + + type RefusedReasonType = + | "DOCUMENT_UNREADABLE" + | "DOCUMENT_NOT_ACCEPTED" + | "DOCUMENT_HAS_EXPIRED" + | "DOCUMENT_INCOMPLETE" + | "DOCUMENT_MISSING" + | "SPECIFIC_CASE" + | "DOCUMENT_FALSIFIED" + | "OTHER"; + + interface DisputeDocumentData extends entityBase.EntityBaseData { + /** + * Gives the type of the KYC document + */ + Type: DisputeDocumentType; + + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The Id of a Dispute + */ + DisputeId: string; + + /** + * The status of this KYC/Dispute document + */ + Status: DocumentStatus; + + /** + * The message accompanying a refusal + */ + RefusedReasonMessage: string; + + /** + * The type of reason for refusal + */ + RefusedReasonType: RefusedReasonType; + + /** + * The date when the document was processed by MANGOPAY + */ + ProcessedDate: Timestamp; + } + + interface CreateDisputeDocument { + /** + * Gives the type of the KYC document + */ + Type: DisputeDocumentType; + Tag?: string; + } + + interface SubmitDisputeDocument { + /** + * The status of this KYC/Dispute document + */ + Status: "VALIDATION_ASKED"; + Tag?: string; + } + + /** + * - Documents have to be in "CREATED" Status + * - You can create as many pages as needed + * + * Remember to change Status to "VALIDATION_ASKED" to submit KYC documents + * The maximum size per page is about 7Mb (or 10Mb when base64encoded). The following formats are accepted for the documents : .pdf, .jpeg, .jpg, .gif and .png. The minimum size is 1Kb. + */ + interface CreateDisputeDocumentPage { + /** + * The base64 encoded file which needs to be uploaded + * + * You need to fill in only the binary code. Do not send the first part that some converters add into the binary code which is + * `` + * + * e.g. + * ```json + * { + * "File": "/9j/4AAQSkZJRgABAQEBLAEsAAD/.../wgARCAAyADIDAREAAhEBAxEB/8QAGwAAAgMBAQEA" + * } + * ``` + */ + File: string; + } + + interface DocumentPageConsult { + /** + * URL where this document page can be viewed. + */ + Url: string; + + /** + * Time in millis when the page consult will expire. + */ + ExpirationDate: Timestamp; + } + } + + namespace kycDocument { + type KycDocumentType = + | "IDENTITY_PROOF" + | "REGISTRATION_PROOF" + | "ARTICLES_OF_ASSOCIATION" + | "SHAREHOLDER_DECLARATION" + | "ADDRESS_PROOF"; + type DocumentStatus = + | "CREATED" + | "VALIDATION_ASKED" + | "VALIDATED" + | "REFUSED"; + + type KYCDocumentRefusedReasonType = + | "DOCUMENT_UNREADABLE" + | "DOCUMENT_NOT_ACCEPTED" + | "DOCUMENT_HAS_EXPIRED" + | "DOCUMENT_INCOMPLETE" + | "DOCUMENT_MISSING" + | "DOCUMENT_DO_NOT_MATCH_USER_DATA" + | "DOCUMENT_DO_NOT_MATCH_ACCOUNT_DATA" + | "SPECIFIC_CASE" + | "DOCUMENT_FALSIFIED" + | "UNDERAGE_PERSON" + | "SPECIFIC_CASE"; + + interface KycDocumentData extends entityBase.EntityBaseData { + /** + * Gives the type of the KYC document + */ + Type: KycDocumentType; + + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The status of this KYC/Dispute document + */ + Status: DocumentStatus; + + /** + * The message accompanying a refusal + */ + RefusedReasonMessage: string; + + /** + * The type of reason for refusal + */ + RefusedReasonType: KYCDocumentRefusedReasonType; + + /** + * The date when the document was processed by MANGOPAY + */ + ProcessedDate: Timestamp; + } + + interface CreateKycDocument { + /** + * Gives the type of the KYC document + */ + Type: KycDocumentType; + Tag?: string; + } + + interface CreateKycDocument { + /** + * Gives the type of the KYC document + */ + Type: KycDocumentType; + Tag?: string; + } + + interface SubmitKycDocument { + /** + * The status of this KYC/Dispute document + */ + Status: "VALIDATION_ASKED"; + Tag?: string; + } + + /** + * - Documents have to be in "CREATED" Status + * - You can create as many pages as needed + * + * Remember to change Status to "VALIDATION_ASKED" to submit KYC documents + * The maximum size per page is about 7Mb (or 10Mb when base64encoded). The following formats are accepted for the documents : .pdf, .jpeg, .jpg, .gif and .png. The minimum size is 1Kb. + */ + interface CreateKycPage { + /** + * The base64 encoded file which needs to be uploaded + * + * You need to fill in only the binary code. Do not send the first part that some converters add into the binary code which is + * `` + * + * e.g. + * ```json + * { + * "File": "/9j/4AAQSkZJRgABAQEBLAEsAAD/.../wgARCAAyADIDAREAAhEBAxEB/8QAGwAAAgMBAQEA" + * } + * ``` + */ + File: string; + } + } + + namespace eMoney { + interface EMoneyData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The amount of money that has been credited to this user + */ + CreditedEMoney: MoneyData; + + /** + * The amount of money that has been debited from this user + */ + DebitedEMoney: MoneyData; + } + } + + namespace uboDeclaration { + interface UboDeclarationData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + + /** + * Status of a UBO Declaration + */ + Status: kycDocument.DocumentStatus; + + /** + * Reason types for a UBO Declaration + */ + RefusedReasonTypes: string[]; + + /** + * Refused Reason Message for a UBO Declaration + */ + RefusedReasonMessage: string; + + /** + * An array of UserIDs declared as Ultimate Beneficial Owners of a BUSINESS Legal User. + */ + DeclaredUBOs: string[]; + } + + interface CreateUboDeclaration { + DeclaredUBOs?: string[]; + } + + interface UpdateUboDeclaration { + Id: string; + Tag?: string; + Status?: "VALIDATION_ASKED"; + + /** + * An array of UserIDs declared as Ultimate Beneficial Owners of a BUSINESS Legal User. + */ + DeclaredUBOs?: string[]; + } + } + + namespace cardRegistration { + interface CardRegistrationData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + + /** + * A special key to use when registering a card + */ + AccessKey: string; + + /** + * A specific value to pass to the CardRegistrationURL + */ + PreregistrationData: string; + + /** + * The URL to submit the card details form to + */ + CardRegistrationURL: string; + + /** + * Having registered a card, this confirmation hash needs to be updated to the card item + */ + RegistrationData: string; + + /** + * The type of card + */ + CardType: card.CardType; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * Status of the card registration + */ + Status: card.CardStatus; + } + + interface CreateCardRegistration + extends PickPartialRequired< + CardRegistrationData, + "CardType" | "Tag", + "UserId" | "Currency" + > {} + type UpdateCardRegistration = PickPartial< + CardRegistrationData, + "Tag" | "RegistrationData" + >; + } + + namespace card { + type CardType = + | "CB_VISA_MASTERCARD" + | "DINERS" + | "MASTERPASS" + | "MAESTRO" + | "P24" + | "IDEAL" + | "BCMC" + | "PAYLIB"; + type CardStatus = "CREATED" | "VALIDATED" | "ERROR"; + type CardValidity = "UNKNOWN" | "VALID" | "INVALID"; + + interface CardData extends entityBase.EntityBaseData { + /** + * The expiry date of the card - must be in format MMYY + */ + ExpirationDate: string; + + /** + * A partially obfuscated version of the credit card number + */ + Alias: string; + + /** + * The provider of the card + */ + CardProvider: string; + + /** + * The type of card + */ + CardType: CardType; + + /** + * The Country of the Address + */ + Country: string; + + /** + * The card product type - more info + */ + Product: string; + + /** + * The bank code + */ + BankCode: string; + + /** + * Whether the card is active or not + */ + Active: boolean; + + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + + /** + * Whether the card is valid or not. Once they process (or attempt to process) a payment with the card we are able to indicate if it is "valid" or "invalid". + * If they didn’t process a payment yet the "Validity" stay at "unknown". + */ + Validity: CardValidity; + + /** + * A unique representation of a 16-digits card number + */ + Fingerprint: string; + } + + interface UpdateCard { + Id: string; + Active?: false; + } + } + + namespace cardPreAuthorization { + interface CardPreAuthorizationData extends entityBase.EntityBaseData { + /** + * A user's ID + */ + AuthorId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Status of the PreAuthorization + */ + Status: PreAuthorizationStatus; + + /** + * The status of the payment after the PreAuthorization. You can pass the PaymentStatus from "WAITING" to "CANCELED" should you need/want to + */ + PaymentStatus: PaymentStatus; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * How the PreAuthorization has been executed + */ + ExecutionType: PreAuthorizationExecutionType; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. + * The field lets you activate it automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), + * "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode: SecureMode; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The value is 'true' if the SecureMode was used + */ + SecureModeNeeded: boolean; + + /** + * This is the URL where to redirect users to proceed to 3D secure validation + */ + SecureModeRedirectUrl: string; + + /** + * This is the URL where users are automatically redirected after 3D secure validation (if activated) + */ + SecureModeReturnURL: string; + + /** + * The date when the payment is to be processed by + */ + ExpirationDate: Timestamp; + + /** + * The Id of the associated PayIn + */ + PayInId: string; + + /** + * Contains useful information related to the user billing + */ + Billing: BillingData; + + /** + * Contains useful information related to security and fraud + */ + SecurityInfo: SecurityInfoData; + } + + type CreateCardPreAuthorization = PickPartialRequired< + CardPreAuthorizationData, + "Tag" | "Billing" | "SecureMode", + "AuthorId" | "DebitedFunds" | "CardId" | "SecureModeReturnURL" + >; + type UpdateCardPreAuthorization = PickPartialRequired< + CardPreAuthorizationData, + "Tag", + "PaymentStatus" | "Id" + >; + } + + namespace hook { + type HookValidity = "UNKNOWN" | "VALID" | "INVALID"; + type HookStatus = "DISABLED" | "ENABLED"; + + interface HookData extends entityBase.EntityBaseData { + /** + * This is the URL where your receive notification for each EventType + */ + Url: string; + + /** + * Whether the hook is enabled or not + */ + Status: HookStatus; + + /** + * Whether the hook is valid or not + */ + Validity: HookValidity; + + /** + * The event type + */ + EventType: event.EventType; + } + + interface CreateHook + extends PickPartialRequired {} + + interface UpdateHook + extends PickPartialRequired< + HookData, + "EventType" | "Url" | "Tag", + "Id" + > {} + } + + namespace report { + interface Filters { + /** + * To return only resources that have CreationDate BEFORE this date + */ + BeforeDate: Timestamp; + + /** + * To return only resources that have CreationDate AFTER this date + */ + AfterDate: Timestamp; + + /** + * The type of the transaction + */ + Type: transaction.TransactionType[]; + + /** + * The status of the transaction + */ + Status: transaction.TransactionStatus[]; + + /** + * The nature of the transaction + */ + Nature: transaction.TransactionNature[]; + + /** + * The minimum amount of DebitedFunds + */ + MinDebitedFundsAmount: number; + + /** + * The currency for the minimum amount of DebitedFunds + */ + MinDebitedFundsCurrency: CurrencyISO; + + /** + * The maximum amount of DebitedFunds + */ + MaxDebitedFundsAmount: number; + + /** + * The currency for the maximum amount of DebitedFunds + */ + MaxDebitedFundsCurrency: CurrencyISO; + + /** + * The minimum amount of Fees + */ + MinFeesAmount: number; + + /** + * The currency for the minimum amount of Fees + */ + MinFeesCurrency: CurrencyISO; + + /** + * The maximum amount of Fees + */ + MaxFeesAmount: number; + + /** + * The currency for the maximum amount of Fees + */ + MaxFeesCurrency: CurrencyISO; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The ID of a wallet + */ + WalletId: string; + } + + type Column = + | "Alias" + | "AuthorId" + | "BankAccountId" + | "BankWireRef" + | "CardId" + | "CardType" + | "Country" + | "CreationDate" + | "CreditedFundsAmount" + | "CreditedFundsCurrency" + | "CreditedUserId" + | "CreditedWalletId" + | "Culture" + | "DebitedFundsAmount" + | "DebitedFundsCurrency" + | "DebitedWalletId" + | "DeclaredDebitedFundsAmount" + | "DeclaredDebitedFundsCurrency" + | "DeclaredFeesAmount" + | "DeclaredFeesCurrency" + | "ExecutionDate" + | "ExecutionType" + | "ExpirationDate" + | "FeesAmount" + | "FeesCurrency" + | "Id" + | "Nature" + | "PaymentType" + | "PreauthorizationId" + | "ResultCode" + | "ResultMessage" + | "Status" + | "Tag" + | "Type" + | "WireReference"; + + interface ReportData extends entityBase.EntityBaseData { + /** + * The date when the report was executed + */ + ReportDate: Timestamp; + + /** + * The URL to download the report + */ + DownloadURL: string; + + /** + * A URL that we will ping when the report is ready to download(works in a similar way to the hooks) + */ + CallbackURL: string; + + /** + * The format of the report download + */ + DownloadFormat: "CSV"; + + /** + * The type of report + */ + ReportType: "TRANSACTIONS"; + + /** + * The column to sort against and direction seperate by a `:` + */ + Sort: string; + + /** + * Whether the report should be limited to the first 10 lines(and therefore quicker to execute) + */ + Preview: boolean; + + /** + * An object of various filters for the report + */ + Filters: Filters; + + /** + * A list of columns / infos to show in the report + */ + Columns: Column[]; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + } + + interface CreateReport + extends PickPartial< + ReportData, + | "Tag" + | "CallbackURL" + | "DownloadFormat" + | "Sort" + | "Preview" + | "Filters" + | "Columns" + > {} + } + + namespace mandate { + /** + * - "CREATED" - the mandate has been created + * - "SUBMITTED" - the mandate has been submitted to the banks and you can now do payments with this mandate + * - "ACTIVE" - the mandate is active and has been accepted by the banks and/or successfully used in a payment + * - "FAILED" - the mandate has failed for a variety of reasons and is no longer available for payments + */ + type MandateStatus = ValueOf; + type MandateScheme = "SEPA" | "BACS"; + type MandateCultureCode = "EN" | "FR" | "NL" | "DE" | "ES" | "IT" | "PL"; + type MandateExecutionType = "WEB"; + type MandateType = "DIRECT_DEBIT"; + interface MandateData extends entityBase.EntityBaseData { + /** + * An ID of a Bank Account + */ + BankAccountId: string; + + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The URL to redirect to after payment (whether successful or not) + */ + ReturnURL: string; + + /** + * The URL to redirect to user to for them to proceed with the payment + */ + RedirectURL: string; + + /** + * The URL to download the mandate + */ + DocumentURL: string; + + /** + * The language to use for the mandate confirmation page - needs to be the ISO code of the language + */ + Culture: MandateCultureCode; + + /** + * The type of mandate, but will only be completed once the mandate has been submitted + */ + Scheme: MandateScheme; + + /** + * The status of the mandate: + */ + Status: MandateStatus; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The execution type for creating the mandate + */ + ExecutionType: MandateExecutionType; + + /** + * The type of Mandate + */ + MandateType: MandateType; + + /** + * The banking reference for this mandate + */ + BankReference: string; + } + + interface CreateMandate + extends PickPartialRequired< + MandateData, + "Tag", + "BankAccountId" | "Culture" | "ReturnURL" + > {} + } + + namespace user { + /** + * Should be only one of these values: + * 1 - for incomes <18K€), + * 2 - for incomes between 18 and 30K€, + * 3 - for incomes between 30 and 50K€, + * 4 - for incomes between 50 and 80K€, + * 5 - for incomes between 80 and 120K€, + * 6 - for incomes >120K€ + */ + type IncomeRange = 1 | 2 | 3 | 4 | 5 | 6; + type PersonType = "NATURAL" | "LEGAL"; + type KYCLevel = "LIGHT" | "REGULAR"; + type LegalPersonType = "BUSINESS" | "ORGANIZATION" | "SOLETRADER"; + type StaticKeys = + | "KYCLevel" + | "PersonType" + | "Id" + | "CreationDate" + | "ProofOfIdentity" + | "ProofOfAddress" + | "ProofOfRegistration" + | "LegalRepresentativeProofOfIdentity" + | "ShareholderDeclaration" + | "Statute"; + interface UserData extends entityBase.EntityBaseData { + /** + * Type of user + */ + PersonType: PersonType; + + /** + * The person's email address (not more than 12 consecutive numbers) - must be a valid email + */ + Email: string; + + /** + * KYC Level (LIGHT or REGULAR) + */ + KYCLevel: KYCLevel; + } + + interface UserLegalData extends UserData { + PersonType: "LEGAL"; + + /** + * The name of the legal user + */ + Name: string; + + /** + * Type for legal user. + */ + LegalPersonType: LegalPersonType; + + /** + * The address of the company’s headquarters + */ + HeadquartersAddress: address.AddressType; + + /** + * The first name of the company’s Legal representative person + */ + LegalRepresentativeFirstName: string; + + /** + * The last name of the company’s Legal representative person + */ + LegalRepresentativeLastName: string; + + /** + * The address of the company’s Legal representative person + */ + LegalRepresentativeAddress: address.AddressType; + + /** + * The email of the company’s Legal representative person - must be valid + */ + LegalRepresentativeEmail: string; + + /** + * The date of birth of the company’s Legal representative person - be careful to set the right timezone (should be UTC) to avoid 00h becoming 23h (and hence interpreted as the day before) + */ + LegalRepresentativeBirthday: Timestamp; + + /** + * The nationality of the company’s Legal representative person + */ + LegalRepresentativeNationality: CountryISO; + + /** + * The country of residence of the company’s Legal representative person + */ + LegalRepresentativeCountryOfResidence: CountryISO; + ProofOfIdentity: string | null; + + /** + * The business statute of the company + */ + Statute: string | null; + + /** + * A MANGOPAY reference to the validated document of the proof of registration of the company + */ + ProofOfRegistration: string | null; + + /** + * The shareholder declaration of the company + */ + ShareholderDeclaration: string | null; + + /** + * The official registered number of the business + */ + CompanyNumber: string; + } + + interface UserNaturalData extends UserData { + PersonType: "NATURAL"; + + /** + * The name of the user + */ + FirstName: string; + + /** + * The last name of the user + */ + LastName: string; + + /** + * The user address + */ + Address: string | address.AddressData; + + /** + * The date of birth of the user - be careful to set the right timezone (should be UTC) to avoid 00h becoming 23h (and hence interpreted as the day before) + */ + Birthday: Timestamp; + + /** + * The user’s nationality. ISO 3166-1 alpha-2 format is expected + */ + Nationality: CountryISO; + + /** + * The user’s country of residence. ISO 3166-1 alpha-2 format is expected + */ + CountryOfResidence: CountryISO; + + /** + * User’s occupation, ie. Work + */ + Occupation: string; + IncomeRange: IncomeRange; + + /** + * Maximum length is 255 characters + */ + ProofOfIdentity: string | null; + + /** + * Maximum length is 255 characters + */ + ProofOfAddress: string | null; + + /** + * The capacity of this user - for use with UBO declarations + */ + Capacity: "NORMAL" | "DECLARATIVE"; + } + + type RequiredUserLegalData = + | "LegalPersonType" + | "Name" + | "LegalRepresentativeBirthday" + | "LegalRepresentativeCountryOfResidence" + | "LegalRepresentativeNationality" + | "LegalRepresentativeFirstName" + | "LegalRepresentativeLastName" + | "Email"; + + type RequiredUserNaturalData = + | "FirstName" + | "LastName" + | "Birthday" + | "Nationality" + | "CountryOfResidence" + | "Email"; + + interface BaseUserLegalData + extends PickPartial< + UserLegalData, + | RequiredUserLegalData + | "CompanyNumber" + | "LegalRepresentativeEmail" + | "LegalRepresentativeAddress" + | "HeadquartersAddress" + | "Tag" + > { + PersonType: "LEGAL"; + } + + interface UpdateUserLegalData extends BaseUserLegalData { + Id: string; + } + + interface CreateUserLegalData + extends MakeKeysRequired< + BaseUserLegalData, + RequiredUserLegalData | "PersonType" + > {} + + interface BaseUserNaturalData + extends PickPartial< + UserNaturalData, + RequiredUserNaturalData | "Address" | "Occupation" | "IncomeRange" + > { + PersonType: "NATURAL"; + } + + interface UpdateUserNaturalData extends BaseUserNaturalData { + Id: string; + } + + interface CreateUserNaturalData + extends MakeKeysRequired< + BaseUserNaturalData, + RequiredUserNaturalData | "PersonType" + > {} + } + + namespace payIn { + type PayInPaymentType = ValueOf; + type PayInExecutionType = + | ValueOf + | "EXTERNAL_INSTRUCTION"; + + interface TemplateURLOptions { + Payline: string; + } + + interface BasePayInData extends entityBase.EntityBaseData { + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Details about the funds that are being credited (DebitedFunds – Fees = CreditedFunds) + */ + CreditedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The nature of the transaction + */ + Nature: transaction.TransactionNature; + + /** + * The status of the transaction + */ + Status: transaction.TransactionStatus; + + /** + * When the transaction happened + */ + ExecutionDate: Timestamp; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The type of the transaction + */ + Type: transaction.TransactionType; + + /** + * The type of payin + */ + PaymentType: PayInPaymentType; + + /** + * The type of execution for the payin + */ + ExecutionType: PayInExecutionType; + } + + interface CardWebPayInData extends BasePayInData { + ExecutionType: "WEB"; + PaymentType: "CARD"; + + /** + * The URL to redirect to after payment (whether successful or not) + */ + ReturnURL: string; + + /** + * The type of card + */ + CardType: card.CardType; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it + * automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode: SecureMode; + + /** + * The language to use for the payment page - needs to be the ISO code of the language + */ + Culture: CountryISO; + + /** + * The URL to use for the payment page template + */ + TemplateURL: string; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. + * See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor: string; + + /** + * The URL to redirect to user to for them to proceed with the payment + */ + RedirectURL: string; + } + + interface CreateCardWebPayIn { + ExecutionType: "WEB"; + PaymentType: "CARD"; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The URL to redirect to after payment (whether successful or not) + */ + ReturnURL: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * The type of card + */ + CardType: card.CardType; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. + * The field lets you activate it automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects + * there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode?: SecureMode; + + /** + * The language to use for the payment page - needs to be the ISO code of the language + */ + Culture: CountryISO; + + /** + * A URL to an SSL page to allow you to customise the payment page. Must be in the format: array("PAYLINE"=>"https://...") and meet all the + * specifications listed here. Note that only a template for Payline is currently available + */ + TemplateURLOptions?: TemplateURLOptions; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and + * can only include alphanumeric characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor?: string; + } + + interface CardDirectPayInData extends BasePayInData { + ExecutionType: "DIRECT"; + PaymentType: "CARD"; + + /** + * This is the URL where users are automatically redirected after 3D secure validation (if activated) + */ + SecureModeReturnURL: string; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it + * automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode: SecureMode; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric + * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor: string; + + /** + * Contains useful information related to the user billing + */ + Billing: BillingData; + + /** + * Contains information related to security and fraud + */ + SecurityInfo: SecurityInfoData; + + /** + * The value is 'true' if the SecureMode was used + */ + SecureModeNeeded: boolean; + + /** + * This is the URL where to redirect users to proceed to 3D secure validation + */ + SecureModeRedirectUrl: string; + } + + interface CreateCardDirectPayIn { + ExecutionType: "DIRECT"; + PaymentType: "CARD"; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * This is the URL where users are automatically redirected after 3D secure validation (if activated) + */ + SecureModeReturnURL: string; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it automatically + * with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode?: SecureMode; + + /** + * Contains useful information related to the user billing + */ + Billing?: BillingData; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. + * See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor?: string; + } + + interface CardPreAuthorizedPayInData extends BasePayInData { + PreauthorizationId: string; + ExecutionType: "DIRECT"; + PaymentType: "PREAUTHORIZED"; + } + + interface CreateCardPreAuthorizedPayIn { + ExecutionType: "DIRECT"; + PaymentType: "PREAUTHORIZED"; + + /** + * Custom data that you can add to this item + */ + Tag?: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the Preauthorization object + */ + PreauthorizationId: string; + } + + interface BankAccountData { + /** + * The BIC of the bank account + */ + BIC: string; + + /** + * The IBAN of the bank account + */ + IBAN: string; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: string; + + /** + * The type of bank account + */ + Type: ValueOf; + } + + interface BankWireDirectPayInData extends BasePayInData { + ExecutionType: "DIRECT"; + PaymentType: "BANK_WIRE"; + + /** + * The declared debited funds + */ + DeclaredDebitedFunds: MoneyData; + + /** + * The declared fees + */ + DeclaredFees: MoneyData; + + /** + * Wire reference + */ + WireReference: string; + + /** + * Bank account details + */ + BankAccount: BankAccountData; + } + + interface CreateBankWireDirectPayIn + extends PickPartialRequired< + BankWireDirectPayInData, + "Tag", + | "AuthorId" + | "CreditedUserId" + | "CreditedWalletId" + | "DeclaredDebitedFunds" + | "DeclaredFees" + > { + ExecutionType: "DIRECT"; + PaymentType: "BANK_WIRE"; + } + + type PayInData = + | CardDirectPayInData + | CardPreAuthorizedPayInData + | CardWebPayInData + | BankWireDirectPayInData; + } + + namespace refund { + type RefundReasonType = + | "INITIALIZED_BY_CLIENT" + | "BANKACCOUNT_INCORRECT" + | "OWNER_DO_NOT_MATCH_BANKACCOUNT" + | "BANKACCOUNT_HAS_BEEN_CLOSED" + | "WITHDRAWAL_IMPOSSIBLE_ON_SAVINGS_ACCOUNTS" + | "OTHER"; + interface RefundReason { + RefundReasonType: RefundReasonType; + } + + interface RefundData extends transaction.TransactionData { + /** + * The nature of the transaction + */ + Nature: "REFUND"; + + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * Contains info about the reason for refund + */ + RefundReason: RefundReason; + } + + interface CreatePayInRefund { + AuthorId: string; + Tag?: string; + DebitedFunds?: MoneyData; + Fees?: MoneyData; + } + + interface CreateTransferRefund { + AuthorId: string; + Tag?: string; + } + } + + namespace repudiation { + interface RepudiationData extends transaction.TransactionData { + /** + * The nature of the transaction + */ + Nature: "REPUDIATION"; + + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * Contains info about the reason for refund + */ + RefundReason: refund.RefundReason; + } + } + + namespace client { + type BusinessType = "MARKETPLACE" | "CROWDFUNDING" | "FRANCHISE" | "OTHER"; + type Sector = + | "RENTALS" + | "STORES_FASHION_ACCESSORIES_OBJECTS" + | "BEAUTY_COSMETICS_HEALTH" + | "FOOD_WINE_RESTAURANTS" + | "HOSPITALITY_TRAVEL_CORIDING" + | "ART_MUSIC_ENTERTAINMENT" + | "FURNITURE_GARDEN" + | "SERVICES_JOBBING_EDUCATION" + | "SPORT_RECREATION_ACTIVITIES" + | "TICKETING"; + type PlatformType = ValueOf; + + interface PlatformCategorization { + Sector: Sector; + BusinessType: BusinessType; + } + + interface ClientData extends entityBase.EntityBaseData { + /** + * The pretty name for the client + */ + Name: string; + + /** + * The registered name of your company + */ + RegisteredName: string; + + /** + * An ID for the client (i.e. url friendly, lowercase etc - sort of namespace identifier) + */ + ClientId: string; + + /** + * The primary branding colour to use for your merchant + */ + PrimaryThemeColour: string; + + /** + * The primary branding colour to use for buttons for your merchant + */ + PrimaryButtonColour: string; + + /** + * The URL of the logo of your client + */ + Logo: string; + + /** + * A list of email addresses to use when contacting you for technical issues/communications + */ + TechEmails: string[]; + + /** + * A list of email addresses to use when contacting you for admin/commercial issues/communications + */ + AdminEmails: string[]; + + /** + * A list of email addresses to use when contacting you for fraud/compliance issues/communications + */ + FraudEmails: string[]; + + /** + * A list of email addresses to use when contacting you for billing issues/communications + */ + BillingEmails: string[]; + + /** + * The Categorization of your platform, in terms of Business Type and Sector + */ + PlatformCategorization: PlatformCategorization; + + /** + * A description of what your platform does + */ + PlatformDescription: string; + + /** + * The URL for your website + */ + PlatformURL: string; + + /** + * The address of the company’s headquarters + */ + HeadquartersAddress: address.AddressType; + + /** + * The tax (or VAT) number for your company + */ + TaxNumber: string; + + /** + * Your unique MANGOPAY reference which you should use when contacting us + */ + CompanyReference: string; + } + + interface UpdateClient { + /** + * The primary branding colour to use for buttons for your merchant + */ + PrimaryButtonColour?: string; + + /** + * The primary branding colour to use for your merchant + */ + PrimaryThemeColour?: string; + + /** + * A list of email addresses to use when contacting you for admin/commercial issues/communications + */ + AdminEmails?: string[]; + + /** + * A list of email addresses to use when contacting you for technical issues/communications + */ + TechEmails?: string[]; + + /** + * A list of email addresses to use when contacting you for billing issues/communications + */ + BillingEmails?: string[]; + + /** + * A list of email addresses to use when contacting you for fraud/compliance issues/communications + */ + FraudEmails?: string[]; + + /** + * The address of the company’s headquarters + */ + HeadquartersAddress?: address.AddressType; + + /** + * The tax (or VAT) number for your company + */ + TaxNumber?: string; + + /** + * The type of platform + */ + PlatformType?: PlatformType; + + /** + * A description of what your platform does + */ + PlatformDescription?: string; + + /** + * The URL for your website + */ + PlatformURL?: string; + } + + interface UpdateClientLogo { + /** + * The base64 encoded file which needs to be uploaded + */ + File: string; + } + } + + namespace event { + type EventType = + | "PAYIN_NORMAL_CREATED" + | "PAYIN_NORMAL_SUCCEEDED" + | "PAYIN_NORMAL_FAILED" + | "PAYOUT_NORMAL_CREATED" + | "PAYOUT_NORMAL_SUCCEEDED" + | "PAYOUT_NORMAL_FAILED" + | "TRANSFER_NORMAL_CREATED" + | "TRANSFER_NORMAL_SUCCEEDED" + | "TRANSFER_NORMAL_FAILED" + | "PAYIN_REFUND_CREATED" + | "PAYIN_REFUND_SUCCEEDED" + | "PAYIN_REFUND_FAILED" + | "PAYOUT_REFUND_CREATED" + | "PAYOUT_REFUND_SUCCEEDED" + | "PAYOUT_REFUND_FAILED" + | "TRANSFER_REFUND_CREATED" + | "TRANSFER_REFUND_SUCCEEDED" + | "TRANSFER_REFUND_FAILED" + | "KYC_CREATED" + | "KYC_VALIDATION_ASKED" + | "KYC_SUCCEEDED" + | "KYC_FAILED" + | "PAYIN_REPUDIATION_CREATED" + | "PAYIN_REPUDIATION_SUCCEEDED" + | "PAYIN_REPUDIATION_FAILED" + | "DISPUTE_DOCUMENT_CREATED" + | "DISPUTE_DOCUMENT_VALIDATION_ASKED" + | "DISPUTE_DOCUMENT_SUCCEEDED" + | "DISPUTE_DOCUMENT_FAILED" + | "DISPUTE_CREATED" + | "DISPUTE_SUBMITTED" + | "DISPUTE_ACTION_REQUIRED" + | "DISPUTE_FURTHER_ACTION_REQUIRED" + | "DISPUTE_CLOSED" + | "DISPUTE_SENT_TO_BANK" + | "TRANSFER_SETTLEMENT_CREATED" + | "TRANSFER_SETTLEMENT_SUCCEEDED" + | "TRANSFER_SETTLEMENT_FAILED" + | "MANDATE_CREATED" + | "MANDATE_FAILED" + | "MANDATE_ACTIVATED" + | "MANDATE_SUBMITTED" + | "PREAUTHORIZATION_PAYMENT_WAITING" + | "PREAUTHORIZATION_PAYMENT_EXPIRED" + | "PREAUTHORIZATION_PAYMENT_CANCELED" + | "PREAUTHORIZATION_PAYMENT_VALIDATED" + | "UBO_DECLARATION_CREATED" + | "UBO_DECLARATION_VALIDATION_ASKED" + | "UBO_DECLARATION_REFUSED" + | "UBO_DECLARATION_VALIDATED"; + + interface EventData { + /** + * The ID of whatever the event is + */ + ResourceId: string; + + /** + * When the event happened + */ + Date: Timestamp; + + /** + * The event type + */ + EventType: EventType; + } + } + + namespace dispute { + type DisputeReasonType = + | "DUPLICATE" + | "FRAUD" + | "PRODUCT_UNACCEPTABLE" + | "UNKNOWN" + | "OTHER" + | "REFUND_CONVERSION_RATE" + | "LATE_FAILURE_INSUFFICIENT_FUNDS" + | "LATE_FAILURE_CONTACT_USER" + | "LATE_FAILURE_BANKACCOUNT_CLOSED" + | "LATE_FAILURE_BANKACCOUNT_INCOMPATIBLE" + | "LATE_FAILURE_BANKACCOUNT_INCORRECT" + | "AUTHORISATION_DISPUTED" + | "TRANSACTION_NOT_RECOGNIZED" + | "PRODUCT_NOT_PROVIDED" + | "CANCELED_REOCCURING_TRANSACTION" + | "REFUND_NOT_PROCESSED"; + + type DisputeStatus = + | "CREATED" + | "PENDING_CLIENT_ACTION" + | "SUBMITTED" + | "PENDING_BANK_ACTION" + | "REOPENED_PENDING_CLIENT_ACTION" + | "CLOSED"; + + type DisputeType = "CONTESTABLE" | "NOT_CONTESTABLE" | "RETRIEVAL"; + + interface DisputeReason { + DisputeReasonType: DisputeReasonType; + DisputeReasonMessage: string; + } + + interface DisputeData extends entityBase.EntityBaseData { + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * Info about the reason for the dispute + */ + DisputeReason: DisputeReason; + + /** + * The status of the dispute + */ + Status: DisputeStatus; + + /** + * Used to communicate information about the dispute status to you + */ + StatusMessage: string; + + /** + * The amount of funds that were disputed + */ + DisputedFunds: MoneyData; + + /** + * The amount you wish to contest + */ + ContestedFunds: MoneyData; + + /** + * The type of dispute + */ + DisputeType: DisputeType; + + /** + * The deadline by which you must contest the dispute (if you wish to contest it) + */ + ContestDeadlineDate: Timestamp; + + /** + * The ID of the associated repudiation transaction + */ + RepudiationId: string; + } + + interface SubmitDispute + extends PickPartial {} + + interface UpdateDispute extends PickPartial {} + } + + interface DisputeReason extends dispute.DisputeReason {} + + namespace settlementTransfer { + interface SettlementTransferData extends transaction.TransactionData { + /** + * The nature of the transaction + */ + Nature: "SETTLEMENT"; + + /** + * The ID of the associated repudiation transaction + */ + RepudiationId: string; + + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * Contains info about the reason for refund + */ + RefundReason: refund.RefundReason; + } + + interface CreateSettlementTransfer + extends PickPartialRequired< + SettlementTransferData, + "Tag", + "AuthorId" | "DebitedFunds" | "Fees" + > {} + } + + namespace transfer { + interface TransferData extends entityBase.EntityBaseData { + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Details about the funds that are being credited (DebitedFunds – Fees = CreditedFunds) + */ + CreditedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The nature of the transaction + */ + Nature: transaction.TransactionNature; + + /** + * The status of the transaction + */ + Status: transaction.TransactionStatus; + + /** + * When the transaction happened + */ + ExecutionDate: Timestamp; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The type of the transaction + */ + Type: "TRANSFER"; + } + + interface CreateTransfer { + /** + * Custom data that you can add to this item + */ + Tag?: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + } + } + + namespace PayOut { + interface PayOutData extends Omit { + /** + * The type of the transaction + */ + Type: "PAYOUT"; + + PaymentType: IPayOutPaymentType["BankWire"]; + + /** + * An ID of a Bank Account + */ + BankAccountId: string; + + /** + * A custom reference you wish to appear on the user’s bank statement (your Client Name is already shown). This reference can contain max 12 characters + */ + BankWireRef: string; + } + + interface CreatePayOut { + /** + * A user's ID + */ + AuthorId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * An ID of a Bank Account + */ + BankAccountId: string; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * A custom reference you wish to appear on the user’s bank statement (your Client Name is already shown). This reference can contain max 12 characters + */ + BankWireRef?: string; + Tag?: string; + } + } + + class Users { + /** + * Create a new user + * @param user + */ + create: MethodOverload & + MethodOverload; + + /** + * Update a user + * @param user + * @param options + */ + update: MethodOverload< + models.UserLegal | user.UpdateUserLegalData, + user.UserLegalData + > & + MethodOverload< + models.UserNatural | user.UpdateUserNaturalData, + user.UserNaturalData + >; + + /** + * Get natural or legal user by ID + * @param userId + * @param options + */ + get: MethodOverload; + + /** + * Get natural user by ID + * @param userId + * @param options + */ + getNatural: MethodOverload; + + /** + * Get legal user by ID + * @param userId + * @param options + */ + getLegal: MethodOverload; + + /** + * Get all users + */ + getAll: NoArgMethodOverload< + Array + >; + + /** + * Create bank account for user + * @param userId + * @param bankAccount + * @param options + */ + createBankAccount: TwoArgsMethodOverload< + string, + bankAccount.USDetails, + bankAccount.USData + > & + TwoArgsMethodOverload< + string, + bankAccount.OtherDetails, + bankAccount.OtherData + > & + TwoArgsMethodOverload< + string, + bankAccount.IBANDetails, + bankAccount.IBANData + > & + TwoArgsMethodOverload & + TwoArgsMethodOverload; + + /** + * Deactivate a bank account + * + * Note that once deactivated, a bank account can't be reactivated afterwards + * @param userId + * @param bankAccountId + * @param options + */ + deactivateBankAccount: TwoArgsMethodOverload; + + /** + * Get all bank accounts for user + * @param userId + * @param options + */ + getBankAccounts: MethodOverload; + + /** + * Get all bank accounts for user + * @param userId + * @param bankAccountId + * @param options + */ + getBankAccount: TwoArgsMethodOverload; + + /** + * Get all wallets accounts for user + */ + getWallets: MethodOverload; + + /** + * Get all transactions for user + * @param userId + * @param options + */ + getTransactions: MethodOverload; + + /** + * Get all cards for user + * @param userId + * @param options + */ + getCards: MethodOverload; + + /** + * Create new KYC document + * @param userId + * @param kycDocument + * @param options + */ + createKycDocument: TwoArgsMethodOverload< + string, + kycDocument.CreateKycDocument, + kycDocument.KycDocumentData + >; + + /** + * Get all KYC documents for user + * @param userId + * @param options + */ + getKycDocuments: MethodOverload; + + /** + * Get KYC document + * @param userId + * @param kycDocumentId + * @param options + */ + getKycDocument: TwoArgsMethodOverload< + string, + string, + kycDocument.KycDocumentData + >; + + /** + * Update status of KYC Document (Currently only allows for submitting the document) + * @param userId + * @param kycDocument + * @param options + */ + updateKycDocument: TwoArgsMethodOverload< + string, + kycDocument.SubmitKycDocument, + kycDocument.KycDocumentData + >; + + /** + * Create page for KYC document + * @param userId + * @param kycDocumentId + * @param kycPage + * @param options + */ + createKycPage: ThreeArgsMethodOverload< + string, + string, + kycDocument.CreateKycPage, + kycDocument.KycDocumentData + >; + + /** + * Create page for KYC document + * @param userId + * @param kycDocumentId + * @param filePath + * @param options + */ + createKycPageFromFile: ThreeArgsMethodOverload< + string, + string, + string, + kycDocument.KycDocumentData + >; + + /** + * Get users's EMoney + * @param userId + * @param options + */ + getEMoney: MethodOverload; + + /** + * Create an UboDeclaration for the user + * @param userId + * @param uboDeclaration + * @param options + */ + createUboDeclaration: TwoArgsMethodOverload< + string, + uboDeclaration.CreateUboDeclaration, + uboDeclaration.UboDeclarationData + >; + + /** + * Get all user preauthorizations + * @param userId + * @param options + */ + getPreAuthorizations: MethodOverload< + string, + cardPreAuthorization.CardPreAuthorizationData[] + >; + } + + /** + * You need to create document in order to upload pages on this document. + * + * 1. The KYC Document Object is a request to validate a required document. There is one request for one Type of document + * 2. Upload a file through a Page. A document should get several pages + * 3. Edit the object Document and set the Status field to "VALIDATION_ASKED" (instead of "CREATED") + * 4. The demand is received by our team. The object is waiting for a "VALIDATED" status + * + * Note that you are not allowed to store KYC documents on your side unless you have permission from the approriate authorities in your country + */ + class KycDocuments { + /** + * Get all KycDocuments + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Get KycDocument + * @param kycDocumentId + * @param options + */ + get: MethodOverload; + + /** + * Creates temporary URLs where each page of a KYC document can be viewed. + * @param documentId + */ + createKycDocumentConsult: MethodOverload< + string, + any // Unsure of data structure from docs + >; + } + + /** + * An UBO Declaration is an electronic version of the previous KYC document "Shareholder Declaration", in order to declare all the Ultimate Beneficial Owners of a BUSINESS-typed legal User + * (ie the shareholders with >25% of capital or voting rights). + * + * 1. Create each Ultimate Beneficial Owner as a Natural User, who must have a "DECLARATIVE" Capacity. + * 2. Create a new UBO Declaration for your legal user, and link every Ultimate Beneficial Owners created previously thanks to DeclaredUBOs. + * - This list can be empty if your legal user has no Ultimate Beneficial Owner, or no eligible one (ie. no Ultimate Beneficial Owner that owns more than 25% of this company). + * 3. Edit the UBODeclaration object and set the Status field to "VALIDATION_ASKED" (instead of "CREATED") + * 4. The demand is received by our team and once processed, it will either get a "VALIDATED" status, or "REFUSED" with more information provided in the RefusedReasonTypes parameter + * + * Note that UBO declarations are not yet a requirement for your user to be KYC verified and are optional at this stage + */ + class UboDeclarations { + /** + * Retrieves a UBO declaration object from the API. + * @param id + * @param options + */ + get: MethodOverload; + + /** + * Updates a UBO declaration entity. + * @param uboDeclaration Updated UBO declaration entity - must have ID + * @param options + */ + update: MethodOverload< + uboDeclaration.UpdateUboDeclaration, + uboDeclaration.UboDeclarationData + >; + } + + class BankAccounts { + /** + * Retrieve list of transactions for a bank account + * @param bankAccountId + * @param options + */ + getTransactions: MethodOverload; + } + + class Wallets { + /** + * Create new wallet + * @param wallet + * @param options + */ + create: MethodOverload< + wallet.CreateWallet | models.Wallet, + wallet.WalletData + >; + + /** + * Update wallet + * @param wallet + * @param options + */ + update: MethodOverload< + wallet.UpdateWallet | models.Wallet, + wallet.WalletData + >; + + /** + * Get a specific wallet + * @param walletId + */ + get: MethodOverload; + + /** + * Get transactions for the wallet + * @param walletId + * @param options + */ + getTransactions: MethodOverload; + } + + class Cards { + /** + * Get card + * @param cardId + * @param ptions + */ + get: MethodOverload; + + /** + * Gets a list of cards having the same fingerprint. + * The fingerprint is a hash uniquely generated per 16-digit card number. + * + * @param fingerprint The fingerprint hash + */ + getByFingerprint: MethodOverload; + + /** + * Update card (currently only supports deactivation) + * @param card + * @param options + */ + update: MethodOverload; + + /** + * Get list of Transactions of a Card + * @param cardId + * @param options + */ + getTransactions: MethodOverload; + + /** + * Gets list of PreAuthorizations of a Card. + * @param cardId + * @param options + */ + getPreAuthorizations: MethodOverload< + string, + cardPreAuthorization.CardPreAuthorizationData[] + >; + } + + /** + * You need to register a card in order to process a Direct PayIn. Card registration enables you to tokenize a Card. These are the steps to follow: + * + * 1. Create a CardRegistration Object + * 2. Get a PreRegistrationData + * 3. The user posts PreRegistrationData, AccessKey and card details through a form (PHP & JS samples) to the CardRegistrationURL (5. in the diagram) + * 4. Get a RegistrationData back + * 5. Edit the CardRegistration Object (POST method) with the RegistrationData just received + * 6. Get the CardId ready to use into the Direct PayIn Object + * + * - If you don’t want to save the card you must change the field ACTIVE in the card object to false + */ + class CardRegistrations { + /** + * Create new card registration + * @param cardRegistration + * @param options + */ + create: MethodOverload< + cardRegistration.CreateCardRegistration, + cardRegistration.CardRegistrationData + >; + + /** + * Create new card registration + * @param cardRegistrationId + * @param options + */ + get: MethodOverload; + + /** + * Update card registration + * @param cardRegistration + */ + update: MethodOverload< + cardRegistration.UpdateCardRegistration, + cardRegistration.CardRegistrationData + >; + } + + /** + * The PreAuthorization Object ensures the solvency of a registered card for 7 days. The overall process is as follows: + * + * 1. Register a card (CardRegistration) + * 2. Create a PreAuthorization with the CardId. This allows you to charge an amount on a card + * 3. Charge the card through the PreAuthorized PayIn object (Payins/preauthorized/direct) + * + * How does PreAuthorization work? + * - Once the PreAuthorization object is created the Status is "CREATED" until 3D secure validation. + * - If the authorization is successful the status is "SUCCEEDED" if it failed the status is "FAILED". + * - Once Status = "SUCCEEDED" and PaymentStatus = "WAITING" you can charge the card. + * - The Pay-In amount has to be less than or equal to the amount authorized. + */ + class CardPreAuthorizations { + /** + * Create new pre-authorization + * @param cardPreAuthorization + * @param options + */ + create: MethodOverload< + cardPreAuthorization.CreateCardPreAuthorization, + cardPreAuthorization.CardPreAuthorizationData + >; + + /** + * Get data for Card pre-authorization + * @param cardPreAuthorizationId + * @param options + */ + get: MethodOverload; + + /** + * Update pre-authorization object (currently only supports cancellation) + * @param cardPreAuthorization + */ + update: MethodOverload< + cardPreAuthorization.UpdateCardPreAuthorization, + cardPreAuthorization.CardPreAuthorizationData + >; + } + + class PayIns { + /** + * Create new pay-in + * @param payIn + * @param options + */ + create: MethodOverload< + payIn.CreateCardDirectPayIn, + payIn.CardDirectPayInData + > & + MethodOverload< + payIn.CreateCardPreAuthorizedPayIn, + payIn.CardPreAuthorizedPayInData + > & + MethodOverload & + MethodOverload< + payIn.CreateBankWireDirectPayIn, + payIn.BankWireDirectPayInData + >; + + /** + * Get pay-in + * @param payInId + * @param options + */ + get: MethodOverload; + + /** + * Create refund for pay-in object + * @param payInId + * @param refundData + * @param options + */ + createRefund: TwoArgsMethodOverload< + string, + refund.CreatePayInRefund, + refund.RefundData + >; + + /** + * Gets list of Refunds for a PayIn + * @param payInId + * @param options + */ + getRefunds: MethodOverload; + } + + class Refunds { + /** + * Get events + * @param refundId + * @param options + */ + get: MethodOverload; + } + + class Clients { + /** + * Get the client + */ + get: NoArgMethodOverload; + + /** + * Update the client + * @param client + * @param options + */ + update: MethodOverload; + + /** + * Upload client logo from base64 image string + * @param base64Logo + * @param options + */ + uploadLogo: MethodOverload; + + /** + * Upload client logo from file path + * @param filePath + * @param options + */ + uploadLogoFromFile: MethodOverload; + + /** + * Get all client wallets + * @param options + */ + getClientWallets: NoArgMethodOverload; + + /** + * Get a client wallet + * @param fundsType + * @param currency + * @param options + */ + getClientWallet: TwoArgsMethodOverload< + wallet.ClientFundsType, + CurrencyISO, + wallet.ClientWalletData + >; + + /** + * Get client wallets by the type of funds + * @param fundsType + * @param options + */ + getClientWalletsByFundsType: MethodOverload< + wallet.ClientFundsType, + wallet.ClientWalletData[] + >; + + /** + * Get a client wallet's transactions + * @param fundsType + * @param currency + * @param options + */ + getClientWalletTransactions: TwoArgsMethodOverload< + wallet.ClientFundsType, + CurrencyISO, + transaction.TransactionData[] + >; + } + + class PayOuts { + /** + * Create new pay-out + * @param payOut + * @param options + */ + create: MethodOverload; + + /** + * Get payout + * @param payOutId + * @param options + */ + get: MethodOverload; + + /** + * Gets list of Refunds of a PayOut + * @param payOutId + * @param options + */ + getRefunds: MethodOverload; + } + + class Transfers { + /** + * Create new transfer + * @param transfer + * @param options + */ + create: MethodOverload; + + /** + * Get transfer + * @param transferId + * @param options + */ + get: MethodOverload; + + /** + * Create refund for transfer object + * @param transferId + * @param refund + * @param options + */ + createRefund: TwoArgsMethodOverload< + string, + refund.CreateTransferRefund, + refund.RefundData + >; + + /** + * Gets list of Refunds of a Transfer + * @param transferId + * @param options + */ + getRefunds: MethodOverload; + } + + class BankingAliases { + /** + * Create a banking alias + * @param bankingAlias + * @param options + */ + create: MethodOverload< + bankingAlias.CreateIBANBankingAlias, + bankingAlias.IBANBankingAliasData + >; + + /** + * Get a banking alias + * @param bankingAliasId + * @param options + */ + get: MethodOverload; + + /** + * Get all banking aliases + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Update banking alias + * @param bankingAliasId + * @param options + */ + update: MethodOverload< + Partial>, + bankingAlias.IBANBankingAliasData + >; + + /** + * Deactivate banking alias + * @param bankingAliasId + * @param options + */ + deactivate: MethodOverload; + + /** + * Activate banking alias + * @param bankingAliasId + * @param options + */ + activate: MethodOverload; + } + + class DisputeDocuments { + /** + * Get all KycDocuments + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Get KycDocument + * @param documentId + * @param options + */ + get: MethodOverload; + + /** + * Creates temporary URLs where each page of a KYC document can be viewed. + * @param documentId + */ + createDisputeDocumentConsult: MethodOverload< + string, + any // Unsure of data structure from docs + >; + } + + class Repudiations { + /** + * Gets list of Refunds of a Repudiation + * @param repudiationId + * @param options + */ + getRefunds: MethodOverload; + } + + class Disputes { + /** + * Get dispute + * @param disputeId + * @param options + */ + get: MethodOverload; + + /** + * Get all disputes + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Update dispute's tag + * @param dispute + * @param options + */ + update: MethodOverload; + + /** + * Contest dispute + * @param disputeId + * @param contestedFunds + * @param options + */ + contestDispute: TwoArgsMethodOverload< + string, + MoneyData, + dispute.DisputeData + >; + + /** + * This method is used to resubmit a Dispute if it is reopened requiring more docs + * @param disputeId + * @param options + */ + resubmitDispute: MethodOverload; + + /** + * Close dispute + * @param disputeId + * @param options + */ + closeDispute: MethodOverload; + + /** + * Gets dispute's transactions + * @param disputeId + * @param options + */ + getTransactions: MethodOverload; + + /** + * Gets dispute's documents for wallet + * @param walletId + * @param options + */ + getDisputesForWallet: MethodOverload; + + /** + * Gets user's disputes + * @param userId + * @param options + */ + getDisputesForUser: MethodOverload; + + /** + * Gets repudiation + * @param repudiationId + * @param options + */ + getRepudiation: MethodOverload; + + /** + * Creates settlement transfer + * @param settlementTransfer + * @param repudiationId + * @param options + */ + createSettlementTransfer: TwoArgsMethodOverload< + settlementTransfer.CreateSettlementTransfer, + string, + settlementTransfer.SettlementTransferData + >; + + /** + * Gets settlement transfer + * @param settlementTransferId + * @param options + */ + getSettlementTransfer: MethodOverload< + string, + settlementTransfer.SettlementTransferData + >; + + /** + * Gets documents for dispute + * @param disputeId + * @param options + */ + getDocumentsForDispute: MethodOverload< + string, + disputeDocument.DisputeDocumentData[] + >; + + /** + * Update dispute document + * @param disputeId + * @param disputeDocument + * @param options + */ + updateDisputeDocument: TwoArgsMethodOverload< + string, + Partial, + disputeDocument.DisputeDocumentData + >; + + /** + * Creates document for dispute + * @param disputeId + * @param disputeDocument + * @param options + */ + createDisputeDocument: TwoArgsMethodOverload< + string, + disputeDocument.CreateDisputeDocument, + disputeDocument.DisputeDocumentData + >; + + /** + * Creates document's page for dispute + * @param disputeId + * @param disputeDocumentId + * @param disputeDocumentPage + * @param options + */ + createDisputeDocumentPage: ThreeArgsMethodOverload< + string, + string, + disputeDocument.CreateDisputeDocumentPage, + disputeDocument.DisputeDocumentData + >; + + /** + * Creates document's page for dispute from file + * @param disputeId + * @param disputeDocumentId + * @param file + * @param options + */ + createDisputeDocumentPageFromFile: ThreeArgsMethodOverload< + string, + string, + string, + disputeDocument.DisputeDocumentData + >; + + /** + * Retrieve a list of Disputes pending settlement + * @param options + */ + getPendingSettlement: NoArgMethodOverload; + } + + class Events { + /** + * Get events + * @param options + */ + getAll: NoArgMethodOverload; + } + + class Responses { + /** + * Get response from previous call + * @param options + */ + get: NoArgMethodOverload; + } + + class Mandates { + /** + * Create a new Mandate + * @param mandate + * @param options + */ + create: MethodOverload; + + /** + * Get all mandates + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Get mandate by ID + * @param mandateId + * @param options + */ + get: MethodOverload; + + /** + * Cancel a mandate + * @param mandateId + * @param options + */ + cancel: MethodOverload; + + /** + * Gets user's mandates + * @param userId + * @param options + */ + getMandatesForUser: MethodOverload; + + /** + * Gets bank account mandates + * @param userId + * @param bankAccountId + * @param options + */ + getMandatesForBankAccount: TwoArgsMethodOverload< + string, + string, + mandate.MandateData[] + >; + + /** + * Gets Transactions for a Mandate + * @param mandateId + * @param options + */ + getTransactions: MethodOverload; + } + class Hooks { + /** + * Create new hook + * @param hook + * @param options + */ + create: MethodOverload; + + /** + * Get hook + * @param hookId + * @param options + */ + get: MethodOverload; + + /** + * Save hook + * @param hook + * @param options + */ + update: MethodOverload; + + /** + * Get all hooks + * @param options + */ + getAll: NoArgMethodOverload; + } + + class Reports { + /** + * Create a report + * @param report + * @param options + */ + create: MethodOverload; + + /** + * Get a report + * @param reportId + * @param options + */ + get: MethodOverload; + + /** + * Get all reports + * @param options + */ + getAll: NoArgMethodOverload; + } +} diff --git a/types/mangopay2-nodejs-sdk/mangopay2-nodejs-sdk-tests.ts b/types/mangopay2-nodejs-sdk/mangopay2-nodejs-sdk-tests.ts new file mode 100644 index 0000000000..ba15315ce7 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/mangopay2-nodejs-sdk-tests.ts @@ -0,0 +1,721 @@ +import Mangopay = require("mangopay2-nodejs-sdk"); + +// $ExpectError +const invalidConfig: Mangopay.Config = {}; + +/* General Types */ + +const validConfig: Mangopay.Config = { + clientId: "your_client_id", + clientApiKey: "your_client_api_key", + baseUrl: "https://api.mangopay.com" +}; + +const api = new Mangopay(validConfig); // IGNORE-TEST $ExpectType MangoPay +const payIn: Mangopay.models.PayIn = new api.models.PayIn({}); // IGNORE-TEST $ExpectType PayIn +const address: Mangopay.models.Address = new api.models.Address({}); // IGNORE-TEST $ExpectType Address + +const addressData: Mangopay.address.AddressData = { + AddressLine1: "20 T Street", + AddressLine2: "", + City: "London", + Country: "UK", + PostalCode: "FR43 2WE", + Region: "London" +}; + +/* Users */ + +const legalUser = new api.models.UserLegal({ + Name: "MangoPay", + Email: "info@mangopay.com", + LegalPersonType: "BUSINESS", + LegalRepresentativeFirstName: "Mango", + LegalRepresentativeLastName: "Pay", + LegalRepresentativeEmail: "mango@mangopay.com", + HeadquartersAddress: new api.models.Address({ + AddressLine1: "4101 Reservoir Rd NW", + AddressLine2: "", + City: "Washington", + Region: "District of Columbia", + PostalCode: "20007", + Country: "US" + }), + LegalRepresentativeBirthday: 1300186358, + LegalRepresentativeNationality: "FR", + LegalRepresentativeCountryOfResidence: "FR", + Tag: "custom tag" +}); + +api.Users.create(legalUser).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserLegalData + const value = data.PersonType; // IGNORE-TEST $ExpectType "LEGAL" + + console.log(`${legalUser.Name} user created at ${legalUser.CreationDate}`); +}); + +api.Users.create(legalUser, { readResponseHeaders: true }).then(data => { + const d = data; // IGNORE-TEST $ExpectType WithResponse + const value = data.body; // IGNORE-TEST $ExpectType UserLegalData +}); + +api.Users.create( + { + PersonType: "LEGAL", + Name: "MangoPay", + Email: "info@mangopay.com", + LegalPersonType: "BUSINESS", + LegalRepresentativeFirstName: "Mango", + LegalRepresentativeLastName: "Pay", + LegalRepresentativeEmail: "mango@mangopay.com", + HeadquartersAddress: new api.models.Address({ + AddressLine1: "4101 Reservoir Rd NW", + AddressLine2: "", + City: "Washington", + Region: "District of Columbia", + PostalCode: "20007", + Country: "US" + }), + LegalRepresentativeBirthday: 1300186358, + LegalRepresentativeNationality: "FR", + LegalRepresentativeCountryOfResidence: "FR", + Tag: "custom tag" + }, + { headers: {} } +).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserLegalData +}); + +const naturalUser = new api.models.UserNatural({ + Email: "info@mangopay.com", + Birthday: 1300186358, + FirstName: "Sara", + LastName: "McNick", + CountryOfResidence: "GB", + Nationality: "US" +}); + +api.Users.create(naturalUser, {}).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserNaturalData + const value = data.PersonType; // IGNORE-TEST $ExpectType "NATURAL" + return; +}); + +api.Users.create( + { + PersonType: "NATURAL", + Email: "info@mangopay.com", + Birthday: 1300186358, + FirstName: "Sara", + LastName: "McNick", + CountryOfResidence: "GB", + Nationality: "US" + }, + data => { + const d = data; // IGNORE-TEST $ExpectType UserNaturalData + console.log("create", data); + } +); + +api.Users.get("1234").then(data => { + const d = data; // IGNORE-TEST $ExpectType UserLegalData | UserNaturalData + if (data.PersonType === "LEGAL") { + const legalData = data; // IGNORE-TEST $ExpectType UserLegalData + } else { + const naturalData = data; // IGNORE-TEST $ExpectType UserNaturalData + } +}); + +api.Users.getAll().then(users => { + users.forEach(user => { + const d = user; // IGNORE-TEST $ExpectType UserLegalData | UserNaturalData + if (user.PersonType === "LEGAL") { + const legalData = user; // IGNORE-TEST $ExpectType UserLegalData + } else { + const naturalData = user; // IGNORE-TEST $ExpectType UserNaturalData + } + }); +}); + +api.Users.update({ + Id: "1234", + PersonType: "NATURAL", + Email: "info@mangopay.com", + Birthday: 1300186358, + FirstName: "Sara", + LastName: "McNick", + CountryOfResidence: "GB", + Nationality: "US" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserNaturalData +}); + +api.Users.createBankAccount("user-id", { + Type: "GB", + AccountNumber: "12345678", + SortCode: "123456", + OwnerAddress: "", + OwnerName: "" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType GBData +}); + +api.Users.getBankAccount("user-id", "bankAccount-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType Data +}); + +api.Users.getBankAccounts("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType Data[] +}); + +api.Users.deactivateBankAccount("user-id", "bankAccount-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType void +}); + +api.Users.getTransactions("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +api.Users.getWallets("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData[] +}); + +api.Users.getCards("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData[] +}); + +api.Users.createKycDocument("user-id", { Type: "ADDRESS_PROOF" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.Users.getKycDocuments("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData[] +}); + +api.Users.getKycDocument("user-id", "kycDocument-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.Users.updateKycDocument("user-id", { Status: "VALIDATION_ASKED" }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData + } +); + +api.Users.createKycPage("user-id", "kycDocument-id", { + File: "...base64data..." +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.Users.createKycPageFromFile( + "user-id", + "kyc-document-id", + "path/to/file" +).then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +// MangoPay. + +api.Users.getEMoney("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType EMoneyData +}); + +api.Users.createUboDeclaration("user-id", { DeclaredUBOs: ["user1"] }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType UboDeclarationData + } +); + +api.Users.getPreAuthorizations("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData[] +}); + +/* KycDocuments */ + +api.KycDocuments.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData[] +}); + +api.KycDocuments.get("kyc-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.KycDocuments.createKycDocumentConsult("kyc-id").then(data => { + const d = data; // TODO unsure of expected type +}); + +/* UboDeclarations */ + +api.UboDeclarations.get("ubo-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType UboDeclarationData +}); + +api.UboDeclarations.update({ + Id: "ubo-id", + DeclaredUBOs: ["user1", "user2"] +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType UboDeclarationData +}); + +/* BankAccounts */ + +api.BankAccounts.getTransactions("account-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* Wallets */ + +api.Wallets.create({ + Currency: "GBP", + Description: "A description", + Owners: ["user-id"] +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +const wallet = new api.models.Wallet({ + Currency: "GB", + Description: "A description", + Owners: ["user-id"] +}); + +api.Wallets.create(wallet).then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +api.Wallets.update({ + Description: "A description" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +api.Wallets.get("wallet-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +api.Wallets.getTransactions("wallet-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* Cards */ + +api.Cards.get("card-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData +}); + +api.Cards.getByFingerprint("fingerprinthash").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData[] +}); + +api.Cards.update({ Active: false, Id: "card-id" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData +}); + +api.Cards.getTransactions("card-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* CardRegistrations */ + +api.CardRegistrations.create({ + CardType: "BCMC", + Currency: "GBP", + UserId: "user-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardRegistrationData +}); + +api.CardRegistrations.get("reg-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardRegistrationData +}); + +api.CardRegistrations.update({ RegistrationData: "hmmm" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardRegistrationData +}); + +/* CardPreAuthorizations */ + +api.CardPreAuthorizations.create({ + AuthorId: "user", + CardId: "card-id", + DebitedFunds: { Currency: "AUD", Amount: 4000 }, + SecureModeReturnURL: "https://secureurl.com" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData +}); + +api.CardPreAuthorizations.get("auth-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData +}); + +api.CardPreAuthorizations.update({ + Id: "auth-id", + PaymentStatus: "CANCELED" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData +}); + +/* Refunds */ + +api.Refunds.get("refund-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData +}); + +/* PayIns */ + +api.PayIns.create({ + PaymentType: "CARD", + ExecutionType: "DIRECT", + AuthorId: "user-id", + CardId: "card-id", + CreditedWalletId: "wallet-id", + Fees: { Amount: 100, Currency: "GBP" }, + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + SecureModeReturnURL: "https://secure-return.co" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardDirectPayInData +}); + +api.PayIns.create({ + PaymentType: "CARD", + ExecutionType: "WEB", + AuthorId: "user-id", + CreditedWalletId: "wallet-id", + Fees: { Amount: 100, Currency: "GBP" }, + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + ReturnURL: "https://secure-return.co", + Culture: "AD", + CardType: "MAESTRO" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardWebPayInData +}); + +api.PayIns.create({ + PaymentType: "BANK_WIRE", + ExecutionType: "DIRECT", + AuthorId: "user-id", + CreditedWalletId: "wallet-id", + CreditedUserId: "credited-user-id", + DeclaredDebitedFunds: { Amount: 10000, Currency: "GBP" }, + DeclaredFees: { Amount: 500, Currency: "GBP" } +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType BankWireDirectPayInData +}); + +api.PayIns.get("payin-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType PayInData +}); + +api.PayIns.createRefund("payin-id", { AuthorId: "user-id" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData +}); + +api.PayIns.getRefunds("payin-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData[] +}); + +/* Clients */ +api.Clients.get().then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.update({ PlatformType: "CROWDFUNDING_DONATION" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.uploadLogo("...logobase64...").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.uploadLogoFromFile("path/to/file").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.getClientWallets().then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientWalletData[] +}); + +api.Clients.getClientWallet("CREDIT", "GBP").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientWalletData +}); + +api.Clients.getClientWalletsByFundsType("FEES").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientWalletData[] +}); + +api.Clients.getClientWalletTransactions("CREDIT", "GBP").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* PayOuts */ + +api.PayOuts.create({ + Fees: { Amount: 0, Currency: "GBP" }, + AuthorId: "user-id", + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + BankAccountId: "bank-id", + DebitedWalletId: "wallet-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType PayOutData +}); + +api.PayOuts.get("payout-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType PayOutData +}); + +api.PayOuts.getRefunds("payout-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData[] +}); + +/* Transfers */ + +api.Transfers.create({ + Fees: { Amount: 0, Currency: "GBP" }, + AuthorId: "user-id", + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + DebitedWalletId: "debit-wallet-id", + CreditedWalletId: "credit-wallet-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType TransferData +}); + +api.Transfers.get("transfer-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransferData +}); + +api.Transfers.createRefund("transfer-id", { AuthorId: "user-id" }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType RefundData + } +); + +api.Transfers.getRefunds("transfer-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData[] +}); + +/* BankingAliases */ + +api.BankingAliases.create({ + Country: "GB", + CreditedUserId: "user-id", + OwnerName: "owner-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.get("alias-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData[] +}); +api.BankingAliases.update({ OwnerName: "some-name" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.deactivate("alias-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.activate("alias-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); + +/* DisputeDocuments */ + +api.DisputeDocuments.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType DisputeDocumentData[] +}); + +api.DisputeDocuments.get("dispute-doc-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType DisputeDocumentData +}); + +api.DisputeDocuments.createDisputeDocumentConsult("dispute-doc-id").then( + data => { + const d = data; // TODO unsure of expected type + } +); + +/* Repudiations */ + +api.Repudiations.getRefunds("repudiation-id").then(data => { + const d = data; // $Expect RefundData[] +}); + +/* Disputes */ + +api.Disputes.get("dispute-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getAll().then(data => { + const d = data; // $Expect DisputeData[] +}); + +api.Disputes.update({ Tag: "any tags" }).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.contestDispute("dispute-id", { + Amount: 1000, + Currency: "GBP" +}).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.resubmitDispute("dispute-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.closeDispute("dispute-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getTransactions("dispute-id").then(data => { + const d = data; // $Expect TransactionData[] +}); + +api.Disputes.getDisputesForWallet("wallet-id").then(data => { + const d = data; // $Expect DisputeData[] +}); + +api.Disputes.getDisputesForUser("user-id").then(data => { + const d = data; // $Expect DisputeData[] +}); + +api.Disputes.getRepudiation("repudiation-id").then(data => { + const d = data; // $Expect RepudationData +}); + +api.Disputes.createSettlementTransfer( + { + AuthorId: "user-id", + DebitedFunds: { Amount: 1000, Currency: "GBP" }, + Fees: { Amount: 200, Currency: "GBP" } + }, + "repudiation-id" +).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getSettlementTransfer("settlement-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getDocumentsForDispute("dispute-id").then(data => { + const d = data; // $Expect DisputeDocumentData[] +}); + +api.Disputes.updateDisputeDocument("dispute-id", { Tag: "update" }).then( + data => { + const d = data; // $Expect DisputeDocumentData + } +); + +api.Disputes.createDisputeDocument("dispute-id", { + Type: "DELIVERY_PROOF" +}).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.createDisputeDocumentPage("dispute-id", "dispute-doc-id", { + File: "...base64string..." +}).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.createDisputeDocumentPageFromFile( + "dispute-id", + "dispute-doc-id", + "path/to/file" +).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getPendingSettlement().then(data => { + const d = data; // $Expect DisputeData +}); + +/* Events */ + +api.Events.getAll().then(data => { + const d = data; // $Expect EventData[] +}); + +/* Responses */ + +api.Responses.get().then(data => { + const d = data; // IGNORE-TEST $ExpectType any[] +}); + +/* Mandates */ + +api.Mandates.create({ + BankAccountId: "bank-account-id", + ReturnURL: "https://return-url.com", + Culture: "EN" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData +}); + +api.Mandates.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData[] +}); + +api.Mandates.get("mandate-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData +}); + +api.Mandates.cancel("mandate-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData +}); + +api.Mandates.getMandatesForUser("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData[] +}); + +api.Mandates.getMandatesForBankAccount("user-id", "bank-account-id").then( + data => { + const d = data; // IGNORE-TEST $ExpectType MandateData[] + } +); +api.Mandates.getTransactions("mandate-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* Hooks */ + +api.Hooks.create({ + Url: "https://hook-url.com", + EventType: "DISPUTE_ACTION_REQUIRED" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType HookData +}); + +api.Hooks.get("hook-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType HookData +}); + +api.Hooks.update({ Id: "hook-id", Url: "https://new-hook.com/hooks" }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType HookData + } +); + +api.Hooks.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType HookData[] +}); + +/* Reports */ + +api.Reports.create({ Columns: ["Alias", "AuthorId"] }).then(data => { + const d = data; // IGNORE-TEST $ExpectType ReportData +}); + +api.Reports.get("report-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType ReportData +}); + +api.Reports.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType ReportData[] +}); diff --git a/types/mangopay2-nodejs-sdk/tsconfig.json b/types/mangopay2-nodejs-sdk/tsconfig.json new file mode 100644 index 0000000000..5ff752d7e4 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noEmit": true, + "lib": ["es6"], + "noUnusedLocals": false, + "noUnusedParameters": false, + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "types": [], + "typeRoots": ["../"] + }, + + "files": ["index.d.ts", "types.d.ts", "mangopay2-nodejs-sdk-tests.ts"] +} diff --git a/types/mangopay2-nodejs-sdk/tslint.json b/types/mangopay2-nodejs-sdk/tslint.json new file mode 100644 index 0000000000..c31797feab --- /dev/null +++ b/types/mangopay2-nodejs-sdk/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-redundant-jsdoc": false, + "no-misused-new": false, + "no-empty-interface": false, + "interface-name": false, + "no-unnecessary-class": false + } +} diff --git a/types/mangopay2-nodejs-sdk/types.d.ts b/types/mangopay2-nodejs-sdk/types.d.ts new file mode 100644 index 0000000000..1edb7bd4f2 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/types.d.ts @@ -0,0 +1,565 @@ +/** + * Makes specified keys of an interface Optional. + */ +export type MakeKeysOptional = Omit & + Partial>; + +export type PickPartial = Pick, Par>; + +export type PickPartialRequired< + T, + Par extends keyof T, + Req extends keyof T +> = Pick, Par> & Pick, Req>; + +export type DeepPartial = { [P in keyof T]?: DeepPartial }; + +/** + * Makes specified keys of an interface nullable. + */ +export type MakeKeysNullable = Omit & + { [P in T2]: T1[P] | null }; + +/** + * Makes specified keys of an interface Required. + */ +export type MakeKeysRequired = Omit & + Required>; + +export type Omit = Pick>; + +export type OmitType = Omit; + +export type ValueOf = T[keyof T]; + +export type ApiMethod = + | "authentication_oauth" + | "responses_get" + | "events_all" + | "hooks_create" + | "hooks_all" + | "hooks_get" + | "hooks_save" + | "cardregistration_create" + | "cardregistration_get" + | "cardregistration_save" + | "preauthorization_create" + | "preauthorization_get" + | "preauthorization_save" + | "preauthorizations_get_for_user" + | "card_get" + | "cards_get_by_fingerprint" + | "card_save" + | "card_get_preauthorizations" + | "payins_card-web_create" + | "payins_card-direct_create" + | "payins_preauthorized-direct_create" + | "payins_bankwire-direct_create" + | "payins_directdebit-web_create" + | "payins_directdebit-direct_create" + | "payins_paypal-web_create" + | "payins_get" + | "payins_createrefunds" + | "payouts_bankwire_create" + | "payouts_get" + | "refunds_get" + | "refunds_get_for_repudiation" + | "refunds_get_for_transfer" + | "refunds_get_for_payin" + | "refunds_get_for_payout" + | "transfers_create" + | "transfers_get" + | "transfers_createrefunds" + | "users_createnaturals" + | "users_createlegals" + | "users_createbankaccounts_iban" + | "users_createbankaccounts_gb" + | "users_createbankaccounts_us" + | "users_createbankaccounts_ca" + | "users_createbankaccounts_other" + | "users_all" + | "users_allwallets" + | "users_allbankaccount" + | "users_allcards" + | "users_alltransactions" + | "users_allkycdocuments" + | "users_get" + | "users_getnaturals" + | "users_getlegals" + | "users_getbankaccount" + | "users_deactivate_bankaccount" + | "users_savenaturals" + | "users_savelegals" + | "users_getemoney" + | "wallets_create" + | "wallets_alltransactions" + | "wallets_get" + | "wallets_save" + | "kyc_documents_create" + | "kyc_documents_get" + | "kyc_documents_save" + | "kyc_page_create" + | "kyc_documents_all" + | "kyc_documents_get_alt" + | "kyc_documents_create_consult" + | "disputes_get" + | "disputes_save_tag" + | "disputes_save_contest_funds" + | "dispute_save_close" + | "disputes_get_transactions" + | "disputes_all" + | "disputes_get_for_wallet" + | "disputes_get_for_user" + | "disputes_document_create" + | "disputes_document_page_create" + | "disputes_document_save" + | "disputes_document_get" + | "disputes_document_get_for_dispute" + | "disputes_document_all" + | "disputes_document_create_consult" + | "disputes_repudiation_get" + | "disputes_repudiation_create_settlement" + | "disputes_repudiation_get_settlement" + | "disputes_pending_settlement" + | "reports_transaction_create" + | "reports_wallet_create" + | "reports_get" + | "reports_all" + | "mandates_directdebit-web_create" + | "mandates_get" + | "mandates_cancel" + | "mandates_all" + | "mandates_get_for_user" + | "mandates_get_for_bank_account" + | "clients_get" + | "clients_update" + | "clients_upload_logo" + | "client_wallets_all" + | "client_wallets_get" + | "client_wallets_by_fundsType" + | "client_wallets_transactions" + | "banking_aliases_iban_create" + | "banking_aliases_get" + | "banking_aliases_update" + | "banking_aliases_all" + | "ubo_declaration_create" + | "ubo_declaration_update" + | "ubo_declaration_get" + | "transactions_get_for_mandate" + | "transactions_get_for_card" + | "transactions_get_for_bank_account"; + +export type CountryISO = + | "AD" + | "AE" + | "AF" + | "AG" + | "AI" + | "AL" + | "AM" + | "AO" + | "AQ" + | "AR" + | "AS" + | "AT" + | "AU" + | "AW" + | "AX" + | "AZ" + | "BA" + | "BB" + | "BD" + | "BE" + | "BF" + | "BG" + | "BH" + | "BI" + | "BJ" + | "BL" + | "BM" + | "BN" + | "BO" + | "BQ" + | "BR" + | "BS" + | "BT" + | "BV" + | "BW" + | "BY" + | "BZ" + | "CA" + | "CC" + | "CD" + | "CF" + | "CG" + | "CH" + | "CI" + | "CK" + | "CL" + | "CM" + | "CN" + | "CO" + | "CR" + | "CU" + | "CV" + | "CW" + | "CX" + | "CY" + | "CZ" + | "DE" + | "DJ" + | "DK" + | "DM" + | "DO" + | "DZ" + | "EC" + | "EE" + | "EG" + | "EH" + | "ER" + | "ES" + | "ET" + | "FI" + | "FJ" + | "FK" + | "FM" + | "FO" + | "FR" + | "GA" + | "GB" + | "GD" + | "GE" + | "GF" + | "GG" + | "GH" + | "GI" + | "GL" + | "GM" + | "GN" + | "GP" + | "GQ" + | "GR" + | "GS" + | "GT" + | "GU" + | "GW" + | "GY" + | "HK" + | "HM" + | "HN" + | "HR" + | "HT" + | "HU" + | "ID" + | "IE" + | "IL" + | "IM" + | "IN" + | "IO" + | "IQ" + | "IR" + | "IS" + | "IT" + | "JE" + | "JM" + | "JO" + | "JP" + | "KE" + | "KG" + | "KH" + | "KI" + | "KM" + | "KN" + | "KP" + | "KR" + | "KW" + | "KY" + | "KZ" + | "LA" + | "LB" + | "LC" + | "LI" + | "LK" + | "LR" + | "LS" + | "LT" + | "LU" + | "LV" + | "LY" + | "MA" + | "MC" + | "MD" + | "ME" + | "MF" + | "MG" + | "MH" + | "MK" + | "ML" + | "MM" + | "MN" + | "MO" + | "MP" + | "MQ" + | "MR" + | "MS" + | "MT" + | "MU" + | "MV" + | "MW" + | "MX" + | "MY" + | "MZ" + | "NA" + | "NC" + | "NE" + | "NF" + | "NG" + | "NI" + | "NL" + | "NO" + | "NP" + | "NR" + | "NU" + | "NZ" + | "OM" + | "PA" + | "PE" + | "PF" + | "PG" + | "PH" + | "PK" + | "PL" + | "PM" + | "PN" + | "PR" + | "PS" + | "PT" + | "PW" + | "PY" + | "QA" + | "RE" + | "RO" + | "RS" + | "RU" + | "RW" + | "SA" + | "SB" + | "SC" + | "SD" + | "SE" + | "SG" + | "SH" + | "SI" + | "SJ" + | "SK" + | "SL" + | "SM" + | "SN" + | "SO" + | "SR" + | "SS" + | "ST" + | "SV" + | "SX" + | "SY" + | "SZ" + | "TC" + | "TD" + | "TF" + | "TG" + | "TH" + | "TJ" + | "TK" + | "TL" + | "TM" + | "TN" + | "TO" + | "TR" + | "TT" + | "TV" + | "TW" + | "TZ" + | "UA" + | "UG" + | "UM" + | "US" + | "UY" + | "UZ" + | "VA" + | "VC" + | "VE" + | "VG" + | "VI" + | "VN" + | "VU" + | "WF" + | "WS" + | "YE" + | "YT" + | "ZA" + | "ZM" + | "ZW"; + +export type CurrencyISO = + | "AED" + | "AFN" + | "ALL" + | "AMD" + | "ANG" + | "AOA" + | "ARS" + | "AUD" + | "AWG" + | "AZN" + | "BAM" + | "BBD" + | "BDT" + | "BGN" + | "BHD" + | "BIF" + | "BMD" + | "BND" + | "BOB" + | "BRL" + | "BSD" + | "BTN" + | "BWP" + | "BYN" + | "BZD" + | "CAD" + | "CDF" + | "CHF" + | "CLP" + | "CNY" + | "COP" + | "CRC" + | "CUC" + | "CUP" + | "CVE" + | "CZK" + | "DJF" + | "DKK" + | "DOP" + | "DZD" + | "EGP" + | "ERN" + | "ETB" + | "EUR" + | "FJD" + | "FKP" + | "GBP" + | "GEL" + | "GGP" + | "GHS" + | "GIP" + | "GMD" + | "GNF" + | "GTQ" + | "GYD" + | "HKD" + | "HNL" + | "HRK" + | "HTG" + | "HUF" + | "IDR" + | "ILS" + | "IMP" + | "INR" + | "IQD" + | "IRR" + | "ISK" + | "JEP" + | "JMD" + | "JOD" + | "JPY" + | "KES" + | "KGS" + | "KHR" + | "KMF" + | "KPW" + | "KRW" + | "KWD" + | "KYD" + | "KZT" + | "LAK" + | "LBP" + | "LKR" + | "LRD" + | "LSL" + | "LYD" + | "MAD" + | "MDL" + | "MGA" + | "MKD" + | "MMK" + | "MNT" + | "MOP" + | "MRU" + | "MUR" + | "MVR" + | "MWK" + | "MXN" + | "MYR" + | "MZN" + | "NAD" + | "NGN" + | "NIO" + | "NOK" + | "NPR" + | "NZD" + | "OMR" + | "PAB" + | "PEN" + | "PGK" + | "PHP" + | "PKR" + | "PLN" + | "PYG" + | "QAR" + | "RON" + | "RSD" + | "RUB" + | "RWF" + | "SAR" + | "SBD" + | "SCR" + | "SDG" + | "SEK" + | "SGD" + | "SHP" + | "SLL" + | "SOS" + | "SPL" + | "SRD" + | "STN" + | "SVC" + | "SYP" + | "SZL" + | "THB" + | "TJS" + | "TMT" + | "TND" + | "TOP" + | "TRY" + | "TTD" + | "TVD" + | "TWD" + | "TZS" + | "UAH" + | "UGX" + | "USD" + | "UYU" + | "UZS" + | "VEF" + | "VND" + | "VUV" + | "WST" + | "XAF" + | "XCD" + | "XDR" + | "XOF" + | "XPF" + | "YER" + | "ZAR" + | "ZMW" + | "ZWD"; From 126b99450879ee56bfb3cb49e61cf084a8a951ba Mon Sep 17 00:00:00 2001 From: bangbang93 Date: Fri, 11 Jan 2019 10:06:09 +0800 Subject: [PATCH 279/646] init types for memorystream --- types/memorystream/index.d.ts | 25 ++++++++++++++++++++++++ types/memorystream/memorystream-tests.ts | 8 ++++++++ types/memorystream/tsconfig.json | 22 +++++++++++++++++++++ types/memorystream/tslint.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 types/memorystream/index.d.ts create mode 100644 types/memorystream/memorystream-tests.ts create mode 100644 types/memorystream/tsconfig.json create mode 100644 types/memorystream/tslint.json diff --git a/types/memorystream/index.d.ts b/types/memorystream/index.d.ts new file mode 100644 index 0000000000..444f7412bb --- /dev/null +++ b/types/memorystream/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for memorystream 0.3 +// Project: https://github.com/JSBizon/node-memorystream +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Stream, Duplex } from "stream"; + +type DataType = string | Buffer | Stream; + +interface IOptions { + readable: boolean; + writeable: boolean; + maxbufsize: number; + bufoverflow: number; + frequence: number; +} + +declare class MemoryStream extends Duplex { + constructor( + data?: DataType | DataType[], + options?: IOptions, + ); +} + +export = MemoryStream; \ No newline at end of file diff --git a/types/memorystream/memorystream-tests.ts b/types/memorystream/memorystream-tests.ts new file mode 100644 index 0000000000..728e032d88 --- /dev/null +++ b/types/memorystream/memorystream-tests.ts @@ -0,0 +1,8 @@ +import MemoryStream = require('memorystream'); +import { createReadStream } from 'fs'; + +const ms = new MemoryStream(); + +createReadStream('index.ts').pipe(ms); +ms.pipe(process.stdout); +ms.write('it works'); diff --git a/types/memorystream/tsconfig.json b/types/memorystream/tsconfig.json new file mode 100644 index 0000000000..4971985966 --- /dev/null +++ b/types/memorystream/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": ["node"], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "memorystream-tests.ts" + ] +} diff --git a/types/memorystream/tslint.json b/types/memorystream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/memorystream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 0d8be3243784c8a450227c9a23cd505d469dc6f6 Mon Sep 17 00:00:00 2001 From: bangbang93 Date: Fri, 11 Jan 2019 10:14:44 +0800 Subject: [PATCH 280/646] lint --- types/memorystream/index.d.ts | 7 ++++--- types/memorystream/tsconfig.json | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/types/memorystream/index.d.ts b/types/memorystream/index.d.ts index 444f7412bb..aa6e0a934e 100644 --- a/types/memorystream/index.d.ts +++ b/types/memorystream/index.d.ts @@ -2,12 +2,13 @@ // Project: https://github.com/JSBizon/node-memorystream // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// import { Stream, Duplex } from "stream"; type DataType = string | Buffer | Stream; -interface IOptions { +interface Options { readable: boolean; writeable: boolean; maxbufsize: number; @@ -18,8 +19,8 @@ interface IOptions { declare class MemoryStream extends Duplex { constructor( data?: DataType | DataType[], - options?: IOptions, + options?: Options, ); } -export = MemoryStream; \ No newline at end of file +export = MemoryStream; diff --git a/types/memorystream/tsconfig.json b/types/memorystream/tsconfig.json index 4971985966..200326520a 100644 --- a/types/memorystream/tsconfig.json +++ b/types/memorystream/tsconfig.json @@ -7,11 +7,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], - "types": ["node"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From 8728870abf667a33c2846eb31be6a98b5c3e1a05 Mon Sep 17 00:00:00 2001 From: wayne-rebl <46360489+wayne-rebl@users.noreply.github.com> Date: Fri, 11 Jan 2019 12:21:15 +1000 Subject: [PATCH 281/646] Fix capitalisation of ExtractJwt --- types/feathersjs__authentication-jwt/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/feathersjs__authentication-jwt/index.d.ts b/types/feathersjs__authentication-jwt/index.d.ts index 7a555071d9..d78a23c643 100644 --- a/types/feathersjs__authentication-jwt/index.d.ts +++ b/types/feathersjs__authentication-jwt/index.d.ts @@ -54,7 +54,7 @@ export class Verifier { export type JwtFromRequestFunction = (req: Request) => string; -export const ExtractJWT: { +export const ExtractJwt: { fromHeader(header_name: string): JwtFromRequestFunction; fromBodyField(field_name: string): JwtFromRequestFunction; fromUrlQueryParameter(param_name: string): JwtFromRequestFunction; From 0d53a4bb7e01195c63d4acd052dfc27419e4cf45 Mon Sep 17 00:00:00 2001 From: Kallu609 Date: Fri, 11 Jan 2019 04:24:10 +0200 Subject: [PATCH 282/646] added types for js-levenshtein --- types/js-levenshtein/index.d.ts | 12 ++++++++++++ types/js-levenshtein/js-levenshtein-tests.ts | 9 +++++++++ types/js-levenshtein/tsconfig.json | 16 ++++++++++++++++ types/js-levenshtein/tslint.json | 1 + 4 files changed, 38 insertions(+) create mode 100644 types/js-levenshtein/index.d.ts create mode 100644 types/js-levenshtein/js-levenshtein-tests.ts create mode 100644 types/js-levenshtein/tsconfig.json create mode 100644 types/js-levenshtein/tslint.json diff --git a/types/js-levenshtein/index.d.ts b/types/js-levenshtein/index.d.ts new file mode 100644 index 0000000000..266b4eacf7 --- /dev/null +++ b/types/js-levenshtein/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for js-levenshtein 1.1.6 +// Project: https://github.com/gustf/js-levenshtein +// Definitions by: Kallu609 +// Pyry Rouvila +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Calculates Levenshtein distance between two strings + */ +declare function levenshtein(compareFrom: string, compareTo: string): number; + +export default levenshtein; diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts new file mode 100644 index 0000000000..1c4c879cfe --- /dev/null +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -0,0 +1,9 @@ +// Type definitions for js-levenshtein 1.1.6 +// Project: https://github.com/gustf/js-levenshtein +// Definitions by: Kallu609 +// Pyry Rouvila +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import levenshtein from 'js-levenshtein'; + +levenshtein('kittens', 'mittens'); // $ExpectType number \ No newline at end of file diff --git a/types/js-levenshtein/tsconfig.json b/types/js-levenshtein/tsconfig.json new file mode 100644 index 0000000000..6df128481b --- /dev/null +++ b/types/js-levenshtein/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "js-levenshtein-tests.ts"] +} diff --git a/types/js-levenshtein/tslint.json b/types/js-levenshtein/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-levenshtein/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f27f046ce9984270aace3937d3d92e88b43685df Mon Sep 17 00:00:00 2001 From: Frank Chiang Date: Thu, 10 Jan 2019 21:28:05 -0500 Subject: [PATCH 283/646] Add types for jsonapi-serializer https://github.com/SeyZ/jsonapi-serializer/issues/136 --- types/jsonapi-serializer/index.d.ts | 111 ++++++++++++++++++ .../jsonapi-serializer-tests.ts | 37 ++++++ types/jsonapi-serializer/tsconfig.json | 16 +++ types/jsonapi-serializer/tslint.json | 1 + 4 files changed, 165 insertions(+) create mode 100644 types/jsonapi-serializer/index.d.ts create mode 100644 types/jsonapi-serializer/jsonapi-serializer-tests.ts create mode 100644 types/jsonapi-serializer/tsconfig.json create mode 100644 types/jsonapi-serializer/tslint.json diff --git a/types/jsonapi-serializer/index.d.ts b/types/jsonapi-serializer/index.d.ts new file mode 100644 index 0000000000..a284581a06 --- /dev/null +++ b/types/jsonapi-serializer/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for jsonapi-serializer 3.6 +// Project: https://github.com/SeyZ/jsonapi-serializer#readme +// Definitions by: Frank Chiang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +export type RefFunction = (current: any, item: any) => string; + +export interface Relation { + ref: string | RefFunction; + attributes?: string[]; + included?: boolean; +} + +export interface SerializerOptions { + ref?: (() => void) | boolean | string; + included?: boolean; + id?: string; + attributes?: string[]; + topLevelLinks?: string[] | Array<() => void>; + dataLinks?: string[] | Array<() => void>; + dataMeta?: (() => void) | object; + relationshipLinks?: object; + relationshipMeta?: object; + ignoreRelationshipData?: boolean; + keyForAttribute?: string | KeyForAttribute; + nullIfMissing?: boolean; + pluralizeType?: boolean; + typeForAttribute?: TypeForAttribute; + meta?: object; + transform?: (() => void); +} + +export interface KeyForAttribute { + (attribute: string): string; +} + +export interface TypeForAttribute { + (attribute: string, object?: any): any; +} + +export interface Transform { + (record: any): any; +} + +export interface DeserializerOptions { + id?: string; + keyForAttribute?: + | "dash-case" + | "lisp-case" + | "spinal-case" + | "kebab-case" + | "underscore_case" + | "snake_case" + | "camelCase" + | "CamelCase"; + pluralizeType?: boolean; + typeAsAttribute?: boolean; + transform?: Transform; +} + +export interface DeserializerConstructor { + new (opts: DeserializerOptions): Deserializer; +} + +export interface SerializerConstructor { + new (collectionName: string, opts: SerializerOptions): Serializer; +} + +export interface ErrorConstructor { + new (opts: JSONAPIErrorOptions | JSONAPIErrorOptions[]): JSONAPIError; +} + +export interface JSONAPIError { + errors: any[]; +} + +export interface JSONAPIErrorOptions { + id?: string; + status?: string; + code?: string; + title?: string; + detail?: string; + source?: { + pointer?: string; + parameter?: string; + }; + links?: { + about?: string; + }; + meta?: any; +} + +export interface Serializer { + serialize(data: any): any; +} + +export interface Deserializer { + deserialize(data: any, callback: Callback): void; + + deserialize(data: any): Promise; +} + +export interface Callback { + (error: Error, response: any): any; +} + +export let Serializer: SerializerConstructor; +export let Deserializer: DeserializerConstructor; +export let JSONAPIError: ErrorConstructor; diff --git a/types/jsonapi-serializer/jsonapi-serializer-tests.ts b/types/jsonapi-serializer/jsonapi-serializer-tests.ts new file mode 100644 index 0000000000..11aae0632c --- /dev/null +++ b/types/jsonapi-serializer/jsonapi-serializer-tests.ts @@ -0,0 +1,37 @@ +import { Serializer, Deserializer, JSONAPIError } from "jsonapi-serializer"; + +declare let firstName: string; +declare let lastName: string; + +const UserSerializer = new Serializer("users", { + id: "id", + attributes: ["firstName", "lastName"], + keyForAttribute: "camelCase", + pluralizeType: false +}); + +const users = UserSerializer.serialize({ firstName, lastName }); + +const UserDeserializer = new Deserializer({ + id: "id", + keyForAttribute: "camelCase", + pluralizeType: false, + typeAsAttribute: true +}); + +UserDeserializer.deserialize(users); + +new JSONAPIError({ + code: "_code", + detail: "_detail", + id: "_id", + links: { + about: "_about" + }, + source: { + parameter: "_parameter", + pointer: "_pointer" + }, + status: "_status", + title: "_title" +}); diff --git a/types/jsonapi-serializer/tsconfig.json b/types/jsonapi-serializer/tsconfig.json new file mode 100644 index 0000000000..eeea88010a --- /dev/null +++ b/types/jsonapi-serializer/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "jsonapi-serializer-tests.ts"] +} diff --git a/types/jsonapi-serializer/tslint.json b/types/jsonapi-serializer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonapi-serializer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 27885387e26798868452ecd36b6f61fffb98e8f0 Mon Sep 17 00:00:00 2001 From: Kalle Date: Fri, 11 Jan 2019 04:35:03 +0200 Subject: [PATCH 284/646] Update index.d.ts --- types/js-levenshtein/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/js-levenshtein/index.d.ts b/types/js-levenshtein/index.d.ts index 266b4eacf7..f1703617c9 100644 --- a/types/js-levenshtein/index.d.ts +++ b/types/js-levenshtein/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for js-levenshtein 1.1.6 +// Type definitions for js-levenshtein 1.1 // Project: https://github.com/gustf/js-levenshtein // Definitions by: Kallu609 // Pyry Rouvila From 1fdf4396056909d0ce6da17b187833ffa197b3eb Mon Sep 17 00:00:00 2001 From: Kalle Date: Fri, 11 Jan 2019 04:35:12 +0200 Subject: [PATCH 285/646] Update js-levenshtein-tests.ts --- types/js-levenshtein/js-levenshtein-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts index 1c4c879cfe..034b98d1ac 100644 --- a/types/js-levenshtein/js-levenshtein-tests.ts +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -1,4 +1,4 @@ -// Type definitions for js-levenshtein 1.1.6 +// Type definitions for js-levenshtein 1.1 // Project: https://github.com/gustf/js-levenshtein // Definitions by: Kallu609 // Pyry Rouvila @@ -6,4 +6,4 @@ import levenshtein from 'js-levenshtein'; -levenshtein('kittens', 'mittens'); // $ExpectType number \ No newline at end of file +levenshtein('kittens', 'mittens'); // $ExpectType number From b664908732ee6fb91e2c94bba9329dbc70e46fbb Mon Sep 17 00:00:00 2001 From: Kalle Date: Fri, 11 Jan 2019 04:41:00 +0200 Subject: [PATCH 286/646] Update js-levenshtein-tests.ts --- types/js-levenshtein/js-levenshtein-tests.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts index 034b98d1ac..062114c90a 100644 --- a/types/js-levenshtein/js-levenshtein-tests.ts +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -1,9 +1,3 @@ -// Type definitions for js-levenshtein 1.1 -// Project: https://github.com/gustf/js-levenshtein -// Definitions by: Kallu609 -// Pyry Rouvila -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - import levenshtein from 'js-levenshtein'; levenshtein('kittens', 'mittens'); // $ExpectType number From d7188eb6dc11d6cd23485d6538bb3184ea4542ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Fri, 11 Jan 2019 14:54:36 +0800 Subject: [PATCH 287/646] imageUrl -> imgUrl --- types/wx-js-sdk-dt/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index 46da21d0df..6283caae62 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -159,7 +159,7 @@ declare namespace wx { /** * 分享图标 */ - imageUrl?: string; + imgUrl?: string; success?: () => void; } @@ -713,4 +713,4 @@ declare namespace wx { * 发起一个微信支付请求 */ function chooseWXPay(config: ChooseWXPayConfig): void; -} + } From 5743f0981f90e0f6afc45206e47188f9822c6bd7 Mon Sep 17 00:00:00 2001 From: bocai Date: Tue, 1 Jan 2019 23:26:42 +0800 Subject: [PATCH 288/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UpdateManager?= =?UTF-8?q?=E3=80=81onLaunch=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/weapp-api-tests.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 82a5b8d91d..e13f3766d5 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -347,6 +347,30 @@ wx.getSystemInfo({ } }) +const updateManager = wx.getUpdateManager() + +// updateManager.onCheckForUpdate(function (res) { +// //请求完新版本信息的回调 +// console.log(res.hasUpdate) +// }) + +updateManager.onUpdateReady(function () { + // wx.showModal({ + // title: '更新提示', + // content: '新版本已经准备好,是否重启应用?', + // success(res) { + // if (res.confirm) { + // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + // updateManager.applyUpdate() + // } + // } + // }) +}) + +updateManager.onUpdateFailed(function () { + // 新版本下载失败 +}) + wx.onAccelerometerChange(function(res) { console.log(res.x) console.log(res.y) @@ -673,3 +697,9 @@ wx.requestPayment({ 'fail':function(res){ } }) + +App({ + onLaunch(options){ + console.log(options.query) + } +}) From 9bc6e211c32b6b545b997d1b9329fc9c46eef33b Mon Sep 17 00:00:00 2001 From: bocai Date: Tue, 1 Jan 2019 23:28:51 +0800 Subject: [PATCH 289/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UpdateManager?= =?UTF-8?q?=E3=80=81onLaunch=E7=9B=B8=E5=85=B3=E5=A3=B0=E6=98=8E=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E4=BD=BF=E7=94=A8type=20aliases/interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 51 +++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index f22ed51765..c3b85a658a 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -37,12 +37,33 @@ declare namespace wx { [key: string]: any; } + interface referrerInfo { + /** 来源小程序、公众号或 App 的 appId */ + appId: string, + /** 来源小程序传过来的数据,scene=1037或1038时支持 */ + extraData: Object + } + + interface LaunchOptions { + /** 启动小程序的路径 */ + path: string, + /** 启动小程序的场景值 */ + scene: number, + /** 启动小程序的query参数 */ + query: Object, + shareTicket: string, + /** 来源信息。从另一个小程序、公众号或App进入小程序时返回。范泽返回{} */ + referrerInfo: referrerInfo + } + + type LaunchCallback = (options: LaunchOptions) => void; + interface AppOptions { /** * 生命周期函数--监听小程序初始化 * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) */ - onLaunch?: NoneParamCallback; + onLaunch?: LaunchCallback; /** * 生命周期函数--监听小程序显示 * 当小程序启动,或从后台进入前台显示,会触发 onShow @@ -561,6 +582,34 @@ declare namespace wx { */ function getSystemInfo(options: GetSystemInfoOptions): void; + interface UpdateManager { + /** + * 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 onUpdateReady 回调)调用。 + */ + applyUpdate(callback: DataResponseCallback): void; + /** + * 监听向微信后台请求检查更新结果事件。微信在小程序冷启动时自动检查更新,不需由开发者主动触发。 + */ + onCheckForUpdate(): void; + /** + * 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调 + */ + onUpdateReady(callback: NoneParamCallback): void; + /** + * 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调 + */ + onUpdateFailed(callback: NoneParamCallback): void; + } + /** + * 获取全局唯一的版本更新管理器,用于管理小程序更新。关于小程序的更新机制,可以查看运行机制文档。 + */ + function getUpdateManager(): UpdateManager; + + /** + * 获取小程序启动时的参数。与 App.onLaunch 的回调参数一致。 + */ + function getLaunchOptionsSync(): LaunchCallback; + interface AccelerometerData { /** X 轴 */ x: number; From 61183f975936a28e45b46585a5784548f0240419 Mon Sep 17 00:00:00 2001 From: bocai Date: Wed, 2 Jan 2019 01:40:37 +0800 Subject: [PATCH 290/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=BA=A7=E4=BA=8B=E4=BB=B6=E3=80=81=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E3=80=81=E8=B7=AF=E7=94=B1=E3=80=81=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 131 +++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 5 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index c3b85a658a..0e06bd8357 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: vargeek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import functions from "../react-icons/md/functions"; + declare namespace wx { type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; @@ -44,7 +46,7 @@ declare namespace wx { extraData: Object } - interface LaunchOptions { + interface onLaunchOptions { /** 启动小程序的路径 */ path: string, /** 启动小程序的场景值 */ @@ -56,24 +58,34 @@ declare namespace wx { referrerInfo: referrerInfo } - type LaunchCallback = (options: LaunchOptions) => void; + type onLaunchCallback = (options: onLaunchOptions) => void; + type onShowOptions = onLaunchOptions; interface AppOptions { /** * 生命周期函数--监听小程序初始化 * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) */ - onLaunch?: LaunchCallback; + onLaunch?: onLaunchCallback; /** * 生命周期函数--监听小程序显示 * 当小程序启动,或从后台进入前台显示,会触发 onShow */ - onShow?: NoneParamCallback; + onShow?: (options: onShowOptions) => void; /** * 生命周期函数--监听小程序隐藏 * 当小程序从前台进入后台,会触发 onHide */ onHide?: NoneParamCallback; + /** 小程序发生脚本错误或 API 调用报错时触发。也可以使用 wx.onError 绑定监听。*/ + onError?: ErrorCallback; + /** + * 小程序要打开的页面不存在时触发 + * 1. 开发者可以在回调中进行页面重定向,但必须在回调中同步处理,异步处理(例如 setTimeout 异步执行)无效。 + * 2. 若开发者没有调用 wx.onPageNotFound 绑定监听,也没有声明 App.onPageNotFound,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。 + * 3. 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。 + */ + onPageNotFound?: NoneParamCallback; [key: string]: any } @@ -608,7 +620,87 @@ declare namespace wx { /** * 获取小程序启动时的参数。与 App.onLaunch 的回调参数一致。 */ - function getLaunchOptionsSync(): LaunchCallback; + function getLaunchOptionsSync(): onLaunchCallback; + + // 应用级事件 + /** + * 取消监听小程序要打开的页面不存在事件 + */ + function offPageNotFound(): NoneParamCallback; + /** + * 监听小程序要打开的页面不存在事件。该事件与 App.onPageNotFound 的回调时机一致。 + */ + function onPageNotFound(): NoneParamCallback; + /** + * 取消监听小程序错误事件。 + */ + function offError(): NoneParamCallback; + /** + * 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 App.onError 的回调时机与参数一致。 + */ + function onError(): ErrorCallback; + /** + * 取消监听小程序切前台事件 + */ + function offAppShow(): NoneParamCallback; + /** + * 监听小程序切前台事件。该事件与 App.onShow 的回调参数一致。 + * @param callback + */ + function onAppShow(callback: onShowOptions): void; + /** + * 取消监听小程序切后台事件 + */ + function offAppHide(): NoneParamCallback; + /** + * 监听小程序切后台事件。该事件与 App.onHide 的回调时机一致。 + */ + function onAppHide(): NoneParamCallback; + + // 调试 TODO + + // 路由 + interface routerOptions { + + } + /** + * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。 + */ + function navigateBack(): void; + function switchTab(): void; + function navigateTo(): void; + function reLaunch(): void; + function redirectTo(): void; + + // 界面 + // 交互 + // tapIndex为用户点击的按钮序号,从上到下的顺序,从0开始 + type ActionSheetSuccessCallback = (res: {tapIndex: number}) => void; + + interface ActionSheetOptions { + // 必填,按钮的文字数组,数组长度最大为 6 + itemList: Array; + // 按钮的文字颜色 + itemColor?: string; + success?: ActionSheetSuccessCallback; + fail?: ResponseCallback; + complete?: ResponseCallback; + } + /** + * 显示操作菜单 + */ + function showActionSheet(options: ActionSheetOptions): void; + function hideLoading(): void; + function showLoading(): void; + function hideToast(): void; + function showToast(): void; + function showModal(): void; + + // 导航栏 + function setNavigationBarColor(): void; + function hideNavigationBarLoading(): void; + function showNavigationBarLoading(): void; + function setNavigationBarTitle(): void; interface AccelerometerData { /** X 轴 */ @@ -1182,3 +1274,32 @@ declare var App: AppConstructor; * 我们提供了全局的 getApp() 函数,可以获取到小程序实例。 */ declare function getApp(): App; + +// 定时器 +/** + * 设定一个定时器。在定时到期以后执行注册的回调函数 + * @param callback + * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 + * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 + */ +declare function setTimeout(callback: functions, delay: number, rest: any): number; + +/** + * 取消由 setTimeout 设置的定时器。 + * @param timeoutID 要取消的定时器的ID + */ +declare function clearTimeout(timeoutID: number): number; + +/** + * 设定一个定时器。按照指定的周期(以毫秒计)来执行注册的回调函数 + * @param callback + * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 + * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 + */ +declare function setInterval(callback: functions, delay: number, rest: any): number; + +/** + * 取消由 setInterval 设置的定时器。 + * @param timeoutID 要取消的定时器的ID + */ +declare function clearInterval(timeoutID: number): number; From 85bcca8a6de4c92368ea1072a38f81414f758af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Wed, 2 Jan 2019 21:45:48 +0800 Subject: [PATCH 291/646] modify --- types/weapp-api/index.d.ts | 67 +++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0e06bd8357..fa328782ca 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -686,15 +686,72 @@ declare namespace wx { fail?: ResponseCallback; complete?: ResponseCallback; } + + interface CommonCallbackOptions { + success?: ResponseCallback; + fail?: ResponseCallback; + complete?: ResponseCallback; + } + + interface LoadingOptions extends CommonCallbackOptions{ + // must,提示的内容 + title: string; + // 默认false。是否显示透明蒙层,防止触摸穿透 + mask: boolean; + } + + type icon = 'success' | 'loading' | 'none'; + interface ToastOptions extends CommonCallbackOptions{ + // 提示的内容 + title: string; + // 图标,默认值'success' + icon?: icon; + // 自定义图标的本地路径,image 的优先级高于 icon + imgage?: string; + // 提示的延迟时间,默认值1500ms + duration?: number; + // 是否显示透明蒙层,防止触摸穿透,默认值false + mask: boolean; + } + + interface ModalOptions extends CommonCallbackOptions{ + // 提示的内容 + title: string; + // 提示的内容 + content: string; + // 是否显示取消按钮,默认值true + showCancel?: boolean; + // 取消按钮的文字,最多 4 个字符,默认值'取消' + cancelText?: string; + // 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串,默认值'#000000' + cancelColor?: string; + // 确认按钮的文字,最多 4 个字符 + confirmText?: string; + // 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串,默认值'#3cc51f' + confirmColor?: boolean; + } /** * 显示操作菜单 */ function showActionSheet(options: ActionSheetOptions): void; - function hideLoading(): void; - function showLoading(): void; - function hideToast(): void; - function showToast(): void; - function showModal(): void; + /** + * 隐藏 loading 提示框 + * @param options + */ + function hideLoading(options?: CommonCallbackOptions): void; + /** + * 显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框 + * @param options + */ + function showLoading(options: LoadingOptions): void; + function hideToast(options?: CommonCallbackOptions): void; + function showToast(options: ToastOptions): void; + + /** + * 显示模态对话框 + * @param options + */ + function showModal(options: ModalOptions): void; // 导航栏 function setNavigationBarColor(): void; From 6e980110df756f9a609aa9aac36fbe7359e0f998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 21:12:02 +0800 Subject: [PATCH 292/646] =?UTF-8?q?weapp-api,=E5=A2=9E=E5=8A=A0=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E9=83=A8=E5=88=86=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 51 ++++++++++++++++++++-- types/weapp-api/tsconfig.json | 5 ++- types/weapp-api/weapp-api-tests.ts | 69 +++++++++++++++--------------- 3 files changed, 84 insertions(+), 41 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index fa328782ca..fec6f90f14 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -687,6 +687,9 @@ declare namespace wx { complete?: ResponseCallback; } + /** + * 公共回调函数 + */ interface CommonCallbackOptions { success?: ResponseCallback; fail?: ResponseCallback; @@ -744,20 +747,60 @@ declare namespace wx { * @param options */ function showLoading(options: LoadingOptions): void; + /** + * 隐藏消息提示框 + * @param options + */ function hideToast(options?: CommonCallbackOptions): void; + /** + * 显示消息提示框 + * @param options + */ function showToast(options: ToastOptions): void; - /** * 显示模态对话框 * @param options */ function showModal(options: ModalOptions): void; + + interface NavigationBarColorAnimationOptions { + // 动画变化时间,单位 ms,默认0 + animation?: number; + // 动画变化方式.动画从头到尾的速度是相同的,动画以低速开始,动画以低速结束,动画以低速开始和结束 + timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' + } + interface NavigationBarColorOptions extends CommonCallbackOptions{ + // 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 + frontColor: string; + // 背景颜色值,有效值为十六进制颜色 + backgroundColor: string; + // 动画效果 + animation: NavigationBarColorAnimationOptions; + } + interface NavigationBarTitleOptions extends CommonCallbackOptions{ + // 动态设置当前页面的标题 + title: string; + } // 导航栏 function setNavigationBarColor(): void; - function hideNavigationBarLoading(): void; - function showNavigationBarLoading(): void; - function setNavigationBarTitle(): void; + /** + * 在当前页面隐藏导航条加载动画 + */ + function hideNavigationBarLoading(options?: CommonCallbackOptions): void; + /** + * 在当前页面显示导航条加载动画 + */ + function showNavigationBarLoading(options: CommonCallbackOptions): void; + /** + * 动态设置当前页面的标题 + * @param options + */ + function setNavigationBarTitle(options: NavigationBarTitleOptions): void; + + // 背景 + function setBackgroundTextStyle(): void; + function setBackgroundColor(): void; interface AccelerometerData { /** X 轴 */ diff --git a/types/weapp-api/tsconfig.json b/types/weapp-api/tsconfig.json index ef43ffab75..74812f3d05 100644 --- a/types/weapp-api/tsconfig.json +++ b/types/weapp-api/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "weapp-api-tests.ts" + "weapp-api-tests.ts", + "../baidu-app/index.d.ts" ] -} \ No newline at end of file +} diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index e13f3766d5..4363179c80 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -14,7 +14,7 @@ App({ wx.login({ success: function () { wx.getUserInfo({ - success: function (res) { + success: function (res: any) { that.globalData.userInfo = res.userInfo; typeof cb == "function" && cb(that.globalData.userInfo) } @@ -37,7 +37,6 @@ Page({ foo: 'bar' }, onLoad: function (options) { - console.log(options.title); } }) @@ -51,13 +50,13 @@ wx.request({ header: { 'Content-Type': 'application/json' }, - success: function (res) { + success: function (res: any) { console.log(res.data) } }) wx.chooseImage({ - success: function (res) { + success: function (res: any) { var tempFilePaths = res.tempFilePaths wx.uploadFile({ url: 'http://example.com/upload', @@ -73,7 +72,7 @@ wx.chooseImage({ wx.downloadFile({ url: 'http://example.com/audio/123', type: 'audio', - success: function (res) { + success: function (res: any) { wx.playVoice({ filePath: res.tempFilePath }) @@ -95,17 +94,17 @@ wx.connectSocket({ wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { console.log('WebSocket连接已打开!') }) wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { console.log('WebSocket连接已打开!') }) -wx.onSocketError(function (res) { +wx.onSocketError(function (res: any) { console.log('WebSocket连接打开失败,请检查!') }) @@ -115,7 +114,7 @@ wx.connectSocket({ url: 'test.php' }) -wx.onSocketOpen(function (res) { +wx.onSocketOpen(function (res: any) { socketOpen = true for (var i = 0; i < socketMsgQueue.length; i++) { sendSocketMessage(socketMsgQueue[i]) @@ -137,7 +136,7 @@ wx.connectSocket({ url: 'test.php' }) -wx.onSocketMessage(function (res) { +wx.onSocketMessage(function (res: any) { console.log('收到服务器内容:' + res.data) }) @@ -152,7 +151,7 @@ wx.onSocketOpen(function () { wx.closeSocket() }) -wx.onSocketClose(function (res) { +wx.onSocketClose(function (res: any) { console.log('WebSocket 已关闭!') }) @@ -160,7 +159,7 @@ wx.chooseImage({ count: 1, // 默认9 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { + success: function (res: any) { // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 var tempFilePaths = res.tempFilePaths } @@ -172,10 +171,10 @@ wx.previewImage({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath }, - fail: function (res) { + fail: function (res: any) { //录音失败 } }) @@ -185,7 +184,7 @@ setTimeout(function () { }, 10000) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath, @@ -196,7 +195,7 @@ wx.startRecord({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath @@ -210,7 +209,7 @@ wx.startRecord({ }) wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath @@ -223,7 +222,7 @@ wx.startRecord({ }) wx.getBackgroundAudioPlayerState({ - success: function (res) { + success: function (res: any) { var status = res.status var dataUrl = res.dataUrl var currentPosition = res.currentPosition @@ -246,11 +245,11 @@ wx.seekBackgroundAudio({ wx.stopBackgroundAudio() wx.startRecord({ - success: function (res) { + success: function (res: any) { var tempFilePath = res.tempFilePath wx.saveFile({ tempFilePath: tempFilePath, - success: function (res) { + success: function (res: any) { var savedFilePath = res.savedFilePath } }) @@ -265,7 +264,7 @@ Page({ sourceType: ['album', 'camera'], maxDuration: 60, camera: ['front', 'back'], - success: function (res) { + success: function (res: any) { that.setData({ src: res.tempFilePath }) @@ -286,7 +285,7 @@ try { wx.getStorage({ key: 'key', - success: function (res) { + success: function (res: any) { console.log(res.data) } }) @@ -309,7 +308,7 @@ try { wx.getLocation({ type: 'wgs84', - success: function (res) { + success: function (res: any) { var latitude = res.latitude var longitude = res.longitude var speed = res.speed @@ -319,7 +318,7 @@ wx.getLocation({ wx.getLocation({ type: 'gcj02', //返回可以用于wx.openLocation的经纬度 - success: function(res) { + success: function(res: any) { var latitude = res.latitude var longitude = res.longitude wx.openLocation({ @@ -331,13 +330,13 @@ wx.getLocation({ }) wx.getNetworkType({ - success: function(res) { + success: function(res: any) { var networkType = res.networkType // 返回网络类型2g,3g,4g,wifi } }) wx.getSystemInfo({ - success: function(res) { + success: function(res: any) { console.log(res.model) console.log(res.pixelRatio) console.log(res.windowWidth) @@ -349,7 +348,7 @@ wx.getSystemInfo({ const updateManager = wx.getUpdateManager() -// updateManager.onCheckForUpdate(function (res) { +// updateManager.onCheckForUpdate(function (res: any) { // //请求完新版本信息的回调 // console.log(res.hasUpdate) // }) @@ -358,7 +357,7 @@ updateManager.onUpdateReady(function () { // wx.showModal({ // title: '更新提示', // content: '新版本已经准备好,是否重启应用?', - // success(res) { + // success(res: any) { // if (res.confirm) { // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // updateManager.applyUpdate() @@ -371,13 +370,13 @@ updateManager.onUpdateFailed(function () { // 新版本下载失败 }) -wx.onAccelerometerChange(function(res) { +wx.onAccelerometerChange(function(res: any) { console.log(res.x) console.log(res.y) console.log(res.z) }) -wx.onCompassChange(function (res) { +wx.onCompassChange(function (res: any) { console.log(res.direction) }) @@ -543,7 +542,7 @@ Page({ onReady: function() { var context = wx.createContext() wx.chooseImage({ - success: function(res) { + success: function(res: any) { context.drawImage(res.tempFilePaths[0], 0, 0) wx.drawCanvas({ canvasId: 1, @@ -656,7 +655,7 @@ Page({ App({ onLaunch: function() { wx.login({ - success: function(res) { + success: function(res: any) { if (res.code) { //发起网络请求 wx.request({ @@ -675,7 +674,7 @@ App({ wx.getUserInfo({ - success: function(res) { + success: function(res: any) { var userInfo = res.userInfo var nickName = userInfo.nickName var avatarUrl = userInfo.avatarUrl @@ -692,9 +691,9 @@ wx.requestPayment({ 'package': '', 'signType': 'MD5', 'paySign': '', - 'success':function(res){ + 'success':function(res: any){ }, - 'fail':function(res){ + 'fail':function(res: any){ } }) From 25ea4919f60209bd4fdf009dc3af95e98599c721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 22:02:56 +0800 Subject: [PATCH 293/646] weapp-api,export wx --- types/weapp-api/index.d.ts | 2 ++ types/weapp-api/weapp-api-tests.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index fec6f90f14..5eb9c36175 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1403,3 +1403,5 @@ declare function setInterval(callback: functions, delay: number, rest: any): num * @param timeoutID 要取消的定时器的ID */ declare function clearInterval(timeoutID: number): number; + +export default wx diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 4363179c80..5b2b0616a2 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -1,12 +1,13 @@ +import wx from './index' App({ onLaunch: function () { //调用API从本地缓存中获取数据 - var logs = wx.getStorageSync('logs') as Array || [] + let logs = wx.getStorageSync('logs') as Array || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) }, getUserInfo: function (cb: Function) { - var that = this; + let that = this; if (this.globalData.userInfo) { typeof cb == "function" && cb(this.globalData.userInfo) } else { From 702916ca689af083ec92e984f98b48dff818ec26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 22:08:31 +0800 Subject: [PATCH 294/646] modify functions type --- types/weapp-api/index.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 5eb9c36175..dcc3cd3e16 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: vargeek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import functions from "../react-icons/md/functions"; - declare namespace wx { type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; @@ -1382,7 +1380,7 @@ declare function getApp(): App; * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ -declare function setTimeout(callback: functions, delay: number, rest: any): number; +declare function setTimeout(callback: any, delay: number, rest: any): number; /** * 取消由 setTimeout 设置的定时器。 @@ -1396,7 +1394,7 @@ declare function clearTimeout(timeoutID: number): number; * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ -declare function setInterval(callback: functions, delay: number, rest: any): number; +declare function setInterval(callback: any, delay: number, rest: any): number; /** * 取消由 setInterval 设置的定时器。 From 998964f58a5e714cf9cbbafe9ff757f724638902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Mon, 7 Jan 2019 15:49:11 +0800 Subject: [PATCH 295/646] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=EF=BC=8C=E8=B7=AF=E7=94=B1=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 327 +++++++++++++++++++++++++++++-------- 1 file changed, 258 insertions(+), 69 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index dcc3cd3e16..0882745c2f 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace wx { + // import startPullDownRefresh = swan.startPullDownRefresh; type NoneParamCallback = () => void; type OneParamCallback = (data: any) => void; type ResponseCallback = (res: any) => void; @@ -87,6 +88,8 @@ declare namespace wx { [key: string]: any } + // 网络 + // 发起请求 interface RequestHeader { [key: string]: string; } @@ -109,9 +112,79 @@ declare namespace wx { /** * wx.request发起的是https请求。一个微信小程序,同时只能有5个网络请求连接。 */ - function request(options: RequestOptions): void; + function request(options: RequestOptions): RequestTask; + /** + * 网络请求任务对象 + */ + interface RequestTask { + // 中断请求任务 + abort(): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } + // 下载 + interface OnProgressCallbackOptions { + // 下载进度百分比 + progress: number; + // 已经下载的数据长度,单位 Bytes + totalBytesWritten: number; + // 预期需要下载的数据总长度,单位 Bytes + totalBytesExpectedToWrite: number; + } + /** + * 一个可以监听下载进度变化事件,以及取消下载任务的对象 + */ + interface DownloadTask { + // 中断下载任务 + abort(): void; + // 下载进度变化事件的回调函数 + onProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 取消监听下载进度变化事件 + offProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } + interface DownloadFileOptions { + /** 下载资源的 url */ + url: string; + /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ + type?: string; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ + success?: TempFileResponseCallback; + /** 接口调用失败的回调函数 */ + fail?: ResponseCallback; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ResponseCallback; + } + /** + * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, + * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 + */ + function downloadFile(options: DownloadFileOptions): DownloadTask; + // 上传 + /** + * 一个可以监听上传进度变化事件,以及取消上传任务的对象 + */ + interface UploadTask { + // 中断上传任务 + abort(): void; + // 上传进度变化事件的回调函数 + onProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 取消监听上传进度变化事件 + offProgressUpdate(callback: (res: OnProgressCallbackOptions) => {}): void; + // 监听 HTTP Response Header 事件。会比请求完成事件更早 + onHeadersReceived(callback: DataResponseCallback): void; + // 取消监听 HTTP Response Header 事件 + offHeadersReceived(callback: DataResponseCallback): void; + } interface UploadFileOptions { /** 开发者服务器 url */ url: string; @@ -137,30 +210,9 @@ declare namespace wx { * 客户端发起一个 HTTPS POST 请求, * 其中 Content-Type 为 multipart/form-data 。 */ - function uploadFile(options: UploadFileOptions): void; - - - interface DownloadFileOptions { - /** 下载资源的 url */ - url: string; - /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ - type?: string; - /** HTTP 请求 Header */ - header?: RequestHeader; - /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ - success?: TempFileResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, - * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 - */ - function downloadFile(options: DownloadFileOptions): void; - + function uploadFile(options: UploadFileOptions): UploadTask; + // WebSocket interface ConnectSocketOptions { /** 开发者服务器接口地址,必须是 HTTPS 协议,且域名必须是后台配置的合法域名 */ url: string; @@ -440,6 +492,29 @@ declare namespace wx { */ function chooseVideo(options: ChooseVideoOptions): void; + // 数据缓存 + interface StorageInfo { + // 当前 storage 中所有的 key + keys: Array; + // 当前占用的空间大小, 单位 KB + currentSize: number; + // 限制的空间大小,单位 KB + limitSize: number; + } + type StorageInfoCallback = (res: StorageInfoOptions) => void; + interface StorageInfoOptions extends CommonCallbackOptions{ + success?: StorageInfoCallback; + } + /** + * getStorageInfo的同步版本 + */ + function getStorageInfoSync(): StorageInfo; + /** + * 异步获取当前storage的相关信息 + * @param options + */ + function getStorageInfo(options: StorageInfoOptions): void; + interface SetStorageOptions { /** 本地缓存中的指定的 key */ key: string; @@ -498,6 +573,9 @@ declare namespace wx { */ function clearStorageSync(): void; + // 媒体 + // 地图 TODO + interface LocationData { /** 纬度,浮点数,范围为-90~90,负数表示南纬 */ latitude: number; @@ -658,17 +736,36 @@ declare namespace wx { // 调试 TODO // 路由 - interface routerOptions { - + interface routerOptions extends CommonCallbackOptions{ + // 需要跳转的应用内非 tabBar 的页面的路径, 路径后可以带参数。参数与路径之间使用 ? 分隔,参数键与参数值用 = 相连,不同参数用 & 分隔;如 'path?key=value&key2=value2' + url: string; + } + interface NavigateBackOptions extends CommonCallbackOptions { + // 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 + delta: number; } /** * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。 */ - function navigateBack(): void; - function switchTab(): void; - function navigateTo(): void; - function reLaunch(): void; - function redirectTo(): void; + function navigateBack(options: NavigateBackOptions): void; + /** + * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 + * @param options + */ + function switchTab(options: routerOptions): void; + /** + * 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 wx.navigateBack 可以返回到原页面。 + * @param options + */ + function navigateTo(options: routerOptions): void; + /** + * 关闭所有页面,打开到应用内的某个页面 + */ + function reLaunch(options: routerOptions): void; + /** + * 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 + */ + function redirectTo(options: routerOptions): void; // 界面 // 交互 @@ -689,8 +786,11 @@ declare namespace wx { * 公共回调函数 */ interface CommonCallbackOptions { + // 接口调用成功回调函数 success?: ResponseCallback; + // 接口调用失败回调函数 fail?: ResponseCallback; + // 接口调用结束的回调函数 complete?: ResponseCallback; } @@ -798,7 +898,133 @@ declare namespace wx { // 背景 function setBackgroundTextStyle(): void; + interface BackgroundColorOptions extends CommonCallbackOptions{ + // 窗口的背景色,必须为十六进制颜色值 + backgroundColor?: string; + // 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 + backgroundColorTop?: string; + // 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 + backgroundColorBottom?: string; + } function setBackgroundColor(): void; + // Tab Bar + interface TabBarItemOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + // tab 上的按钮文字 + text?: string; + // 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效,不支持网络图片 + iconPath?: string; + // 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效 + selectedIconPath?: string; + } + /** + * 动态设置 tabBar 某一项的内容 + * @param options + */ + function setTabBarItem(options: TabBarItemOptions): void; + + interface TabBarStyleOptions extends CommonCallbackOptions{ + // tab 上的文字默认颜色,HexColor + color: string; + // tab 上的文字选中时的颜色,HexColor + selectedColor: string; + // tab 的背景色,HexColor + backgroundColor: string; + // tabBar上边框的颜色, 仅支持 black/white + borderStyle: string; + } + /** + * 动态设置tabBar的整体样式 + */ + function setTabBarStyle(options: TabBarItemOptions): void; + + interface TabBarAnimationOptions extends CommonCallbackOptions{ + // 是否需要动画效果 + animation: boolean; + } + /** + * 隐藏tabBar + */ + function hideTabBar(options: TabBarAnimationOptions): void; + /** + * 显示tabBar + */ + function showTabBar(options: TabBarAnimationOptions): void; + + interface TabBarRedDotOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + } + /** + * 隐藏 tabBar 某一项的右上角的红点 + * @param options + */ + function hideTabBarRedDot(options: TabBarBadgeOptions): void; + /** + * 显示 tabBar 某一项的右上角的红点 + * @param options + */ + function showTabBarRedDot(options: TabBarRedDotOptions): void; + + interface TabBarBadgeOptions extends CommonCallbackOptions{ + // tabBar 的哪一项,从左边算起 + index: number; + // 显示的文本,超过 4 个字符则显示成 ... + text: string; + } + /** + * 移除 tabBar 某一项右上角的文本 + * @param options + */ + function removeTabBarBadge(options: TabBarRedDotOptions): void; + /** + * 为 tabBar 某一项的右上角添加文本 + * @param options + */ + function setTabBarBadge(options: TabBarBadgeOptions): void; + + interface FontDescOptions { + // 字体样式,可选值为 normal / italic / oblique + style?: string; + // 字体粗细,可选值为 normal / bold / 100 / 200../ 900 + weight?: string; + // 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit + variant?: string; + } + // 字体 + interface FontFaceOptions extends CommonCallbackOptions{ + // 定义的字体名称 + family: string; + // 字体资源的地址。建议格式为 TTF 和 WOFF,WOFF2 在低版本的iOS上会不兼容。 + source: string; + // 可选的字体描述符 + desc?: FontDescOptions; + } + function loadFontFace(options: FontFaceOptions): void; + + // 下拉刷新 + /** + * 停止当前页面下拉刷新。 + */ + function stopPullDownRefresh(options?: CommonCallbackOptions): void; + + /** + * 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 + */ + function startPullDownRefresh(options?: CommonCallbackOptions): void; + + // 滚动 + interface PageScrollToOptions extends CommonCallbackOptions{ + // 滚动到页面的目标位置,单位 px + scrollTop: number; + // 滚动动画的时长,单位 ms。默认300 + duration: number; + } + /** + * 将页面滚动到 + */ + function pageScrollTo(): void; interface AccelerometerData { /** X 轴 */ @@ -845,46 +1071,9 @@ declare namespace wx { */ function hideNavigationBarLoading(): void; - interface NavigateToOptions { - /** 需要跳转的应用内页面的路径 */ - url: string; - /** 成功获取系统信息的回调 */ - success?: ResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 保留当前页面,跳转到应用内的某个页面,使用wx.navigateBack可以返回到原页面。 - * - * 注意:为了不让用户在使用小程序时造成困扰, - * 我们规定页面路径只能是五层,请尽量避免多层级的交互方式。 - */ - function navigateTo(options: NavigateToOptions): void; - - interface RedirectToOptions { - /** 需要跳转的应用内页面的路径 */ - url: string; - /** 成功获取系统信息的回调 */ - success?: ResponseCallback; - /** 接口调用失败的回调函数 */ - fail?: ResponseCallback; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResponseCallback; - } - /** - * 关闭当前页面,跳转到应用内的某个页面。 - */ - function redirectTo(options: RedirectToOptions): void; - - /** - * 关闭当前页面,回退前一页面。 - */ - function navigateBack(): void; - type TimingFunction = 'linear' | 'ease' | 'ease-in' | 'ease-in-out' | 'ease-out' | 'step-start' | 'step-end'; + // 动画 interface CreateAnimationOptions { /** 动画持续时间,单位ms,默认值 400 */ duration?: number; From df687b91cc8262fe9863b37779bad4b81518040e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:08:35 +0800 Subject: [PATCH 296/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=9C=B0=E5=9B=BE=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 160 ++++++++++++++++++++++++++++++++++++- 1 file changed, 159 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0882745c2f..6fdf7df480 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -574,7 +574,62 @@ declare namespace wx { function clearStorageSync(): void; // 媒体 - // 地图 TODO + // 地图 + interface LocationBaseOptions { + // 纬度,浮点数,范围为-90~90,负数表示南纬 + latitude: number; + // 经度,浮点数,范围为-180~180,负数表示西经 + longitude: number; + } + interface GetCenterLocationSuccCbOptions extends CommonCallbackOptions{ + success(res: LocationBaseOptions): void; + } + interface translateMarkerOptions extends CommonCallbackOptions{ + // 指定 marker + markerId: number; + // 指定 marker 移动到的目标点 + destination: LocationBaseOptions; + // 移动过程中是否自动旋转 marker + autoRotate: boolean; + // marker 的旋转角度 + rotate: number; + // 动画持续时长,平移与旋转分别计算 + duration?: number; + // 动画结束回调函数 + animationEnd?(): void; + } + interface zoomPointsOptions extends CommonCallbackOptions { + // 要显示在可视区域内的坐标点列表 + points: Array; + // 坐标点形成的矩形边缘到地图边缘的距离,单位像素。格式为[上,右,下,左],安卓上只能识别数组第一项,上下左右的padding一致。开发者工具暂不支持padding参数。 + padding?: Array; + } + interface GetReginSuccessCallbackOptions { + // 西南角经纬度 + southwest: number, + // 东北角经纬度 + northeast: number; + } + interface GetReginOptions extends CommonCallbackOptions{ + success?(callback: (res: GetReginSuccessCallbackOptions) => void): void; + } + interface GetScaleOptions extends CommonCallbackOptions{ + success?(callback: (res: {scale: number}) => void): void; + } + interface MapContext { + // 获取当前地图中心的经纬度。返回的是 gcj02 坐标系,可以用于 wx.openLocation() + getCenterLocation(options: GetCenterLocationSuccCbOptions): void; + // 将地图中心移动到当前定位点。需要配合map组件的show-location使用 + moveToLocation(): void; + // 平移marker,带动画 + translateMarker(options: translateMarkerOptions): void; + // 缩放视野展示所有经纬度 + includePoints(options: zoomPointsOptions): void; + // 获取当前地图的视野范围 + getRegion(options: GetReginOptions): void; + // 获取当前地图的缩放级别 + getScale(options: GetScaleOptions): void; + } interface LocationData { /** 纬度,浮点数,范围为-90~90,负数表示南纬 */ @@ -1440,6 +1495,8 @@ declare namespace wx { */ function hideKeyboard(): void; + // 开放接口 + // 登录 interface LoginResponse { /** 调用结果 */ errMsg: string; @@ -1458,6 +1515,10 @@ declare namespace wx { complete?: ResponseCallback; } + /** + * 检查登录态是否过期。 + */ + function checkSession(options: CommonCallbackOptions): void; /** * 调用接口获取登录凭证(code)进而换取用户登录态信息, * 包括用户的唯一标识(openid) 及本次登录的 会话密钥(session_key)。 @@ -1465,6 +1526,51 @@ declare namespace wx { */ function login(option: LoginOptions): void; + type envVersion = 'develop' | 'trial' | 'release'; + interface NavigateToMiniProgramOptions extends CommonCallbackOptions { + // 要打开的小程序 appId + appId: string; + // 打开的页面路径,如果为空则打开首页 + path?: string; + // 需要传递给目标小程序的数据,目标小程序可在 App.onLaunch,App.onShow 中获取到这份数据。 + extraData?: object; + // 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 + envVersion?: envVersion; + } + /** + * 打开另一个小程序 + */ + function navigateToMiniProgram(options: NavigateToMiniProgramOptions): void; + interface NavigateBackMiniProgramOptions extends CommonCallbackOptions { + // 需要返回给上一个小程序的数据,上一个小程序可在 App.onShow 中获取到这份数据。 + extraData: object; + } + /** + * 返回到上一个小程序。只有在当前小程序是被其他小程序打开时可以调用成功 + */ + function navigateBackMiniProgram(options: NavigateBackMiniProgramOptions): void; + + // 帐号信息 + interface AccountInfo { + // 小程序帐号信息 + miniProgram: { + // 小程序appId + appId: string; + }; + // 插件帐号信息(仅在插件中调用时包含这一项) + Plugin: { + // 插件appId + appId: string; + // 插件版本号 + vetsion: string + }; + } + /** + * 获取当前账号信息 + */ + function getAccountInfoSync(): AccountInfo; + + // 帐号信息 interface UserInfo { nickName: string; avatarUrl: string; @@ -1515,11 +1621,63 @@ declare namespace wx { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ResponseCallback; } + // 支付 /** * 发起微信支付。 */ function requestPayment(options: RequestPaymentOptions): void; + + // 授权 + /** + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html + * 用户信息 wx.getUserInfo、 + * 地理位置 wx.getLocation,wx.chooseLocation、 + * 通讯地址 wx.chooseAddress、 + * 发票抬头 wx.chooseInvoiceTitle、 + * 获取发票 wx.chooseInvoice、 + * 微信运动步数 wx.getWeRunData、 + * 录音功能 wx.startRecord、 + * 保存到相册 wx.saveImageToPhotosAlbum, wx.saveVideoToPhotosAlbum、 + * 摄像头 组件 + */ + type Scope = 'userInfo' | 'userLocation' | 'address' | 'invoiceTitle' | 'invoice' | 'werun' | 'record' | 'writePhotosAlbum' | 'camera'; + interface AuthorizeOptions extends CommonCallbackOptions { + // 需要获取权限的 scope,详见 scope 列表 + scope: Scope; + } + /** + * 提前向用户发起授权请求。调用后会立刻弹窗询问用户是否同意授权小程序使用某项功能或获取用户的某些数据,但不会实际调用对应接口。如果用户之前已经同意授权,则不会出现弹窗,直接返回成功。 + */ + function authorize(options: AuthorizeOptions): void; + + // 设置 + interface SettingOptions extends CommonCallbackOptions{ + success?(res: AuthSetting): void; + } + /** + * 调起客户端小程序设置界面,返回用户设置的操作结果。设置界面只会出现小程序已经向用户请求过的权限。 + */ + function openSetting(options: SettingOptions): void; + /** + * 获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。 + */ + function getSetting(options: SettingOptions): void; + /** + * 用户授权结果,参考 type Scope + */ + interface AuthSetting { + 'scope.userInfo': boolean; + 'scope.userLocation': boolean; + 'scope.address': boolean; + 'scope.invoiceTitle': boolean; + 'scope.invoice': boolean; + 'scope.werun': boolean; + 'scope.record': boolean; + 'scope.writePhotosAlbum': boolean; + 'scope.camera': boolean; + } } +// end of wx namespace interface Page { From 9d8bc4fa109254f1d4d4216a8ba1b094fecc340d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:16:37 +0800 Subject: [PATCH 297/646] =?UTF-8?q?=E5=A2=9E=E5=8A=A0author=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/weapp-api/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 6fdf7df480..0cbaf8b97b 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for weapp // Project: https://mp.weixin.qq.com/debug/wxadoc/dev/index.html -// Definitions by: vargeek +// Definitions by: vargeek & pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace wx { From c8eda895a2187bfc5a7c4b0ec1fe9830ffe57ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Tue, 8 Jan 2019 16:59:03 +0800 Subject: [PATCH 298/646] add author and TypeScript version --- types/weapp-api/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 0cbaf8b97b..4350eb1d25 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for weapp // Project: https://mp.weixin.qq.com/debug/wxadoc/dev/index.html -// Definitions by: vargeek & pbestz +// Definitions by: vargeek +// pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2.1 declare namespace wx { // import startPullDownRefresh = swan.startPullDownRefresh; From 97b1f780d1856a65851442488d20b669b9bb7bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Fri, 11 Jan 2019 14:58:26 +0800 Subject: [PATCH 299/646] fix test case --- types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts index 62b47e355c..cc6db7cb34 100644 --- a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts +++ b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts @@ -138,7 +138,7 @@ wx.updateAppMessageShareData({ title: '', desc: '', link: '', - imageUrl: '', + imgUrl: '', success: () => { } }); From aa1bbcfd3a830b3f0d201e7f43f654eb382a2bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Fri, 11 Jan 2019 15:09:43 +0800 Subject: [PATCH 300/646] add some tests for amap --- types/amap-js-sdk/amap-js-sdk-tests.ts | 20 +++++++++++++++++++- types/amap-js-sdk/index.d.ts | 4 ++-- types/wx-js-sdk-dt/index.d.ts | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/types/amap-js-sdk/amap-js-sdk-tests.ts b/types/amap-js-sdk/amap-js-sdk-tests.ts index 9354bed23a..f09bca3760 100644 --- a/types/amap-js-sdk/amap-js-sdk-tests.ts +++ b/types/amap-js-sdk/amap-js-sdk-tests.ts @@ -1,4 +1,22 @@ -const map = new AMap.Map('id', { +const aMap = new AMap.Map('id', { resizeEnable: true, animateEnable: true }); + +aMap.setCenter(new AMap.LngLat(0, 0)); + +AMap.plugin(['someplugin'], () => { + console.log('plugin loaded'); +}); + +AMap.convertFrom([116.3, 39.9], 'gps', (status, result) => { + if (result.info === 'ok') { + const _ = result.locations; + } +}); + +new AMap.Marker({ + map: aMap, + title: '', + position: new AMap.LngLat(0, 0), +}); diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts index e6b4311dc3..c77cca2732 100644 --- a/types/amap-js-sdk/index.d.ts +++ b/types/amap-js-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for amap-js-sdk x.x +// Type definitions for amap-js-sdk 1.4.12 // Project: http://lbs.amap.com/api/javascript-api/summary/ // Definitions by: Bian Zhongjie // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -889,7 +889,7 @@ declare namespace AMap { /** * 坐标转换 */ - function convertFrom(lnglat: LngLat | LngLat[], type: string, result: (status: string, result: ConvertorResult) => void): void; + function convertFrom(lnglat: LngLat | LngLat[] | [number, number], type: string, result: (status: string, result: ConvertorResult) => void): void; interface CitySearchResult { city: string; diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index 6283caae62..70f6f41c0a 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wx-js-sdk 1.2 +// Type definitions for wx-js-sdk 1.4 // Project: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115 // Definitions by: Bian Zhongjie // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From b765e282d5adf88f96a9c4c5fcc1486dde434fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 11 Jan 2019 15:56:23 +0800 Subject: [PATCH 301/646] fix CI build failed --- types/weapp-api/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 4350eb1d25..1007429649 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,7 +3,6 @@ // Definitions by: vargeek // pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.2.1 declare namespace wx { // import startPullDownRefresh = swan.startPullDownRefresh; From e2a88a0709d020936a4e7b45e694133087e68831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 11 Jan 2019 16:04:36 +0800 Subject: [PATCH 302/646] fix CI build errors --- types/weapp-api/tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/weapp-api/tsconfig.json b/types/weapp-api/tsconfig.json index 74812f3d05..9df5bc5879 100644 --- a/types/weapp-api/tsconfig.json +++ b/types/weapp-api/tsconfig.json @@ -19,7 +19,6 @@ }, "files": [ "index.d.ts", - "weapp-api-tests.ts", - "../baidu-app/index.d.ts" + "weapp-api-tests.ts" ] } From 1f6d17a360a660b94c6569a1bb44120e833e049c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Fri, 11 Jan 2019 16:13:34 +0800 Subject: [PATCH 303/646] update dinifitions --- types/amap-js-sdk/index.d.ts | 321 ++++++++++++++++++------------- types/amap-js-sdk/tsconfig.json | 1 + types/wx-js-sdk-dt/tsconfig.json | 5 +- 3 files changed, 188 insertions(+), 139 deletions(-) diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts index c77cca2732..397182dac3 100644 --- a/types/amap-js-sdk/index.d.ts +++ b/types/amap-js-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for amap-js-sdk 1.4.12 +// Type definitions for amap-js-sdk 1.4 // Project: http://lbs.amap.com/api/javascript-api/summary/ // Definitions by: Bian Zhongjie // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -24,28 +24,26 @@ declare namespace AMap { namespace event { /** * 注册DOM对象事件:给DOM对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 - 参数: - instance:需注册事件的DOM对象(必填), - eventName:事件名称(必填), - handler:事件功能函数(必填), - context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + * @param instance:需注册事件的DOM对象(必填) + * @param eventName:事件名称(必填) + * @param handler:事件功能函数(必填) + * @param context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) */ const addDomListener: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; /** * 注册对象事件:给对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 - 参数: - instance:需注册事件的对象(必填), - eventName:事件名称(必填), - handler:事件功能函数(必填), - context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + * @param instance:需注册事件的对象(必填) + * @param eventName:事件名称(必填) + * @param handler:事件功能函数(必填) + * @param context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) */ - const addListener: (instance: Object, eventName: string, handler: EventCallback, context?: any) => EventListener; + const addListener: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; /** * 类似于addListener,但处理程序会在处理完第一个事件后将自已移除。 */ - const addListenerOnce: (instance: Object, eventName: string, handler: EventCallback, context?: any) => EventListener; + const addListenerOnce: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; /** * 删除由上述 event.addDomListener 和 event.addListener 传回的指定侦听器。 @@ -55,10 +53,9 @@ declare namespace AMap { /** * 触发非DOM事件:触发非DOM事件eventName,extArgs将扩展到事件监听函数(handler)接受到的event参数中。如:在extArgs内写入{m:10,p:2},eventName监听函数(handler)可以接收到包含m,p两个key值的event对象。 */ - const trigger: (instance: Object, eventName: string, extArgs: any) => void; + const trigger: (instance: any, eventName: string, extArgs: any) => void; } - /** * 此对象用于表示地图、覆盖物、叠加层上的各种鼠标事件返回,包含以下字段: */ @@ -66,7 +63,7 @@ declare namespace AMap { lnglat: LngLat; pixel: Pixel; type: string; - target: Object; + target: any; } abstract class EventBindable { @@ -74,7 +71,6 @@ declare namespace AMap { off(eventName: string, callback: EventCallback): void; } - /* --------------------------- 基础类 --------------------------- */ /* 参考地址:http://lbs.amap.com/api/javascript-api/reference/core */ @@ -82,7 +78,6 @@ declare namespace AMap { * 像素坐标,确定地图上的一个像素点。 */ class Pixel { - /** * 构造一个像素坐标对象。 */ @@ -112,11 +107,10 @@ declare namespace AMap { * 地物对象的像素尺寸 */ class Size { - /** * 构造尺寸对象 - * @param {number} width 宽度,单位:像素 - * @param {number} height 高度,单位:像素 + * @param width 宽度,单位:像素 + * @param height 高度,单位:像素 */ constructor(width: number, height: number); @@ -140,26 +134,25 @@ declare namespace AMap { * 经纬度坐标,确定地图上的一个点 */ class LngLat { - /** * 构造一个地理坐标对象 - * @param {number} lng 经度 - * @param {number} lat 纬度 + * @param lng 经度 + * @param lat 纬度 */ - constructor(lng: number, lat:number); + constructor(lng: number, lat: number); /** * 当前经纬度坐标值经度移动w,纬度移动s,得到新的坐标。 * - * @param {number} w 经度,向右移为正值,单位:米 - * @param {number} s 纬度,向上移为正值,单位:米 + * @param w 经度,向右移为正值,单位:米 + * @param s 纬度,向上移为正值,单位:米 */ - offset(w:number, s:number): LngLat; + offset(w: number, s: number): LngLat; /** * 计算当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米 * - * @param {(LngLat | [number, number])} lnglat 传入的经纬度 + * @param lnglat 传入的经纬度 */ distance(lnglat: LngLat | [number, number]): number; @@ -176,7 +169,7 @@ declare namespace AMap { /** * 判断当前坐标对象与传入坐标对象是否相等 * - * @param {LngLat} lnglat 传入坐标对象 + * @param lnglat 传入坐标对象 */ equals(lnglat: LngLat): boolean; @@ -190,17 +183,16 @@ declare namespace AMap { * 地物对象的经纬度矩形范围 */ class Bounds { - /** * 构造一个矩形范围 - * @param {LngLat} southWest 西南角经纬度坐标 - * @param {LngLat} northEast 东北角经纬度坐标 + * @param southWest 西南角经纬度坐标 + * @param northEast 东北角经纬度坐标 */ constructor(southWest: LngLat, northEast: LngLat); /** * 判断指定点坐标是否在矩形范围内 - * @param {LngLat} point 指定点 + * @param point 指定点 */ contains(point: LngLat): boolean; @@ -264,7 +256,6 @@ declare namespace AMap { } namespace TileLayer { - abstract class MapTypeLayer extends Layer { constructor(options?: { map: Map, @@ -297,8 +288,42 @@ declare namespace AMap { } } - interface IndoorMap { + class IndoorMap { + constructor(opts: { + zIndex?: number, + opacity?: number, + cursor?: string, + hideFloorBar?: boolean, + alwaysShow?: boolean + }); + showIndoorMap(indoorid: string, floor: number, shopid: string): void; + + showFloor(floor: number, noMove: boolean): void; + + setMap(map: Map): void; + + show(): void; + + hide(): void; + + setzIndex(): void; + + showFloorBar(): void; + + hideFloorBar(): void; + + setOpacity(alpha: number): void; + + getOpacity(): number; + + showLabels(): void; + + hideLabels(): void; + + getSelectedBuildingId(): string; + + getSelectedBuilding(): string; } interface MapOptions { @@ -335,12 +360,16 @@ declare namespace AMap { center?: LngLat, rotation?: number, zoom?: number, - crs?: string + crs?: 'EPSG3857'|'EPSG3395'|'EPSG4326' }); + + /** + * To silence lint error, this class has to be exists. + */ + toString(): string; } class Map extends EventBindable { - constructor(mapDiv: string, opts?: MapOptions); getZoom(): number; @@ -374,7 +403,7 @@ declare namespace AMap { getAllOverlays(type: string): Marker[] | Circle[] | Polygon[] | Polyline[]; setCenter(position: LngLat): void; setZoomAndCenter(zoomLevel: number, center: LngLat): void; - setCity(city:string, callback: () => void): void; + setCity(city: string, callback: () => void): void; setBounds(bound: Bounds): void; setLimitBounds(bound: Bounds): void; clearLimitBounds(): void; @@ -390,8 +419,8 @@ declare namespace AMap { clearMap(): void; destroy(): void; plugin(name: string| string[], callback: () => void): void; - addControl(obj: IMapControl|Object): void; - removeControl(obj: IMapControl|Object): void; + addControl(obj: MapControl): void; + removeControl(obj: MapControl): void; clearInfoWindow(): void; pixelToLngLat(pixel: Pixel, level: number): LngLat; lnglatToPixel(lnglat: LngLat, level: number): Pixel; @@ -402,7 +431,6 @@ declare namespace AMap { setFeatures(features: string[]): void; getFeatures(): string[]; setDefaultLayer(layer: TileLayer): void; - } class Icon { @@ -440,6 +468,11 @@ declare namespace AMap { */ type?: string }); + + /** + * To silence lint error, this class has to be exists. + */ + toString(): string; } interface MarkerOptions { @@ -628,15 +661,14 @@ declare namespace AMap { setMap(map: Map): void; setExtData(ext: any): void; getExtData(): any; - } - interface IMapControl { + interface MapControl { show(): void; hide(): void; } - class MapType implements IMapControl { + class MapType implements MapControl { constructor(options?: { defaultType?: number; showTraffic?: boolean; @@ -647,7 +679,7 @@ declare namespace AMap { hide(): void; } - class OverView extends EventBindable implements IMapControl { + class OverView extends EventBindable implements MapControl { constructor(options?: { tileLayer?: TileLayer[], isOpen?: boolean, @@ -662,7 +694,7 @@ declare namespace AMap { hide(): void; } - class Scale extends EventBindable implements IMapControl { + class Scale extends EventBindable implements MapControl { offset: Pixel; position: string; @@ -670,7 +702,7 @@ declare namespace AMap { hide(): void; } - class ToolBar extends EventBindable implements IMapControl { + class ToolBar extends EventBindable implements MapControl { constructor(options?: { offset?: Pixel, position?: string, @@ -689,11 +721,11 @@ declare namespace AMap { hideRuler(): void; showRuler(): void; hideDirection(): void; - showDirection(): void + showDirection(): void; hideLocation(): void; showLocation(): void; doLocation(): void; - getLocation(): { lng:number, lat:number }; + getLocation(): { lng: number, lat: number }; show(): void; hide(): void; } @@ -875,7 +907,7 @@ declare namespace AMap { setCity(city: string): void; - getAddress(location:LngLat|LngLat[], callback: (status?: string, result?: string | ReGeocodeResult) => void): void; + getAddress(location: LngLat|LngLat[], callback: (status?: string, result?: string | ReGeocodeResult) => void): void; } /** @@ -891,6 +923,30 @@ declare namespace AMap { */ function convertFrom(lnglat: LngLat | LngLat[] | [number, number], type: string, result: (status: string, result: ConvertorResult) => void): void; + interface Poi { + id: string; + name: string; + type: string; + location: LngLat; + address: string; + distance: number; + tel: string; + + website: string; + pcode: string; + citycode: string; + adcode: string; + postcode: string; + pname: string; + cityname: string; + adname: string; + email: string; + entr_location: LngLat; + exit_location: LngLat; + groupbuy: boolean; + discount: boolean; + } + interface CitySearchResult { city: string; bounds: Bounds; @@ -901,11 +957,7 @@ declare namespace AMap { getCityByIp(ip: string, callback: (status: string, result: string | CitySearchResult) => void): void; } - class Poi { - - } - - const enum DrivingPolicy { + enum DrivingPolicy { LEAST_TIME, LEAST_FEE, LEAST_DISTANCE, @@ -916,7 +968,7 @@ declare namespace AMap { name: string; citycode: string; adcode: string; - districts: District[] + districts: District[]; } interface District { @@ -943,9 +995,9 @@ declare namespace AMap { tolls_distance: number; toll_road: string; time: number; - path: LngLat[], - cities?: ViaCity[], - tmcs?: TMC[] + path: LngLat[]; + cities?: ViaCity[]; + tmcs?: TMC[]; } interface DriveRoute { @@ -954,7 +1006,7 @@ declare namespace AMap { policy: string; tolls: number; tolls_distance: number; - steps: DriveStep[] + steps: DriveStep[]; } interface DrivingResult { @@ -964,7 +1016,7 @@ declare namespace AMap { start: Poi; waypoints: Poi; taxi_cost: number; - routes: DriveRoute[] + routes: DriveRoute[]; } class Driving extends EventBindable { @@ -977,14 +1029,14 @@ declare namespace AMap { showTraffic?: boolean }); - search(origin:LngLat, destination: LngLat, opts?: { + search(origin: LngLat, destination: LngLat, opts?: { waypoints: LngLat[] }, callback?: (status: string, result: string|DrivingResult) => void): void; - search(point: { + search(point: Array<{ keyword: string, city: string - }[], callback: (status: string, result: string|DrivingResult) => void): void; + }>, callback: (status: string, result: string|DrivingResult) => void): void; setPolicy(policy: DrivingPolicy): void; setAvoidPolygons(path: LngLat[][]): void; @@ -1055,17 +1107,16 @@ declare namespace AMap { getForecast(district: string, callback: (errorStatus: any, result: WeatherForecastResult) => void): void; } - interface Tip { - name: string, - district: string, - adcode: string + name: string; + district: string; + adcode: string; } interface AutocompleteResult { - info: string, - count: number, - tips: Tip[] + info: string; + count: number; + tips: Tip[]; } class Autocomplete { @@ -1077,76 +1128,76 @@ declare namespace AMap { input?: string }); - search(keyword:string, callback: (status: string, result: string | AutocompleteResult) => void): void; + search(keyword: string, callback: (status: string, result: string | AutocompleteResult) => void): void; } interface SelectChangeEvent { - type: string, - id: string, - marker: Marker, - listElement: HTMLLIElement, - data: Poi + type: string; + id: string; + marker: Marker; + listElement: HTMLLIElement; + data: Poi; } interface PoiList { - pois: Poi[], - pageIndex: number, - pageSize: number, - count: number + pois: Poi[]; + pageIndex: number; + pageSize: number; + count: number; } interface CityInfo { - name: string, - citycode: string, - adcode: string, - count: number + name: string; + citycode: string; + adcode: string; + count: number; } interface SearchResult { - info: string, - poiList: PoiList, - keywordList: string[], - cityList: CityInfo[] + info: string; + poiList: PoiList; + keywordList: string[]; + cityList: CityInfo[]; } interface Photo { - title: string, - url: string + title: string; + url: string; } interface Content { - id: string, - name: string + id: string; + name: string; } interface Discount { - title: string, - detail: string, - start_time: string, - end_time: string, - sold_num: string, - photos: Photo[], - url: string, - provider: string + title: string; + detail: string; + start_time: string; + end_time: string; + sold_num: string; + photos: Photo[]; + url: string; + provider: string; } interface Groupbuy { - title: string, - type_code: string, - type: string, - detail: string, - stime: string, - etime: string, - count: number, - sold_num: number, - original_price: number, - groupbuy_price: number, - discount: number, - ticket_address: string, - ticket_tel: string, - photos: Photo[], - url: string, - provider: string + title: string; + type_code: string; + type: string; + detail: string; + stime: string; + etime: string; + count: number; + sold_num: number; + original_price: number; + groupbuy_price: number; + discount: number; + ticket_address: string; + ticket_tel: string; + photos: Photo[]; + url: string; + provider: string; } class PlaceSearch { @@ -1167,7 +1218,7 @@ declare namespace AMap { }); search(keyword: string, callback: (status: string, result: string | SearchResult) => void): void; - searchNearBy(keyword: string, center: LngLat, radius: number, callback: (status: string,result: string|SearchResult) => void): void; + searchNearBy(keyword: string, center: LngLat, radius: number, callback: (status: string, result: string|SearchResult) => void): void; searchInBounds(keyword: string, bounds: Bounds|Polygon, callback: (status: string, result: string|SearchResult) => void): void; getDetails(POIID: string, callback: (status: string, result: string|SearchResult) => void): void; setType(type: string): void; @@ -1178,36 +1229,36 @@ declare namespace AMap { setLang(lang: string): string; getLang(): string; clear(): void; - poiOnAMAP(obj: Object): void; - detailOnAMAP(obj: object): void; + poiOnAMAP(obj: any): void; + detailOnAMAP(obj: any): void; } interface DistrictSearchOptions { - level: string, - showbiz?: boolean, - extensions?: string, - subdistrict?: number + level: string; + showbiz?: boolean; + extensions?: string; + subdistrict?: number; } interface DistrictSearchResult { - info: string, - districtList: District[] + info: string; + districtList: District[]; } interface District { - name: string, - center: LngLat, - citycode: string, - adcode: string, - level: string, - boundaries: LngLat[], - districtList: District[] + name: string; + center: LngLat; + citycode: string; + adcode: string; + level: string; + boundaries: LngLat[]; + districtList: District[]; } class DistrictSearch { constructor(opts: DistrictSearchOptions); - search(keywords: string, callback?: (status: string,result: string| DistrictSearchResult) => void, opts?: DistrictSearchOptions): void; + search(keywords: string, callback?: (status: string, result: string| DistrictSearchResult) => void, opts?: DistrictSearchOptions): void; setLevel(level: string): void; setSubdistrict(district: number): void; } diff --git a/types/amap-js-sdk/tsconfig.json b/types/amap-js-sdk/tsconfig.json index 5fe4ef145c..ba4581a859 100644 --- a/types/amap-js-sdk/tsconfig.json +++ b/types/amap-js-sdk/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/wx-js-sdk-dt/tsconfig.json b/types/wx-js-sdk-dt/tsconfig.json index b8e46b6302..4dda19baa3 100644 --- a/types/wx-js-sdk-dt/tsconfig.json +++ b/types/wx-js-sdk-dt/tsconfig.json @@ -14,10 +14,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, - "paths": { - "wx-js-sdk-dt": ["."] - } + "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", From 19867156a106c08343113fe899eeb80fff260dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 11 Jan 2019 16:16:03 +0800 Subject: [PATCH 304/646] fix CI build error. export App --- types/weapp-api/index.d.ts | 13 +++++++++++-- types/weapp-api/weapp-api-tests.ts | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 1007429649..3bc0200fa6 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1728,7 +1728,7 @@ declare function getApp(): App; * @param delay 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 * @param rest param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ -declare function setTimeout(callback: any, delay: number, rest: any): number; +declare function setTimeout(callback: any, delay: number, rest?: any): number; /** * 取消由 setTimeout 设置的定时器。 @@ -1750,4 +1750,13 @@ declare function setInterval(callback: any, delay: number, rest: any): number; */ declare function clearInterval(timeoutID: number): number; -export default wx +export { + wx, + App, + Page, + getApp, + setTimeout, + clearTimeout, + setInterval, + clearInterval +} diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 5b2b0616a2..73f86e31f5 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -1,4 +1,4 @@ -import wx from './index' +import {wx, App, Page, getApp, setTimeout, clearTimeout, setInterval, clearInterval} from './index' App({ onLaunch: function () { //调用API从本地缓存中获取数据 From a7a94fc20dd7616abda1306b0cdcc637cf41dd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 11 Jan 2019 16:35:53 +0800 Subject: [PATCH 305/646] add TS version in header --- types/weapp-api/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index 3bc0200fa6..6c2b4d8ec0 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: vargeek // pbestz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare namespace wx { // import startPullDownRefresh = swan.startPullDownRefresh; From 4a016d7d3db8cf09d527a4168c2f6dc6013c72d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9E=E4=B8=AD=E6=9D=B0?= Date: Fri, 11 Jan 2019 16:38:16 +0800 Subject: [PATCH 306/646] fix some interfaces --- types/amap-js-sdk/index.d.ts | 137 ++++++++++++++++++++++- types/wx-js-sdk-dt/index.d.ts | 8 +- types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts | 6 +- 3 files changed, 139 insertions(+), 12 deletions(-) diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts index 397182dac3..a1b93e6cb3 100644 --- a/types/amap-js-sdk/index.d.ts +++ b/types/amap-js-sdk/index.d.ts @@ -71,8 +71,8 @@ declare namespace AMap { off(eventName: string, callback: EventCallback): void; } -/* --------------------------- 基础类 --------------------------- */ -/* 参考地址:http://lbs.amap.com/api/javascript-api/reference/core */ + /* --------------------------- 基础类 --------------------------- */ + /* 参考地址:http://lbs.amap.com/api/javascript-api/reference/core */ /** * 像素坐标,确定地图上的一个像素点。 @@ -419,8 +419,8 @@ declare namespace AMap { clearMap(): void; destroy(): void; plugin(name: string| string[], callback: () => void): void; - addControl(obj: MapControl): void; - removeControl(obj: MapControl): void; + addControl(obj: any): void; + removeControl(obj: any): void; clearInfoWindow(): void; pixelToLngLat(pixel: Pixel, level: number): LngLat; lnglatToPixel(lnglat: LngLat, level: number): Pixel; @@ -567,6 +567,133 @@ declare namespace AMap { getExtData(): any; } + interface MarkerClustererOptions { + gridSize?: number; + minClusterSize?: number; + maxZoom?: number; + averageCenter?: boolean; + styles?: any[]; + renderCluserMarker?: (obj: any) => void; + zoomOnClick?: boolean; + } + + /** + * 用于地图上加载大量点标记,提高地图的绘制和显示性能。 + */ + class MarkerClusterer extends EventBindable { + constructor(map: Map, markers: Marker[], opt?: MarkerClustererOptions); + + /** + * 添加一个需进行聚合的点标记 + * @param marker + */ + addMarker(marker: Marker): void; + + /** + * 删除一个聚合的点标记 + * @param marker 点标记 + */ + removeMarker(marker: Marker): void; + + /** + * 获取聚合点的总数量 + */ + getClustersCount(): number; + + /** + * 获取聚合网格的像素大小 + */ + getGridSize(): number; + + /** + * 获取地图中点标记的最大聚合级别 + */ + getMaxZoom(): number; + + /** + * 获取单个聚合的最小数量 + */ + getMinClusterSize(): number; + + /** + * 获取聚合的样式风格集合 + */ + getStyles(): any[]; + + /** + * 设置聚合网格的像素大小 + * @param size + */ + setGridSize(size: number): void; + + /** + * 设置地图中点标记的最大聚合级别 + * @param zoom + */ + setMaxZoom(zoom: number): void; + + /** + * 设置单个聚合的最小数量 + * @param size + */ + setMinClusterSize(size: number): void; + + /** + * 设置聚合的样式风格 + * @param styles + */ + setStyles(styles: any[]): void; + + /** + * 从地图上彻底清除所有聚合点标记 + */ + clearMarkers(): void; + + /** + * 设置将进行点聚合的地图对象 + * @param map + */ + setMap(map: Map): void; + + /** + * 设置将进行点聚合显示的点标记集合 + * @param markers + */ + setMarkers(markers: Marker[]): void; + + /** + * 获取该点聚合的地图对象 + */ + getMap(): Map; + + /** + * 获取该点聚合中的点标记集合 + */ + getMarkers(): Marker[]; + + /** + * 添加一组需进行聚合的点标记 + */ + addMarkers(markers: Marker[]): void; + + /** + * 删除一组聚合的点标记 + * @param markers + */ + removeMarkers(markers: Marker[]): void; + + /** + * 获取单个聚合点位置是否是聚合内所有标记的平均中心 + */ + isAverageCenter(): boolean; + + /** + * 设置单个聚合点位置是否是聚合内所有标记的平均中心 + * @param averageCenter + */ + setAverageCenter(averageCenter: boolean): void; + } + interface CircleOptions { map: Map; zIndex?: number; @@ -1262,4 +1389,4 @@ declare namespace AMap { setLevel(level: string): void; setSubdistrict(district: number): void; } -} + } diff --git a/types/wx-js-sdk-dt/index.d.ts b/types/wx-js-sdk-dt/index.d.ts index 70f6f41c0a..aea78948aa 100644 --- a/types/wx-js-sdk-dt/index.d.ts +++ b/types/wx-js-sdk-dt/index.d.ts @@ -65,22 +65,22 @@ declare namespace wx { /** * 接口调用成功时执行的回调函数 */ - success?(...params: any): void; + success?(res?: any): void; /** * 接口调用失败时执行的回调函数 */ - fail?(...params: any): void; + fail?(error?: any): void; /** * 接口调用完成时执行的回调函数,无论成功或失败都会执行 */ - complete?(...params: any): void; + complete?(res?: any): void; /** * 用户点击取消时的回调函数,仅部分有用户取消操作的api才会用到 */ - cancel?(...params: any): void; + cancel?(): void; } /** diff --git a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts index cc6db7cb34..a7942dfb31 100644 --- a/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts +++ b/types/wx-js-sdk-dt/wx-js-sdk-dt-tests.ts @@ -67,9 +67,9 @@ wx.chooseWXPay({ nonceStr: '', package: '', paySign: '', - success: (res) => {}, - cancel: (res) => {}, - fail: (res) => {} + success: () => {}, + cancel: () => {}, + fail: () => {} }); wx.getLocation({ From 345ca6140f0f2f40fa3852e36a8d0811f646c06e Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 08:38:33 +0000 Subject: [PATCH 307/646] Apply as many standard lint rules as possible. --- types/jwplayer/tslint.json | 65 -------------------------------------- 1 file changed, 65 deletions(-) diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index a41bf5d19a..3068964159 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -2,78 +2,13 @@ "extends": "dtslint/dt.json", "rules": { "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, "callable-types": false, - "comment-format": false, "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, "typedef-whitespace": false, "unified-signatures": false, - "void-return": false, "whitespace": false } } From 8cf6801f79f87061c6e04a50900b390501ede446 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 08:52:41 +0000 Subject: [PATCH 308/646] Fix violations of 'whitespace' lint rule. --- types/jwplayer/index.d.ts | 2 +- types/jwplayer/tslint.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 1d65bca261..0111370899 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -506,4 +506,4 @@ interface JWPlayerStatic { version: string; } -declare const jwplayer:JWPlayerStatic; +declare const jwplayer: JWPlayerStatic; diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index 3068964159..4f1be58fd5 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -8,7 +8,6 @@ "one-line": false, "semicolon": false, "typedef-whitespace": false, - "unified-signatures": false, - "whitespace": false + "unified-signatures": false } } From f87712a95ac883dac32c8af20550470e162330dc Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 08:54:35 +0000 Subject: [PATCH 309/646] Fix violations of 'callable-types' lint rule. --- types/jwplayer/index.d.ts | 4 +--- types/jwplayer/tslint.json | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 0111370899..b7434c602a 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -231,9 +231,7 @@ interface FirstFrameParam extends CallbackParam { viewable: 0 | 1; } -interface EventCallback { - (param: T): void; -} +type EventCallback = (param: T) => void; interface Region { x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index 4f1be58fd5..00e6c2de35 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -2,7 +2,6 @@ "extends": "dtslint/dt.json", "rules": { "adjacent-overload-signatures": false, - "callable-types": false, "dt-header": false, "no-empty-interface": false, "one-line": false, From 64f757c065a6db4a76905089f6f48c7cfd32309b Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 09:02:14 +0000 Subject: [PATCH 310/646] Fix violations of 'no-empty-interface' lint rule. --- types/jwplayer/index.d.ts | 71 ++++++++++++++++++-------------------- types/jwplayer/tslint.json | 1 - 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index b7434c602a..b8e18dcae6 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -52,33 +52,30 @@ interface Environment{ Features: Features; } -interface CallbackParam { -} - -interface AdProgressParam extends CallbackParam { +interface AdProgressParam { client: 'vast' | 'googima'; creativetype: string; tag: string; } -interface AdCompanionsParam extends CallbackParam { +interface AdCompanionsParam { companions: any[]; tag: string; } -interface AdErrorParam extends CallbackParam { +interface AdErrorParam { message: string; tag: string; } -interface AdRequestParam extends CallbackParam { +interface AdRequestParam { adposition: 'pre' | 'mid' | 'post'; client: 'vast' | 'googima'; offset: 'pre' | 'mid' | 'post'; tag: string; } -interface AdImpressionParam extends CallbackParam { +interface AdImpressionParam { adposition: 'pre' | 'mid' | 'post'; adsystem: string; adtitle: string; @@ -92,38 +89,38 @@ interface AdImpressionParam extends CallbackParam { wrapper: any[]; } -interface AdScheduleParam extends CallbackParam { +interface AdScheduleParam { tag: string; client: string; adbreaks: object[]; } -interface AdStartedParam extends CallbackParam { +interface AdStartedParam { creativetype: string; tag: string; } -interface AdPlayParam extends CallbackParam { +interface AdPlayParam { creativetype: string; newstate: string; oldstate: string; tag: string; } -interface BufferParam extends CallbackParam { +interface BufferParam { newstate: string; oldstate: string; reason: 'loading' | 'complete' | 'stalled' | 'error'; } -interface BufferChangeParam extends CallbackParam { +interface BufferChangeParam { duration: number; bufferPercent: number; position: number; metadata: any; } -interface AdTimeParam extends CallbackParam { +interface AdTimeParam { client: 'vast' | 'googima'; creativetype: string; duration: number; @@ -132,106 +129,106 @@ interface AdTimeParam extends CallbackParam { tag: string; } -interface AudioTracksParam extends CallbackParam { +interface AudioTracksParam { levels: any[]; } -interface CaptionsChangedParam extends CallbackParam { +interface CaptionsChangedParam { currentTrack: number; } -interface CaptionsListParam extends CallbackParam { +interface CaptionsListParam { tracks: any[]; } -interface AudioTrackChangedParam extends CallbackParam { +interface AudioTrackChangedParam { currentTrack: number; } -interface MetadataParam extends CallbackParam { +interface MetadataParam { metadata: any; } -interface ControlsParam extends CallbackParam { +interface ControlsParam { controls: boolean; } -interface ErrorParam extends CallbackParam { +interface ErrorParam { message: string; } -interface FullscreenParam extends CallbackParam { +interface FullscreenParam { fullscreen: boolean; } -interface IdleParam extends CallbackParam { +interface IdleParam { oldstate: 'buffering' | 'playing' | 'paused'; } -interface LevelsChangedParam extends CallbackParam { +interface LevelsChangedParam { currentQuality: number; } -interface MuteParam extends CallbackParam { +interface MuteParam { mute: boolean; } -interface VolumeParam extends CallbackParam { +interface VolumeParam { volume: boolean; } -interface PlayParam extends CallbackParam { +interface PlayParam { oldstate: 'buffering' | 'playing'; viewable: 0 | 1; } -interface PlaylistParam extends CallbackParam { +interface PlaylistParam { playlist: any[]; } -interface PlaylistItemParam extends CallbackParam { +interface PlaylistItemParam { index: number; item: any; } -interface ReadyParam extends CallbackParam { +interface ReadyParam { setupTime: number; viewable: 0 | 1; } -interface ResizeParam extends CallbackParam { +interface ResizeParam { width: number; height: number; } -interface VisualQualityParam extends CallbackParam { +interface VisualQualityParam { mode: string; label: string; reason: string; } -interface LevelsParam extends CallbackParam { +interface LevelsParam { width: number; levels: any[]; } -interface SeekParam extends CallbackParam { +interface SeekParam { position: number; offset: number; } -interface TimeParam extends CallbackParam { +interface TimeParam { duration: number; position: number; viewable: 0 | 1; } -interface FirstFrameParam extends CallbackParam { +interface FirstFrameParam { loadTime: number; viewable: 0 | 1; } -type EventCallback = (param: T) => void; +type EventCallback = (param: T) => void; interface Region { x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index 00e6c2de35..bccfd75eed 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -3,7 +3,6 @@ "rules": { "adjacent-overload-signatures": false, "dt-header": false, - "no-empty-interface": false, "one-line": false, "semicolon": false, "typedef-whitespace": false, From f749e81816921e49919b651750c2752b962bf5ff Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 09:04:50 +0000 Subject: [PATCH 311/646] Fix violations of 'oneline' lint rule. --- types/jwplayer/index.d.ts | 2 +- types/jwplayer/tslint.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index b8e18dcae6..1cc2114825 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -46,7 +46,7 @@ interface Features { iframe: boolean; } -interface Environment{ +interface Environment { Browser: Browser; OS: OS; Features: Features; diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index bccfd75eed..8a40d958c2 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -3,7 +3,6 @@ "rules": { "adjacent-overload-signatures": false, "dt-header": false, - "one-line": false, "semicolon": false, "typedef-whitespace": false, "unified-signatures": false From d3e941bbff9afb53286e27c84bd6a6ce19d7d129 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 09:11:13 +0000 Subject: [PATCH 312/646] Fix violations of 'semicolon' lint rule. --- types/jwplayer/index.d.ts | 4 ++-- types/jwplayer/tslint.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 1cc2114825..84937e2922 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -14,7 +14,7 @@ interface Version { version: string; major: number; - minor: number + minor: number; } interface Browser { @@ -461,7 +461,7 @@ interface JWPlayer { on(event: 'seeked', callback: () => void): void; once(event: 'seeked', callback: () => void): void; off(event: 'seeked'): void; - trigger(event: 'seeked'): void + trigger(event: 'seeked'): void; on(event: 'setupError', callback: EventCallback): void; once(event: 'setupError', callback: EventCallback): void; off(event: 'setupError'): void; diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index 8a40d958c2..ba09b4db63 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -3,7 +3,6 @@ "rules": { "adjacent-overload-signatures": false, "dt-header": false, - "semicolon": false, "typedef-whitespace": false, "unified-signatures": false } From bfa382bd5ac635cc6191772d616ecb51875f7ca3 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 09:17:49 +0000 Subject: [PATCH 313/646] Enable 'typedef-whitespace' lint rule. --- types/jwplayer/tslint.json | 1 - 1 file changed, 1 deletion(-) diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index ba09b4db63..4f841ccd2a 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -3,7 +3,6 @@ "rules": { "adjacent-overload-signatures": false, "dt-header": false, - "typedef-whitespace": false, "unified-signatures": false } } From c24032c6592f061b8360f0a6bb50166075891453 Mon Sep 17 00:00:00 2001 From: David Gomes Date: Fri, 11 Jan 2019 09:37:22 +0000 Subject: [PATCH 314/646] Fix analytics.page optional arguments. --- types/segment-analytics/index.d.ts | 2 +- .../segment-analytics-tests.ts | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/types/segment-analytics/index.d.ts b/types/segment-analytics/index.d.ts index 7c6949d58f..4456c36214 100644 --- a/types/segment-analytics/index.d.ts +++ b/types/segment-analytics/index.d.ts @@ -40,7 +40,7 @@ declare namespace SegmentAnalytics { /* The page method lets you record page views on your website, along with optional extra information about the page being viewed. */ - page(category: string, name: string, properties?: Object, + page(category?: string, name?: string, properties?: Object, options?: SegmentOpts, callback?: () => void): void; page(name?: string, properties?: Object, options?: SegmentOpts, callback?: () => void): void; diff --git a/types/segment-analytics/segment-analytics-tests.ts b/types/segment-analytics/segment-analytics-tests.ts index b4c81e7c75..a89dadbe39 100644 --- a/types/segment-analytics/segment-analytics-tests.ts +++ b/types/segment-analytics/segment-analytics-tests.ts @@ -79,6 +79,22 @@ function testPage() { analytics.page('Category', 'Signup'); + analytics.page(undefined, 'Signup'); + + analytics.page(undefined, undefined, { + title: 'Segment Pricing', + url: 'https://segment.com/pricing', + path: '/pricing', + referrer: 'https://segment.com' + }); + + analytics.page(undefined, 'Signup', { + title: 'Segment Pricing', + url: 'https://segment.com/pricing', + path: '/pricing', + referrer: 'https://segment.com' + }); + analytics.page('Signup', testProps, testOpts, testCb); } @@ -213,4 +229,4 @@ function testEmitter() { function testTimeout() { analytics.timeout(500); -} \ No newline at end of file +} From 27c9d9604bb263ba9c5010d0010b7344eb5b734a Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 09:40:49 +0000 Subject: [PATCH 315/646] Fix violations of 'unified-signatures' & 'adjacent-overload-signatures'. --- types/jwplayer/index.d.ts | 238 ++++++++----------------------------- types/jwplayer/tslint.json | 4 +- 2 files changed, 53 insertions(+), 189 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 84937e2922..42b39988fd 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -262,6 +262,50 @@ interface QualityLevel { reason: 'auto' | 'api' | 'initial choice'; } +interface EventParams { + adClick: AdProgressParam; + adCompanions: AdCompanionsParam; + adComplete: AdProgressParam; + adSkipped: AdProgressParam; + adError: AdErrorParam; + adRequest: AdRequestParam; + adSchedule: AdScheduleParam; + adStarted: AdStartedParam; + adImpression: AdImpressionParam; + adPlay: AdPlayParam; + adPause: AdPlayParam; + adTime: AdTimeParam; + meta: MetadataParam; + audioTracks: AudioTracksParam; + audioTrackChanged: AudioTrackChangedParam; + firstFrame: FirstFrameParam; + buffer: BufferParam; + bufferChange: BufferChangeParam; + captionsChanged: CaptionsChangedParam; + captionsList: CaptionsListParam; + controls: ControlsParam; + error: ErrorParam; + fullscreen: FullscreenParam; + idle: IdleParam; + levelsChanged: LevelsChangedParam; + mute: MuteParam; + volume: VolumeParam; + pause: PlayParam; + play: PlayParam; + playlist: PlaylistParam; + playlistItem: PlaylistItemParam; + ready: ReadyParam; + resize: ResizeParam; + visualQuality: VisualQualityParam; + levels: LevelsParam; + seek: SeekParam; + setupError: ErrorParam; + time: TimeParam; +} + +type NoParamEvent = 'adBlock' | 'beforeComplete' | 'complete' | 'beforePlay' | 'displayClick' | 'playlistComplete' + | 'seeked' | 'remove'; + interface JWPlayer { addButton(icon: string, label: string, handler: () => void, id: string): void; getAudioTracks(): any[]; @@ -288,192 +332,14 @@ interface JWPlayer { getEnvironment(): Environment; getWidth(): number; getVisualQuality(): QualityLevel | undefined; - load(playlist: any[]): void; - load(playlist: string): void; - on(event: 'adClick', callback: EventCallback): void; - once(event: 'adClick', callback: EventCallback): void; - off(event: 'adClick'): void; - trigger(event: 'adClick', args: AdProgressParam): void; - on(event: 'adCompanions', callback: EventCallback): void; - once(event: 'adCompanions', callback: EventCallback): void; - off(event: 'adCompanions'): void; - trigger(event: 'adCompanions', args: AdCompanionsParam): void; - on(event: 'adComplete', callback: EventCallback): void; - once(event: 'adComplete', callback: EventCallback): void; - off(event: 'adComplete'): void; - trigger(event: 'adComplete', args: AdProgressParam): void; - on(event: 'adSkipped', callback: EventCallback): void; - once(event: 'adSkipped', callback: EventCallback): void; - off(event: 'adSkipped'): void; - trigger(event: 'adSkipped', args: AdProgressParam): void; - on(event: 'adError', callback: EventCallback): void; - once(event: 'adError', callback: EventCallback): void; - off(event: 'adError'): void; - trigger(event: 'adError', args: AdErrorParam): void; - on(event: 'adBlock', callback: () => void): void; - once(event: 'adBlock', callback: () => void): void; - off(event: 'adBlock'): void; - trigger(event: 'adBlock'): void; - on(event: 'adRequest', callback: EventCallback): void; - once(event: 'adRequest', callback: EventCallback): void; - off(event: 'adRequest'): void; - trigger(event: 'adRequest', args: AdRequestParam): void; - on(event: 'adSchedule', callback: EventCallback): void; - once(event: 'adSchedule', callback: EventCallback): void; - off(event: 'adSchedule'): void; - trigger(event: 'adSchedule', args: AdScheduleParam): void; - on(event: 'adStarted', callback: EventCallback): void; - once(event: 'adStarted', callback: EventCallback): void; - off(event: 'adStarted'): void; - trigger(event: 'adStarted', args: AdStartedParam): void; - on(event: 'adImpression', callback: EventCallback): void; - once(event: 'adImpression', callback: EventCallback): void; - off(event: 'adImpression'): void; - trigger(event: 'adImpression', args: AdImpressionParam): void; - on(event: 'adPlay', callback: EventCallback): void; - once(event: 'adPlay', callback: EventCallback): void; - off(event: 'adPlay'): void; - trigger(event: 'adPlay', args: AdPlayParam): void; - on(event: 'adPause', callback: EventCallback): void; - once(event: 'adPause', callback: EventCallback): void; - off(event: 'adPause'): void; - trigger(event: 'adPause', args: AdPlayParam): void; - on(event: 'adTime', callback: EventCallback): void; - once(event: 'adTime', callback: EventCallback): void; - off(event: 'adTime'): void; - trigger(event: 'adTime', args: AdTimeParam): void; - on(event: 'meta', callback: EventCallback): void; - once(event: 'meta', callback: EventCallback): void; - off(event: 'meta'): void; - trigger(event: 'meta', args: MetadataParam): void; - on(event: 'audioTracks', callback: EventCallback): void; - once(event: 'audioTracks', callback: EventCallback): void; - off(event: 'audioTracks'): void; - trigger(event: 'audioTracks', args: AudioTracksParam): void; - on(event: 'audioTrackChanged', callback: EventCallback): void; - once(event: 'audioTrackChanged', callback: EventCallback): void; - off(event: 'audioTrackChanged'): void; - trigger(event: 'audioTrackChanged', args: AudioTrackChangedParam): void; - on(event: 'beforeComplete', callback: () => void): void; - once(event: 'beforeComplete', callback: () => void): void; - off(event: 'beforeComplete'): void; - trigger(event: 'beforeComplete'): void; - on(event: 'complete', callback: () => void): void; - once(event: 'complete', callback: () => void): void; - off(event: 'complete'): void; - trigger(event: 'complete'): void; - on(event: 'firstFrame', callback: EventCallback): void; - once(event: 'firstFrame', callback: EventCallback): void; - off(event: 'firstFrame'): void; - trigger(event: 'firstFrame', args: FirstFrameParam): void; - on(event: 'beforePlay', callback: () => void): void; - once(event: 'beforePlay', callback: () => void): void; - off(event: 'beforePlay'): void; - trigger(event: 'beforePlay'): void; - on(event: 'buffer', callback: EventCallback): void; - once(event: 'buffer', callback: EventCallback): void; - off(event: 'buffer'): void; - trigger(event: 'buffer', args: BufferParam): void; - on(event: 'bufferChange', callback: EventCallback): void; - once(event: 'bufferChange', callback: EventCallback): void; - off(event: 'bufferChange'): void; - trigger(event: 'bufferChange', args: BufferChangeParam): void; - on(event: 'captionsChanged', callback: EventCallback): void; - once(event: 'captionsChanged', callback: EventCallback): void; - off(event: 'captionsChanged'): void; - trigger(event: 'captionsChanged', args: CaptionsChangedParam): void; - on(event: 'captionsList', callback: EventCallback): void; - once(event: 'captionsList', callback: EventCallback): void; - off(event: 'captionsList'): void; - trigger(event: 'captionsList', args: CaptionsListParam): void; - on(event: 'controls', callback: EventCallback): void; - once(event: 'controls', callback: EventCallback): void; - off(event: 'controls'): void; - trigger(event: 'controls', args: ControlsParam): void; - on(event: 'displayClick', callback: () => void): void; - once(event: 'displayClick', callback: () => void): void; - off(event: 'displayClick'): void; - trigger(event: 'displayClick'): void; - on(event: 'error', callback: EventCallback): void; - once(event: 'error', callback: EventCallback): void; - off(event: 'error'): void; - trigger(event: 'error', args: ErrorParam): void; - on(event: 'fullscreen', callback: EventCallback): void; - once(event: 'fullscreen', callback: EventCallback): void; - off(event: 'fullscreen'): void; - trigger(event: 'fullscreen', args: FullscreenParam): void; - on(event: 'idle', callback: EventCallback): void; - once(event: 'idle', callback: EventCallback): void; - off(event: 'idle'): void; - trigger(event: 'idle', args: IdleParam): void; - on(event: 'levelsChanged', callback: EventCallback): void; - once(event: 'levelsChanged', callback: EventCallback): void; - off(event: 'levelsChanged'): void; - trigger(event: 'levelsChanged', args: LevelsChangedParam): void; - on(event: 'mute', callback: EventCallback): void; - once(event: 'mute', callback: EventCallback): void; - off(event: 'mute'): void; - trigger(event: 'mute', args: MuteParam): void; - on(event: 'volume', callback: EventCallback): void; - once(event: 'volume', callback: EventCallback): void; - off(event: 'volume'): void; - trigger(event: 'volume', args: VolumeParam): void; - on(event: 'pause', callback: EventCallback): void; - once(event: 'pause', callback: EventCallback): void; - off(event: 'pause'): void; - trigger(event: 'pause', args: PlayParam): void; - on(event: 'play', callback: EventCallback): void; - once(event: 'play', callback: EventCallback): void; - off(event: 'play'): void; - trigger(event: 'play', args: PlayParam): void; - on(event: 'playlist', callback: EventCallback): void; - once(event: 'playlist', callback: EventCallback): void; - off(event: 'playlist'): void; - trigger(event: 'playlist', args: PlaylistParam): void; - on(event: 'playlistItem', callback: EventCallback): void; - once(event: 'playlistItem', callback: EventCallback): void; - off(event: 'playlistItem'): void; - trigger(event: 'playlistItem', args: PlaylistItemParam): void; - on(event: 'playlistComplete', callback: () => void): void; - once(event: 'playlistComplete', callback: () => void): void; - off(event: 'playlistComplete'): void; - trigger(event: 'playlistComplete'): void; - on(event: 'ready', callback: EventCallback): void; - once(event: 'ready', callback: EventCallback): void; - off(event: 'ready'): void; - trigger(event: 'ready'): void; - on(event: 'resize', callback: EventCallback): void; - once(event: 'resize', callback: EventCallback): void; - off(event: 'resize'): void; - trigger(event: 'resize', args: ResizeParam): void; - on(event: 'visualQuality', callback: EventCallback): void; - once(event: 'visualQuality', callback: EventCallback): void; - off(event: 'visualQuality'): void; - trigger(event: 'visualQuality', args: VisualQualityParam): void; - on(event: 'levels', callback: EventCallback): void; - once(event: 'levels', callback: EventCallback): void; - off(event: 'levels'): void; - trigger(event: 'levels', args: LevelsParam): void; - on(event: 'seek', callback: EventCallback): void; - once(event: 'seek', callback: EventCallback): void; - off(event: 'seek'): void; - trigger(event: 'seek', args: SeekParam): void; - on(event: 'seeked', callback: () => void): void; - once(event: 'seeked', callback: () => void): void; - off(event: 'seeked'): void; - trigger(event: 'seeked'): void; - on(event: 'setupError', callback: EventCallback): void; - once(event: 'setupError', callback: EventCallback): void; - off(event: 'setupError'): void; - trigger(event: 'setupError', args: ErrorParam): void; - on(event: 'remove', callback: () => void): void; - once(event: 'remove', callback: () => void): void; - off(event: 'remove'): void; - trigger(event: 'remove'): void; - on(event: 'time', callback: EventCallback): void; - once(event: 'time', callback: EventCallback): void; - off(event: 'time'): void; - trigger(event: 'time', args: TimeParam): void; + load(playlist: any[] | string): void; + on(event: TEvent, callback: EventCallback): void; + on(event: NoParamEvent, callback: () => void): void; + once(event: TEvent, callback: EventCallback): void; + once(event: NoParamEvent, callback: () => void): void; + off(event: keyof EventParams | NoParamEvent): void; + trigger(event: TEvent, args: EventParams[TEvent]): void; + trigger(event: NoParamEvent): void; pause(state?: boolean): void; play(state?: boolean): void; playAd(tag: string): void; diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index 4f841ccd2a..65c83fb1e3 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -1,8 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "dt-header": false, - "unified-signatures": false + "dt-header": false } } From 5837145fd6cf1849fb6e1b91d50379cd6ae8136b Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 09:45:44 +0000 Subject: [PATCH 316/646] Fix violations of 'dt-header' lint rule. --- types/jwplayer/index.d.ts | 6 +++--- types/jwplayer/tslint.json | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 42b39988fd..824dee4669 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for JW Player V8.2 -// Project: https://github.com/jwplayer/jwplayer/ +// Type definitions for JW Player 8.2 +// Project: https://github.com/jwplayer/jwplayer // Definitions by: Martin Duparc // Tomer Kruvi // Philipp Gürtler // Daniel McGraw // Benjamin Dobson -// Be Birchall +// Be Birchall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index 65c83fb1e3..f93cf8562a 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "dt-header": false - } + "extends": "dtslint/dt.json" } From 4bc648fb0a462a908501cbf10c3c2e43ad2857d1 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 09:46:08 +0000 Subject: [PATCH 317/646] Add self to authors. --- types/jwplayer/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 824dee4669..0ff7246202 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -6,6 +6,7 @@ // Daniel McGraw // Benjamin Dobson // Be Birchall +// Daniel Cassidy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 From 1f5e81eed94bf596fbde404b092aae46f7491da2 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 10:05:33 +0000 Subject: [PATCH 318/646] Improve type definition for jwplayer() function. This function accepts a string element id, a numeric JW Player instance index, or a DOM element. It can also be omitted to select the first JW Player instance. --- types/jwplayer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 0ff7246202..10f1ac269b 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -363,7 +363,7 @@ interface JWPlayer { } interface JWPlayerStatic { - (id: string): JWPlayer; + (query?: string | number | Element): JWPlayer; key: string; version: string; } From 0ed3ff1ab3ab9afe9ebb9b4eb73d6badab17e6f7 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 10:22:59 +0000 Subject: [PATCH 319/646] Fix inconsistent indentation: always use four spaces. --- types/jwplayer/index.d.ts | 184 +++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 10f1ac269b..2a16cd4769 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -264,108 +264,108 @@ interface QualityLevel { } interface EventParams { - adClick: AdProgressParam; - adCompanions: AdCompanionsParam; - adComplete: AdProgressParam; - adSkipped: AdProgressParam; - adError: AdErrorParam; - adRequest: AdRequestParam; - adSchedule: AdScheduleParam; - adStarted: AdStartedParam; - adImpression: AdImpressionParam; - adPlay: AdPlayParam; - adPause: AdPlayParam; - adTime: AdTimeParam; - meta: MetadataParam; - audioTracks: AudioTracksParam; - audioTrackChanged: AudioTrackChangedParam; - firstFrame: FirstFrameParam; - buffer: BufferParam; - bufferChange: BufferChangeParam; - captionsChanged: CaptionsChangedParam; - captionsList: CaptionsListParam; - controls: ControlsParam; - error: ErrorParam; - fullscreen: FullscreenParam; - idle: IdleParam; - levelsChanged: LevelsChangedParam; - mute: MuteParam; - volume: VolumeParam; - pause: PlayParam; - play: PlayParam; - playlist: PlaylistParam; - playlistItem: PlaylistItemParam; - ready: ReadyParam; - resize: ResizeParam; - visualQuality: VisualQualityParam; - levels: LevelsParam; - seek: SeekParam; - setupError: ErrorParam; - time: TimeParam; + adClick: AdProgressParam; + adCompanions: AdCompanionsParam; + adComplete: AdProgressParam; + adSkipped: AdProgressParam; + adError: AdErrorParam; + adRequest: AdRequestParam; + adSchedule: AdScheduleParam; + adStarted: AdStartedParam; + adImpression: AdImpressionParam; + adPlay: AdPlayParam; + adPause: AdPlayParam; + adTime: AdTimeParam; + meta: MetadataParam; + audioTracks: AudioTracksParam; + audioTrackChanged: AudioTrackChangedParam; + firstFrame: FirstFrameParam; + buffer: BufferParam; + bufferChange: BufferChangeParam; + captionsChanged: CaptionsChangedParam; + captionsList: CaptionsListParam; + controls: ControlsParam; + error: ErrorParam; + fullscreen: FullscreenParam; + idle: IdleParam; + levelsChanged: LevelsChangedParam; + mute: MuteParam; + volume: VolumeParam; + pause: PlayParam; + play: PlayParam; + playlist: PlaylistParam; + playlistItem: PlaylistItemParam; + ready: ReadyParam; + resize: ResizeParam; + visualQuality: VisualQualityParam; + levels: LevelsParam; + seek: SeekParam; + setupError: ErrorParam; + time: TimeParam; } type NoParamEvent = 'adBlock' | 'beforeComplete' | 'complete' | 'beforePlay' | 'displayClick' | 'playlistComplete' - | 'seeked' | 'remove'; + | 'seeked' | 'remove'; interface JWPlayer { - addButton(icon: string, label: string, handler: () => void, id: string): void; - getAudioTracks(): any[]; - getBuffer(): number; - getCaptionsList(): any[]; - getControls(): boolean; - getCurrentAudioTrack(): number; - getCurrentCaptions(): number; - getCurrentQuality(): number; - getDuration(): number; - getHeight(): number; - getFullscreen(): boolean; - getMute(): boolean; - getPlaylist(): any[]; - getPlaylistIndex(): number; - getPlaylistItem(index?: number): any; - getPosition(): number; - getQualityLevels(): any[]; - getRenderingMode(): string; - getSafeRegion(): Region; - getState(): string; - getVolume(): number; - getContainer(): HTMLElement; - getEnvironment(): Environment; - getWidth(): number; + addButton(icon: string, label: string, handler: () => void, id: string): void; + getAudioTracks(): any[]; + getBuffer(): number; + getCaptionsList(): any[]; + getControls(): boolean; + getCurrentAudioTrack(): number; + getCurrentCaptions(): number; + getCurrentQuality(): number; + getDuration(): number; + getHeight(): number; + getFullscreen(): boolean; + getMute(): boolean; + getPlaylist(): any[]; + getPlaylistIndex(): number; + getPlaylistItem(index?: number): any; + getPosition(): number; + getQualityLevels(): any[]; + getRenderingMode(): string; + getSafeRegion(): Region; + getState(): string; + getVolume(): number; + getContainer(): HTMLElement; + getEnvironment(): Environment; + getWidth(): number; getVisualQuality(): QualityLevel | undefined; - load(playlist: any[] | string): void; - on(event: TEvent, callback: EventCallback): void; - on(event: NoParamEvent, callback: () => void): void; - once(event: TEvent, callback: EventCallback): void; - once(event: NoParamEvent, callback: () => void): void; - off(event: keyof EventParams | NoParamEvent): void; - trigger(event: TEvent, args: EventParams[TEvent]): void; - trigger(event: NoParamEvent): void; - pause(state?: boolean): void; - play(state?: boolean): void; - playAd(tag: string): void; - playlistItem(index: number): void; - registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; - remove(): void; - removeButton(id: string): void; - resize(width: number, height: number): void; - seek(position: number): void; - setControls(controls: boolean): void; - setCurrentAudioTrack(index: number): void; - setCurrentCaptions(index: number): void; - setCurrentQuality(index: number): void; - setFullscreen(state: boolean): void; - setMute(state?: boolean): void; - setup(options: any): JWPlayer; - setVolume(volume: number): void; + load(playlist: any[] | string): void; + on(event: TEvent, callback: EventCallback): void; + on(event: NoParamEvent, callback: () => void): void; + once(event: TEvent, callback: EventCallback): void; + once(event: NoParamEvent, callback: () => void): void; + off(event: keyof EventParams | NoParamEvent): void; + trigger(event: TEvent, args: EventParams[TEvent]): void; + trigger(event: NoParamEvent): void; + pause(state?: boolean): void; + play(state?: boolean): void; + playAd(tag: string): void; + playlistItem(index: number): void; + registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; + remove(): void; + removeButton(id: string): void; + resize(width: number, height: number): void; + seek(position: number): void; + setControls(controls: boolean): void; + setCurrentAudioTrack(index: number): void; + setCurrentCaptions(index: number): void; + setCurrentQuality(index: number): void; + setFullscreen(state: boolean): void; + setMute(state?: boolean): void; + setup(options: any): JWPlayer; + setVolume(volume: number): void; setCaptions(options: CaptionOptions): void; - stop(): void; + stop(): void; } interface JWPlayerStatic { - (query?: string | number | Element): JWPlayer; - key: string; - version: string; + (query?: string | number | Element): JWPlayer; + key: string; + version: string; } declare const jwplayer: JWPlayerStatic; From 1c3b62674fb16a118c1335d9df721ad5407b08f7 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 11 Jan 2019 11:24:36 +0000 Subject: [PATCH 320/646] Move all types into the jwplayer namespace. To avoid polluting the global namespace with hundreds of types specific to JW Player. --- types/jwplayer/index.d.ts | 712 +++++++++++++++++++------------------- 1 file changed, 357 insertions(+), 355 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 2a16cd4769..05d9c50aa6 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -12,360 +12,362 @@ // JW Player is the leading HTML5 & Flash video player, optimized for mobile and the desktop. Easy enough for beginners, advanced enough for pros. -interface Version { - version: string; - major: number; - minor: number; +declare namespace jwplayer { + interface Version { + version: string; + major: number; + minor: number; + } + + interface Browser { + chrome: boolean; + edge: boolean; + facebook: boolean; + firefox: boolean; + ie: boolean; + msie: boolean; + safari: boolean; + version: Version; + } + + interface OS { + android: boolean; + androidNative: boolean; // Android native browser + iOS: boolean; + mobile: boolean; + mac: boolean; + iPad: boolean; + iPhone: boolean; + windows: boolean; + version: Version; + } + + interface Features { + flash: boolean; + flashVersion: number; + iframe: boolean; + } + + interface Environment { + Browser: Browser; + OS: OS; + Features: Features; + } + + interface AdProgressParam { + client: 'vast' | 'googima'; + creativetype: string; + tag: string; + } + + interface AdCompanionsParam { + companions: any[]; + tag: string; + } + + interface AdErrorParam { + message: string; + tag: string; + } + + interface AdRequestParam { + adposition: 'pre' | 'mid' | 'post'; + client: 'vast' | 'googima'; + offset: 'pre' | 'mid' | 'post'; + tag: string; + } + + interface AdImpressionParam { + adposition: 'pre' | 'mid' | 'post'; + adsystem: string; + adtitle: string; + clickThroughUrl: string; + client: 'vast' | 'googima'; + creativetype: string; + linear: string; + mediafile: any; + tag: string; + vastversion: number; + wrapper: any[]; + } + + interface AdScheduleParam { + tag: string; + client: string; + adbreaks: object[]; + } + + interface AdStartedParam { + creativetype: string; + tag: string; + } + + interface AdPlayParam { + creativetype: string; + newstate: string; + oldstate: string; + tag: string; + } + + interface BufferParam { + newstate: string; + oldstate: string; + reason: 'loading' | 'complete' | 'stalled' | 'error'; + } + + interface BufferChangeParam { + duration: number; + bufferPercent: number; + position: number; + metadata: any; + } + + interface AdTimeParam { + client: 'vast' | 'googima'; + creativetype: string; + duration: number; + position: number; + sequence: number; + tag: string; + } + + interface AudioTracksParam { + levels: any[]; + } + + interface CaptionsChangedParam { + currentTrack: number; + } + + interface CaptionsListParam { + tracks: any[]; + } + + interface AudioTrackChangedParam { + currentTrack: number; + } + + interface MetadataParam { + metadata: any; + } + + interface ControlsParam { + controls: boolean; + } + + interface ErrorParam { + message: string; + } + + interface FullscreenParam { + fullscreen: boolean; + } + + interface IdleParam { + oldstate: 'buffering' | 'playing' | 'paused'; + } + + interface LevelsChangedParam { + currentQuality: number; + } + + interface MuteParam { + mute: boolean; + } + + interface VolumeParam { + volume: boolean; + } + + interface PlayParam { + oldstate: 'buffering' | 'playing'; + viewable: 0 | 1; + } + + interface PlaylistParam { + playlist: any[]; + } + + interface PlaylistItemParam { + index: number; + item: any; + } + + interface ReadyParam { + setupTime: number; + viewable: 0 | 1; + } + + interface ResizeParam { + width: number; + height: number; + } + + interface VisualQualityParam { + mode: string; + label: string; + reason: string; + } + + interface LevelsParam { + width: number; + levels: any[]; + } + + interface SeekParam { + position: number; + offset: number; + } + + interface TimeParam { + duration: number; + position: number; + viewable: 0 | 1; + } + + interface FirstFrameParam { + loadTime: number; + viewable: 0 | 1; + } + + type EventCallback = (param: T) => void; + + interface Region { + x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion + y: 0; + width: number; + height: number; + } + + interface CaptionOptions { + color: string; + fontSize: number; + fontFamily: string; + fontOpacity: number; + backgroundColor: string; + backgroundOpacity: number; + edgeStyle: string; + windowColor: string; + windowOpacity: number; + } + + interface Level { + bitrate: number; + height: number; + width: number; + label: string; + } + + interface QualityLevel { + mode: 'auto' | 'manual'; + level: Level; + reason: 'auto' | 'api' | 'initial choice'; + } + + interface EventParams { + adClick: AdProgressParam; + adCompanions: AdCompanionsParam; + adComplete: AdProgressParam; + adSkipped: AdProgressParam; + adError: AdErrorParam; + adRequest: AdRequestParam; + adSchedule: AdScheduleParam; + adStarted: AdStartedParam; + adImpression: AdImpressionParam; + adPlay: AdPlayParam; + adPause: AdPlayParam; + adTime: AdTimeParam; + meta: MetadataParam; + audioTracks: AudioTracksParam; + audioTrackChanged: AudioTrackChangedParam; + firstFrame: FirstFrameParam; + buffer: BufferParam; + bufferChange: BufferChangeParam; + captionsChanged: CaptionsChangedParam; + captionsList: CaptionsListParam; + controls: ControlsParam; + error: ErrorParam; + fullscreen: FullscreenParam; + idle: IdleParam; + levelsChanged: LevelsChangedParam; + mute: MuteParam; + volume: VolumeParam; + pause: PlayParam; + play: PlayParam; + playlist: PlaylistParam; + playlistItem: PlaylistItemParam; + ready: ReadyParam; + resize: ResizeParam; + visualQuality: VisualQualityParam; + levels: LevelsParam; + seek: SeekParam; + setupError: ErrorParam; + time: TimeParam; + } + + type NoParamEvent = 'adBlock' | 'beforeComplete' | 'complete' | 'beforePlay' | 'displayClick' | 'playlistComplete' + | 'seeked' | 'remove'; + + interface JWPlayer { + addButton(icon: string, label: string, handler: () => void, id: string): void; + getAudioTracks(): any[]; + getBuffer(): number; + getCaptionsList(): any[]; + getControls(): boolean; + getCurrentAudioTrack(): number; + getCurrentCaptions(): number; + getCurrentQuality(): number; + getDuration(): number; + getHeight(): number; + getFullscreen(): boolean; + getMute(): boolean; + getPlaylist(): any[]; + getPlaylistIndex(): number; + getPlaylistItem(index?: number): any; + getPosition(): number; + getQualityLevels(): any[]; + getRenderingMode(): string; + getSafeRegion(): Region; + getState(): string; + getVolume(): number; + getContainer(): HTMLElement; + getEnvironment(): Environment; + getWidth(): number; + getVisualQuality(): QualityLevel | undefined; + load(playlist: any[] | string): void; + on(event: TEvent, callback: EventCallback): void; + on(event: NoParamEvent, callback: () => void): void; + once(event: TEvent, callback: EventCallback): void; + once(event: NoParamEvent, callback: () => void): void; + off(event: keyof EventParams | NoParamEvent): void; + trigger(event: TEvent, args: EventParams[TEvent]): void; + trigger(event: NoParamEvent): void; + pause(state?: boolean): void; + play(state?: boolean): void; + playAd(tag: string): void; + playlistItem(index: number): void; + registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; + remove(): void; + removeButton(id: string): void; + resize(width: number, height: number): void; + seek(position: number): void; + setControls(controls: boolean): void; + setCurrentAudioTrack(index: number): void; + setCurrentCaptions(index: number): void; + setCurrentQuality(index: number): void; + setFullscreen(state: boolean): void; + setMute(state?: boolean): void; + setup(options: any): JWPlayer; + setVolume(volume: number): void; + setCaptions(options: CaptionOptions): void; + stop(): void; + } + + interface JWPlayerStatic { + (query?: string | number | Element): JWPlayer; + key: string; + version: string; + } } -interface Browser { - chrome: boolean; - edge: boolean; - facebook: boolean; - firefox: boolean; - ie: boolean; - msie: boolean; - safari: boolean; - version: Version; -} - -interface OS { - android: boolean; - androidNative: boolean; // Android native browser - iOS: boolean; - mobile: boolean; - mac: boolean; - iPad: boolean; - iPhone: boolean; - windows: boolean; - version: Version; -} - -interface Features { - flash: boolean; - flashVersion: number; - iframe: boolean; -} - -interface Environment { - Browser: Browser; - OS: OS; - Features: Features; -} - -interface AdProgressParam { - client: 'vast' | 'googima'; - creativetype: string; - tag: string; -} - -interface AdCompanionsParam { - companions: any[]; - tag: string; -} - -interface AdErrorParam { - message: string; - tag: string; -} - -interface AdRequestParam { - adposition: 'pre' | 'mid' | 'post'; - client: 'vast' | 'googima'; - offset: 'pre' | 'mid' | 'post'; - tag: string; -} - -interface AdImpressionParam { - adposition: 'pre' | 'mid' | 'post'; - adsystem: string; - adtitle: string; - clickThroughUrl: string; - client: 'vast' | 'googima'; - creativetype: string; - linear: string; - mediafile: any; - tag: string; - vastversion: number; - wrapper: any[]; -} - -interface AdScheduleParam { - tag: string; - client: string; - adbreaks: object[]; -} - -interface AdStartedParam { - creativetype: string; - tag: string; -} - -interface AdPlayParam { - creativetype: string; - newstate: string; - oldstate: string; - tag: string; -} - -interface BufferParam { - newstate: string; - oldstate: string; - reason: 'loading' | 'complete' | 'stalled' | 'error'; -} - -interface BufferChangeParam { - duration: number; - bufferPercent: number; - position: number; - metadata: any; -} - -interface AdTimeParam { - client: 'vast' | 'googima'; - creativetype: string; - duration: number; - position: number; - sequence: number; - tag: string; -} - -interface AudioTracksParam { - levels: any[]; -} - -interface CaptionsChangedParam { - currentTrack: number; -} - -interface CaptionsListParam { - tracks: any[]; -} - -interface AudioTrackChangedParam { - currentTrack: number; -} - -interface MetadataParam { - metadata: any; -} - -interface ControlsParam { - controls: boolean; -} - -interface ErrorParam { - message: string; -} - -interface FullscreenParam { - fullscreen: boolean; -} - -interface IdleParam { - oldstate: 'buffering' | 'playing' | 'paused'; -} - -interface LevelsChangedParam { - currentQuality: number; -} - -interface MuteParam { - mute: boolean; -} - -interface VolumeParam { - volume: boolean; -} - -interface PlayParam { - oldstate: 'buffering' | 'playing'; - viewable: 0 | 1; -} - -interface PlaylistParam { - playlist: any[]; -} - -interface PlaylistItemParam { - index: number; - item: any; -} - -interface ReadyParam { - setupTime: number; - viewable: 0 | 1; -} - -interface ResizeParam { - width: number; - height: number; -} - -interface VisualQualityParam { - mode: string; - label: string; - reason: string; -} - -interface LevelsParam { - width: number; - levels: any[]; -} - -interface SeekParam { - position: number; - offset: number; -} - -interface TimeParam { - duration: number; - position: number; - viewable: 0 | 1; -} - -interface FirstFrameParam { - loadTime: number; - viewable: 0 | 1; -} - -type EventCallback = (param: T) => void; - -interface Region { - x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion - y: 0; - width: number; - height: number; -} - -interface CaptionOptions { - color: string; - fontSize: number; - fontFamily: string; - fontOpacity: number; - backgroundColor: string; - backgroundOpacity: number; - edgeStyle: string; - windowColor: string; - windowOpacity: number; -} - -interface Level { - bitrate: number; - height: number; - width: number; - label: string; -} - -interface QualityLevel { - mode: 'auto' | 'manual'; - level: Level; - reason: 'auto' | 'api' | 'initial choice'; -} - -interface EventParams { - adClick: AdProgressParam; - adCompanions: AdCompanionsParam; - adComplete: AdProgressParam; - adSkipped: AdProgressParam; - adError: AdErrorParam; - adRequest: AdRequestParam; - adSchedule: AdScheduleParam; - adStarted: AdStartedParam; - adImpression: AdImpressionParam; - adPlay: AdPlayParam; - adPause: AdPlayParam; - adTime: AdTimeParam; - meta: MetadataParam; - audioTracks: AudioTracksParam; - audioTrackChanged: AudioTrackChangedParam; - firstFrame: FirstFrameParam; - buffer: BufferParam; - bufferChange: BufferChangeParam; - captionsChanged: CaptionsChangedParam; - captionsList: CaptionsListParam; - controls: ControlsParam; - error: ErrorParam; - fullscreen: FullscreenParam; - idle: IdleParam; - levelsChanged: LevelsChangedParam; - mute: MuteParam; - volume: VolumeParam; - pause: PlayParam; - play: PlayParam; - playlist: PlaylistParam; - playlistItem: PlaylistItemParam; - ready: ReadyParam; - resize: ResizeParam; - visualQuality: VisualQualityParam; - levels: LevelsParam; - seek: SeekParam; - setupError: ErrorParam; - time: TimeParam; -} - -type NoParamEvent = 'adBlock' | 'beforeComplete' | 'complete' | 'beforePlay' | 'displayClick' | 'playlistComplete' - | 'seeked' | 'remove'; - -interface JWPlayer { - addButton(icon: string, label: string, handler: () => void, id: string): void; - getAudioTracks(): any[]; - getBuffer(): number; - getCaptionsList(): any[]; - getControls(): boolean; - getCurrentAudioTrack(): number; - getCurrentCaptions(): number; - getCurrentQuality(): number; - getDuration(): number; - getHeight(): number; - getFullscreen(): boolean; - getMute(): boolean; - getPlaylist(): any[]; - getPlaylistIndex(): number; - getPlaylistItem(index?: number): any; - getPosition(): number; - getQualityLevels(): any[]; - getRenderingMode(): string; - getSafeRegion(): Region; - getState(): string; - getVolume(): number; - getContainer(): HTMLElement; - getEnvironment(): Environment; - getWidth(): number; - getVisualQuality(): QualityLevel | undefined; - load(playlist: any[] | string): void; - on(event: TEvent, callback: EventCallback): void; - on(event: NoParamEvent, callback: () => void): void; - once(event: TEvent, callback: EventCallback): void; - once(event: NoParamEvent, callback: () => void): void; - off(event: keyof EventParams | NoParamEvent): void; - trigger(event: TEvent, args: EventParams[TEvent]): void; - trigger(event: NoParamEvent): void; - pause(state?: boolean): void; - play(state?: boolean): void; - playAd(tag: string): void; - playlistItem(index: number): void; - registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; - remove(): void; - removeButton(id: string): void; - resize(width: number, height: number): void; - seek(position: number): void; - setControls(controls: boolean): void; - setCurrentAudioTrack(index: number): void; - setCurrentCaptions(index: number): void; - setCurrentQuality(index: number): void; - setFullscreen(state: boolean): void; - setMute(state?: boolean): void; - setup(options: any): JWPlayer; - setVolume(volume: number): void; - setCaptions(options: CaptionOptions): void; - stop(): void; -} - -interface JWPlayerStatic { - (query?: string | number | Element): JWPlayer; - key: string; - version: string; -} - -declare const jwplayer: JWPlayerStatic; +declare const jwplayer: jwplayer.JWPlayerStatic; From 3991362524d84d28e42153ea2ee7302baae90632 Mon Sep 17 00:00:00 2001 From: Joanna Zakrzewska <816004+Silhoue@users.noreply.github.com> Date: Fri, 11 Jan 2019 12:55:13 +0100 Subject: [PATCH 321/646] Add optional orientation field --- types/image-size/image-size-tests.ts | 4 ++-- types/image-size/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/image-size/image-size-tests.ts b/types/image-size/image-size-tests.ts index 058ed7934f..633169105d 100644 --- a/types/image-size/image-size-tests.ts +++ b/types/image-size/image-size-tests.ts @@ -4,11 +4,11 @@ import sizeOf = require("image-size"); // Synchronous const dimensions = sizeOf("images/funny-cats.png"); -console.log(dimensions.width, dimensions.height); +console.log(dimensions.width, dimensions.height, dimensions.orientation); // Asynchronous sizeOf("images/funny-cats.png", (err, dimensions) => { - console.log(dimensions.width, dimensions.height); + console.log(dimensions.width, dimensions.height, dimensions.orientation); }); // From URL diff --git a/types/image-size/index.d.ts b/types/image-size/index.d.ts index 9e8681d514..51540c8fe5 100644 --- a/types/image-size/index.d.ts +++ b/types/image-size/index.d.ts @@ -6,11 +6,11 @@ /// - interface ImageInfo { width: number; height: number; type: string; + orientation?: number; } declare function sizeOf(path: string): ImageInfo; From 4dcb353f165e290ccda17c0a7ee301b49e18a1d4 Mon Sep 17 00:00:00 2001 From: Joanna Zakrzewska <816004+Silhoue@users.noreply.github.com> Date: Fri, 11 Jan 2019 13:25:06 +0100 Subject: [PATCH 322/646] Fix lint errors --- types/image-size/index.d.ts | 7 +-- types/image-size/tsconfig.json | 2 +- types/image-size/tslint.json | 78 +--------------------------------- 3 files changed, 4 insertions(+), 83 deletions(-) diff --git a/types/image-size/index.d.ts b/types/image-size/index.d.ts index 51540c8fe5..443c319fb2 100644 --- a/types/image-size/index.d.ts +++ b/types/image-size/index.d.ts @@ -1,11 +1,10 @@ -// Type definitions for image-size +// Type definitions for image-size 0.7 // Project: https://github.com/image-size/image-size // Definitions by: Elisée MAURER // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - interface ImageInfo { width: number; height: number; @@ -13,11 +12,9 @@ interface ImageInfo { orientation?: number; } -declare function sizeOf(path: string): ImageInfo; +declare function sizeOf(pathOrBuffer: string | Buffer): ImageInfo; declare function sizeOf(path: string, callback: (err: Error, dimensions: ImageInfo) => void): void; -declare function sizeOf(buffer: Buffer): ImageInfo; - declare namespace sizeOf { } export = sizeOf; diff --git a/types/image-size/tsconfig.json b/types/image-size/tsconfig.json index 7a864603b7..7c8d0db7d1 100644 --- a/types/image-size/tsconfig.json +++ b/types/image-size/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/image-size/tslint.json b/types/image-size/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/image-size/tslint.json +++ b/types/image-size/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } From 490c72724b8e42748ac1515ac1bd849d9384b775 Mon Sep 17 00:00:00 2001 From: Kalle Date: Fri, 11 Jan 2019 15:31:02 +0200 Subject: [PATCH 323/646] Update js-levenshtein-tests.ts --- types/js-levenshtein/js-levenshtein-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts index 062114c90a..e8c8a7cd28 100644 --- a/types/js-levenshtein/js-levenshtein-tests.ts +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -1,3 +1,3 @@ -import levenshtein from 'js-levenshtein'; +import * as levenshtein from 'js-levenshtein'; levenshtein('kittens', 'mittens'); // $ExpectType number From 33a50e330e8db79316bdb9ff0d00493495447579 Mon Sep 17 00:00:00 2001 From: Yash Kulshrestha Date: Fri, 11 Jan 2019 07:15:49 -0800 Subject: [PATCH 324/646] changed ValidationError class to work more like the yup source code --- types/yup/index.d.ts | 45 ++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index 8632968433..cfd73389b6 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -8,7 +8,7 @@ // Vincent Pizzo // Robert Bullen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.8 export function reach( schema: Schema, @@ -23,12 +23,6 @@ export function addMethod>( ): void; export function ref(path: string, options?: { contextPrefix: string }): Ref; export function lazy(fn: (value: T) => Schema): Lazy; -export function ValidationError( - errors: string | string[], - value: any, - path: string, - type?: any -): ValidationError; export function setLocale(customLocale: LocaleObject): void; export const mixed: MixedSchemaConstructor; @@ -49,7 +43,8 @@ export type AnySchemaConstructor = | ArraySchemaConstructor | ObjectSchemaConstructor; -export type TestOptionsMessage = string +export type TestOptionsMessage = + | string | ((params: object & Partial) => string); export interface Schema { @@ -171,14 +166,19 @@ export interface ArraySchema extends Schema { compact(rejector?: (value: any) => boolean): ArraySchema; } -export type ObjectSchemaDefinition = { [field in keyof T]: Schema | Ref }; +export type ObjectSchemaDefinition = { + [field in keyof T]: Schema | Ref +}; /** * Merges two interfaces. For properties in common, property types from `U` trump those of `T`. * This is conducive to the functionality of * [yup's `object.shape()` method](https://www.npmjs.com/package/yup#objectshapefields-object-nosortedges-arraystring-string-schema). */ -export type Shape = { [P in keyof T]: P extends keyof U ? U[P] : T[P] } & U; +export type Shape = { + [P in keyof T]: P extends keyof U ? U[P] : T[P] +} & + U; export interface ObjectSchemaConstructor { (fields?: ObjectSchemaDefinition): ObjectSchema; @@ -191,7 +191,10 @@ export interface ObjectSchema extends Schema { noSortEdges?: Array<[string, string]> ): ObjectSchema>; from(fromKey: string, toKey: string, alias?: boolean): ObjectSchema; - noUnknown(onlyKnownKeys?: boolean, message?: TestOptionsMessage): ObjectSchema; + noUnknown( + onlyKnownKeys?: boolean, + message?: TestOptionsMessage + ): ObjectSchema; transformKeys(callback: (key: any) => any): void; camelCase(): ObjectSchema; constantCase(): ObjectSchema; @@ -292,7 +295,12 @@ export interface SchemaDescription { fields: object; } -export interface ValidationError { +// ValidationError works a lot more like a class vs. a constructor +// function that returns an interface. It's also got a couple of +// static methods and it inherits for the generic Error class in +// the [yup codebase][1]. +// [1]: (https://github.com/jquense/yup/blob/master/src/ValidationError.js) +export class ValidationError extends Error { name: string; message: string; value: any; @@ -311,6 +319,19 @@ export interface ValidationError { */ inner: ValidationError[]; params?: object; + + static isError(err: any): err is ValidationError; + static formatError( + message: string | ((params?: any) => string), + params?: any + ): string | ((params?: any) => string); + + constructor( + errors: string | string[], + value: any, + path: string, + type?: any + ); } // It is tempting to declare `Ref` very simply, but there are problems with these approaches: From b25da8c8bef73dbb47312de3cfad105241c586d7 Mon Sep 17 00:00:00 2001 From: Yash Kulshrestha Date: Fri, 11 Jan 2019 07:16:25 -0800 Subject: [PATCH 325/646] added tests for ValidationError instance and static methods and properties --- types/yup/yup-tests.ts | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index cd661a2521..361cc62084 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -77,12 +77,21 @@ const renderable = yup.lazy(value => { }); const renderables = yup.array().of(renderable); +// ValidationError static methods +// $ExpectType boolean +ValidationError.isError(new ValidationError("error", "value", "path")); +// $ExpectType string | ((params?: any) => string) +ValidationError.formatError("error", { path: "path" }); +ValidationError.formatError("error"); +ValidationError.formatError(() => "error"); +ValidationError.formatError(() => "error", { path: "path" }); + // ValidationError -let error: ValidationError = yup.ValidationError("error", "value", "path"); -error = yup.ValidationError(["error", "error2"], true, "path"); -error = yup.ValidationError(["error", "error2"], 5, "path"); -error = yup.ValidationError(["error", "error2"], { name: "value" }, "path"); -error = yup.ValidationError( +let error: ValidationError = new yup.ValidationError("error", "value", "path"); +error = new yup.ValidationError(["error", "error2"], true, "path"); +error = new yup.ValidationError(["error", "error2"], 5, "path"); +error = new yup.ValidationError(["error", "error2"], { name: "value" }, "path"); +error = new yup.ValidationError( ["error", "error2"], { name: "value" }, "path", @@ -93,7 +102,7 @@ error = { message: "error", path: "path", errors: ["error"], - inner: [yup.ValidationError("error", true, "path")], + inner: [new yup.ValidationError("error", true, "path")], type: "date", value: { start: "2017-11-10" } }; @@ -135,8 +144,8 @@ mixed.default(() => ({ number: 5 })); mixed.default(); mixed.nullable(true); mixed.required(); -mixed.required('Foo'); -mixed.required(() => 'Foo'); +mixed.required("Foo"); +mixed.required(() => "Foo"); mixed.notRequired(); // $ExpectType MixedSchema mixed.typeError("type error"); mixed.typeError(() => "type error"); @@ -155,10 +164,8 @@ mixed then: yup.number().min(5), otherwise: yup.number().min(0) }) - .when( - "$other", - (value: any, schema: MixedSchema) => - value === 4 ? schema.required() : schema + .when("$other", (value: any, schema: MixedSchema) => + value === 4 ? schema.required() : schema ); // tslint:disable-next-line:no-invalid-template-strings mixed.test("is-jimmy", "${path} is not Jimmy", value => value === "jimmy"); @@ -486,8 +493,8 @@ interface ExpectedABC { } const expectedAbc: ExpectedABC = { - a: 'qwerty', - b: 'asdfg', + a: "qwerty", + b: "asdfg", c: 123 }; const actualAbc: yup.Shape = expectedAbc; From 07bf09839184335b4b595517deea3a8b7cfff5ab Mon Sep 17 00:00:00 2001 From: AntoineC Date: Fri, 11 Jan 2019 16:41:59 +0100 Subject: [PATCH 326/646] Fix and align shadowOffset type shadowOffset property accept different types and only one was defined. Also shadowOffset exists in Item class and in Style class and types were different. --- types/paper/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 5709826f6a..d77a4d35c2 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -1563,7 +1563,7 @@ declare module paper { * The shadow’s offset. * Default - 0 */ - shadowOffset: number; + shadowOffset: number | number[] | {x: number, y: number} | Point; /** * The color the item is highlighted with when selected. If the item does not specify its own color, the color defined by its layer is used instead. @@ -4371,7 +4371,7 @@ declare module paper { * The shadow's offset. * Default: 0 */ - shadowOffset?: Point; + shadowOffset?: number | number[] | {x: number, y: number} | Point; /** * The color the item is highlighted with when selected. If the item does not specify its own color, the color defined by its layer is used instead. From 6887f2179f4178dfe13cdda87307ce49c416c1fb Mon Sep 17 00:00:00 2001 From: Alex Petty Date: Fri, 11 Jan 2019 10:15:11 -0600 Subject: [PATCH 327/646] Update master-tracking ioredis definitions to match ioredis' internal ClusterOptions interface fully. --- types/ioredis/index.d.ts | 12 ++++++++++-- types/ioredis/ioredis-tests.ts | 4 ++-- types/ioredis/v3/ioredis-tests.ts | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index 7794f9a5f1..3de80afd22 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -972,16 +972,24 @@ declare namespace IORedis { count?: number; } + export type DNSLookupFunction = (hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void + export type NatMap = {[key: string]: {host: string, port: number}} + interface ClusterOptions { - clusterRetryStrategy?(times: number): number | null; + clusterRetryStrategy?(times: number, reason?: Error): number | null; enableOfflineQueue?: boolean; enableReadyCheck?: boolean; - scaleReads?: string; + scaleReads?: string | Function; maxRedirections?: number; retryDelayOnFailover?: number; retryDelayOnClusterDown?: number; retryDelayOnTryAgain?: number; + slotsRefreshTimeout?: number; + slotsRefreshInterval?: number; redisOptions?: RedisOptions; + lazyConnect?: boolean; + dnsLookup?: DNSLookupFunction; + natMap?: NatMap; } interface MultiOptions { diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index e2700ebcfb..14620b7476 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -195,9 +195,9 @@ redis.xtrim('streamName', 'MAXLEN', '~', 1000); // ClusterRetryStrategy can return non-numbers to stop retrying new Redis.Cluster([], { - clusterRetryStrategy: () => null + clusterRetryStrategy: (times: number, reason?: Error) => null }); new Redis.Cluster([], { - clusterRetryStrategy: () => 1 + clusterRetryStrategy: (times: number, reason?: Error) => 1 }); diff --git a/types/ioredis/v3/ioredis-tests.ts b/types/ioredis/v3/ioredis-tests.ts index ec5bb8a8ce..38cef49b73 100644 --- a/types/ioredis/v3/ioredis-tests.ts +++ b/types/ioredis/v3/ioredis-tests.ts @@ -156,9 +156,9 @@ new Redis.Cluster([{ // ClusterRetryStrategy can return non-numbers to stop retrying new Redis.Cluster([], { - clusterRetryStrategy: () => null + clusterRetryStrategy: (times: number) => null }); new Redis.Cluster([], { - clusterRetryStrategy: () => 1 + clusterRetryStrategy: (times: number) => 1 }); From 31a36e1018aaef402f95114506a7e13cd2e22dae Mon Sep 17 00:00:00 2001 From: drabinowitz Date: Fri, 11 Jan 2019 11:28:06 -0500 Subject: [PATCH 328/646] @types/victory: Fix signature of VictoryChartProps style property --- types/victory/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 9c5d7e3f6a..81daf11313 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -1578,7 +1578,7 @@ declare module "victory" { * components within chart. * @example {border: "1px solid #ccc", margin: "2%", maxWidth: "40%"} */ - style?: React.CSSProperties; + style?: Pick; } /** From 1548342f59fc4fc3c41c091a64703ba297d38f2b Mon Sep 17 00:00:00 2001 From: Alex Petty Date: Fri, 11 Jan 2019 10:45:14 -0600 Subject: [PATCH 329/646] fix linter issues with ioredis types copied from ioredis project --- types/ioredis/index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index 3de80afd22..ca1d71a0aa 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -972,14 +972,16 @@ declare namespace IORedis { count?: number; } - export type DNSLookupFunction = (hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void - export type NatMap = {[key: string]: {host: string, port: number}} + type DNSLookupFunction = (hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void; + interface NatMap { + [key: string]: {host: string, port: number}; + } interface ClusterOptions { clusterRetryStrategy?(times: number, reason?: Error): number | null; enableOfflineQueue?: boolean; enableReadyCheck?: boolean; - scaleReads?: string | Function; + scaleReads?: string; maxRedirections?: number; retryDelayOnFailover?: number; retryDelayOnClusterDown?: number; From e6d3b967a65f968bebd89e21d4153c98ac24e033 Mon Sep 17 00:00:00 2001 From: Kallu609 Date: Fri, 11 Jan 2019 20:12:11 +0200 Subject: [PATCH 330/646] Oops accident Revert "Update js-levenshtein-tests.ts" This reverts commit 490c72724b8e42748ac1515ac1bd849d9384b775. --- types/js-levenshtein/js-levenshtein-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts index e8c8a7cd28..062114c90a 100644 --- a/types/js-levenshtein/js-levenshtein-tests.ts +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -1,3 +1,3 @@ -import * as levenshtein from 'js-levenshtein'; +import levenshtein from 'js-levenshtein'; levenshtein('kittens', 'mittens'); // $ExpectType number From dc501d933c0927fa880bcde52dde31153212678d Mon Sep 17 00:00:00 2001 From: Frank Chiang Date: Fri, 11 Jan 2019 13:44:11 -0500 Subject: [PATCH 331/646] Rename JSONAPIError to Error to match js --- types/jsonapi-serializer/index.d.ts | 2 +- types/jsonapi-serializer/jsonapi-serializer-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jsonapi-serializer/index.d.ts b/types/jsonapi-serializer/index.d.ts index a284581a06..4d9344bc28 100644 --- a/types/jsonapi-serializer/index.d.ts +++ b/types/jsonapi-serializer/index.d.ts @@ -108,4 +108,4 @@ export interface Callback { export let Serializer: SerializerConstructor; export let Deserializer: DeserializerConstructor; -export let JSONAPIError: ErrorConstructor; +export let Error: ErrorConstructor; diff --git a/types/jsonapi-serializer/jsonapi-serializer-tests.ts b/types/jsonapi-serializer/jsonapi-serializer-tests.ts index 11aae0632c..cd560cca77 100644 --- a/types/jsonapi-serializer/jsonapi-serializer-tests.ts +++ b/types/jsonapi-serializer/jsonapi-serializer-tests.ts @@ -1,4 +1,4 @@ -import { Serializer, Deserializer, JSONAPIError } from "jsonapi-serializer"; +import { Serializer, Deserializer, Error } from "jsonapi-serializer"; declare let firstName: string; declare let lastName: string; @@ -21,7 +21,7 @@ const UserDeserializer = new Deserializer({ UserDeserializer.deserialize(users); -new JSONAPIError({ +new Error({ code: "_code", detail: "_detail", id: "_id", From 3033945943c11e9d432157b28c58448d15b041f4 Mon Sep 17 00:00:00 2001 From: Kallu609 Date: Fri, 11 Jan 2019 21:18:04 +0200 Subject: [PATCH 332/646] changed es6 import/export to commonjs --- types/js-levenshtein/index.d.ts | 2 +- types/js-levenshtein/js-levenshtein-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/js-levenshtein/index.d.ts b/types/js-levenshtein/index.d.ts index f1703617c9..5b29d11026 100644 --- a/types/js-levenshtein/index.d.ts +++ b/types/js-levenshtein/index.d.ts @@ -9,4 +9,4 @@ */ declare function levenshtein(compareFrom: string, compareTo: string): number; -export default levenshtein; +export = levenshtein; diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts index 062114c90a..539473ccf4 100644 --- a/types/js-levenshtein/js-levenshtein-tests.ts +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -1,3 +1,3 @@ -import levenshtein from 'js-levenshtein'; +import levenshtein = require('js-levenshtein'); levenshtein('kittens', 'mittens'); // $ExpectType number From 3c76d206b9adf993b83b741353cfa5795ff3ff69 Mon Sep 17 00:00:00 2001 From: drabinowitz Date: Fri, 11 Jan 2019 14:49:48 -0500 Subject: [PATCH 333/646] Add radius property to VictoryPieProps --- types/victory/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 9c5d7e3f6a..37d0ba50c5 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -2204,6 +2204,12 @@ declare module "victory" { * assign eventKeys to data */ eventKey?: StringOrNumberOrCallback; + /** + * Specifies the radius of the chart. If this property is not provided it is computed + * from width, height, and padding props + * + */ + radius?: number; /** * When creating a donut chart, this prop determines the number of pixels between * the center of the chart and the inner edge of a donut. When this prop is set to zero From c3279e48ee1ce58d76a1640b0a6970060d35db8b Mon Sep 17 00:00:00 2001 From: Sarah Meyer Date: Fri, 11 Jan 2019 16:46:18 -0700 Subject: [PATCH 334/646] remove nuka carousel now that types are packaged in the library --- notNeededPackages.json | 6 + types/nuka-carousel/index.d.ts | 288 -------------------- types/nuka-carousel/nuka-carousel-tests.tsx | 54 ---- types/nuka-carousel/tsconfig.json | 25 -- types/nuka-carousel/tslint.json | 3 - 5 files changed, 6 insertions(+), 370 deletions(-) delete mode 100644 types/nuka-carousel/index.d.ts delete mode 100644 types/nuka-carousel/nuka-carousel-tests.tsx delete mode 100644 types/nuka-carousel/tsconfig.json delete mode 100644 types/nuka-carousel/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 4acd790e24..11bef06fb9 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1068,6 +1068,12 @@ "sourceRepoURL": "https://github.com/paularmstrong/normalizr", "asOfVersion": "2.0.18" }, + { + "libraryName": "Nuka Carousel", + "typingsPackageName": "nuka-carousel", + "sourceRepoURL": "https://github.com/FormidableLabs/nuka-carousel/", + "asOfVersion": "4.4.6" + }, { "libraryName": "Numbro", "typingsPackageName": "numbro", diff --git a/types/nuka-carousel/index.d.ts b/types/nuka-carousel/index.d.ts deleted file mode 100644 index 97edd08a6d..0000000000 --- a/types/nuka-carousel/index.d.ts +++ /dev/null @@ -1,288 +0,0 @@ -// Type definitions for nuka-carousel 4.4 -// Project: https://github.com/FormidableLabs/nuka-carousel -// Definitions by: Roman Charugin -// Alex Smith -// matt-sungwook -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import * as React from 'react'; - -export default class Carousel extends React.Component {} - -export type CarouselCellAlignProp = 'left' | 'center' | 'right'; - -export type CarouselHeightModeProp = 'first' | 'current' | 'max'; - -export type CarouselSlidesToScrollProp = number | 'auto'; - -export type CarouselSlideWidthProp = string | number; - -export interface CarouselSlideRenderControlProps { - /** - * Space between slides, as an integer, but reflected as px - */ - cellSpacing: number; - /** - * Current slide index - */ - currentSlide: number; - /** - * Current frame width (px) - */ - frameWidth: number; - /** - * Go to X slide method - * @param index Slide's index to go - */ - goToSlide: (index: number) => void; - /** - * Go to the next slide method - */ - nextSlide: () => void; - /** - * Go to the previous slide method - */ - previousSlide: () => void; - /** - * Total amount of slides - */ - slideCount: number; - /** - * Slides to scroll at once - */ - slidesToScroll: number; - /** - * Slides to show at once - */ - slidesToShow: number; - /** - * Current slide width (px) - */ - slideWidth: number; - /** - * Infinite mode enabled - */ - wrapAround: boolean; -} - -export type CarouselRenderControl = (props: CarouselSlideRenderControlProps) => JSX.Element; - -export interface CarouselProps { - /** - * Hook to be called after a slide is changed - * @param prevSlide Index of the previous slide - */ - afterSlide?: (prevSlide: number) => void; - /** - * Autoplay mode active - * @default false - */ - autoplay?: boolean; - /** - * Interval for autoplay iteration (ms) - * @default 3000 - */ - autoplayInterval?: number; - /** - * Hook to be called before a slide is changed - * @param currentSlide Index of the current slide - * @param endSlide Index of the last slide - */ - beforeSlide?: (currentSlide: number, endSlide: number) => void; - /** - * When displaying more than one slide, - * sets which position to anchor the current slide to - */ - cellAlign?: CarouselCellAlignProp; - /** - * Space between slides, as an integer, but reflected as px - */ - cellSpacing?: number; - /** - * Additional className - */ - className?: string; - /** - * When set to true, disable keyboard controls - * @default false - */ - disableKeyboardControls?: boolean; - /** - * Enable mouse swipe/dragging - */ - dragging?: boolean; - /** - * Animation easing function - * @see https://github.com/d3/d3-ease - */ - easing?: string; - /** - * Animation easing function when swipe exceeds edge - * @see https://github.com/d3/d3-ease - */ - edgeEasing?: string; - /** - * Used to set overflow style property on slider frame - * @default 'hidden' - */ - frameOverflow?: string; - /** - * Used to set the margin of the slider frame. - * Accepts any string dimension value such as "0px 20px" or "500px" - * @example '0px 20px' - * @example '500px' - */ - framePadding?: string; - /** - * Change the height of the slides based either on the first slide, - * the current slide, or the maximum height of all slides. - */ - heightMode?: CarouselHeightModeProp; - /** - * Initial height of the slides (px) - */ - initialSlideHeight?: number; - /** - * Initial width of the slides (px) - */ - initialSlideWidth?: number; - /** - * Window onResize callback - */ - onResize?: () => void; - /** - * Pause autoPlay when mouse is over carousel - * @default true - */ - pauseOnHover?: boolean; - /** - * Function for rendering top left control - */ - renderTopLeftControls?: CarouselRenderControl; - /** - * Function for rendering top center control - */ - renderTopCenterControls?: CarouselRenderControl; - /** - * Function for rendering top right control - */ - renderTopRightControls?: CarouselRenderControl; - /** - * Function for rendering center left control - */ - renderCenterLeftControls?: CarouselRenderControl; - /** - * Function for rendering center center control - */ - renderCenterCenterControls?: CarouselRenderControl; - /** - * Function for rendering center right control - */ - renderCenterRightControls?: CarouselRenderControl; - /** - * Function for rendering bottom left control - */ - renderBottomLeftControls?: CarouselRenderControl; - /** - * Function for rendering bottom center control - */ - renderBottomCenterControls?: CarouselRenderControl; - /** - * Function for rendering bottom right control - */ - renderBottomRightControls?: CarouselRenderControl; - /** - * Manually set the index of the slide to be shown - */ - slideIndex?: number; - /** - * Slides to scroll at once. Set to "auto" - * to always scroll the current number of visible slides - */ - slidesToScroll?: CarouselSlidesToScrollProp; - /** - * Slides to show at once - */ - slidesToShow?: number; - /** - * Manually set slideWidth - * @example '20px' - * @example 0.8 - */ - slideWidth?: CarouselSlideWidthProp; - /** - * Animation duration - */ - speed?: number; - /** - * Enable touch swipe/dragging - */ - swiping?: boolean; - /** - * Enable the slides to transition vertically - */ - vertical?: boolean; - /** - * Used to hardcode the slider width - * @example '80%' - * @example '500px' - */ - width?: string; - /** - * Sets infinite wrapAround mode - * @default false - */ - wrapAround?: boolean; - /** - * Used to remove all controls at once. Overwrites the render[Top, Right, Bottom, Left]CenterControls() - * @default false - */ - withoutControls?: boolean; -} - -export interface CarouselState { - /** - * Current slide index - */ - currentSlide: number; - /** - * Is dragging enabled - */ - dragging: boolean; - /** - * Easing function name - */ - easing: string; - /** - * Current frame width - */ - frameWidth: number; - /** - * Current left value - */ - isWrappingAround: boolean; - left: number; - pauseOnHover: boolean; - resetWrapAroundPosition: boolean; - /** - * Total amount of slides - */ - slideCount: number; - /** - * Slides to scroll at once - */ - slidesToScroll: number; - /** - * Current slide width - */ - slideWidth: CarouselSlideWidthProp; - /** - * Current top value - */ - top: number; - /** - * Is infinite mode enabled - */ - wrapToIndex: boolean; -} diff --git a/types/nuka-carousel/nuka-carousel-tests.tsx b/types/nuka-carousel/nuka-carousel-tests.tsx deleted file mode 100644 index 03df5e6251..0000000000 --- a/types/nuka-carousel/nuka-carousel-tests.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from 'react'; -import { render } from 'react-dom'; - -import Carousel, { CarouselProps } from 'nuka-carousel'; - -const props: CarouselProps = { - afterSlide: () => {}, - autoplay: true, - autoplayInterval: 5000, - beforeSlide: () => {}, - cellAlign: 'center', - cellSpacing: 500, - dragging: true, - easing: 'easePoly', - edgeEasing: 'easePolyInOut', - framePadding: '100px', - heightMode: 'max', - initialSlideHeight: 200, - initialSlideWidth: 500, - onResize: () => {}, - renderTopLeftControls: () =>