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 0001/1304] =?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 0002/1304] 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 0003/1304] 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 0004/1304] 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 0005/1304] 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 0006/1304] 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 0007/1304] 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 0008/1304] 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 0009/1304] =?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 0010/1304] 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 0011/1304] 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 0012/1304] 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 0013/1304] 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 0014/1304] 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 0015/1304] 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 0016/1304] 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 0017/1304] 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 0018/1304] 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 0019/1304] 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 0020/1304] 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 0021/1304] 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 0022/1304] 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 f709ff624812765a9059d89dc324825cb271c5b3 Mon Sep 17 00:00:00 2001 From: Xiao Date: Thu, 18 Oct 2018 16:10:10 -0500 Subject: [PATCH 0023/1304] Create index.d.ts --- types/drivelist/index.d.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 types/drivelist/index.d.ts diff --git a/types/drivelist/index.d.ts b/types/drivelist/index.d.ts new file mode 100644 index 0000000000..b23e650218 --- /dev/null +++ b/types/drivelist/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for drivelist 6.4.3 +// Project: https://github.com/resin-io-modules/drivelist +// Definitions by: Xiao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1.3 + +export type BusType = "SATA" | "SCSI" | "ATA" | "IDE" | "PCI" | "UNKNOWN"; + +export interface MountPoint { + path: string; + label?: string; +} + +export interface Drive { + enumerator: string; + busType: BusType; + busVersion: string | null; + device: string; + devicePath: string | null; + raw: string; + description: string; + error: any | null; + size: number | null; + blockSize: number | null; + logicalBlockSize: number | null; + mountpoints: MountPoint[]; + isReadOnly: boolean; + isSystem: boolean; + isVirtual: boolean | null; + isRemovable: boolean | null; + isCard: boolean | null; + isSCSI: boolean | null; + isUSB: boolean | null; + isUAS: boolean | null; +} + +export function list(callback: (error: any, drives: Drive[]) => void): void; From 2dc4d833df57efb8cd1de29cf738256e7da4396d Mon Sep 17 00:00:00 2001 From: Xiao Date: Thu, 18 Oct 2018 16:11:50 -0500 Subject: [PATCH 0024/1304] Create package.json --- types/drivelist/package.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 types/drivelist/package.json diff --git a/types/drivelist/package.json b/types/drivelist/package.json new file mode 100644 index 0000000000..9bba814b33 --- /dev/null +++ b/types/drivelist/package.json @@ -0,0 +1,20 @@ +{ + "name": "@types/drivelist", + "version": "6.4.3", + "description": "TypeScript definitions for drivelist", + "license": "MIT", + "contributors": [ + { + "name": "Xiao Deng", + "url": "https://github.com/WholeMilk" + } + ], + "main": "", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "peerDependencies": {} +} From 44054cedea3cdd8fa022f2f59b0507bdd032a90d Mon Sep 17 00:00:00 2001 From: Yishai Zehavi Date: Tue, 6 Nov 2018 12:43:25 +0200 Subject: [PATCH 0025/1304] Updated types to version 3 --- types/lolex/index.d.ts | 247 +++++++++++++++++++++++++++-------------- 1 file changed, 166 insertions(+), 81 deletions(-) diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts index 1727c97ad3..7ad5c11898 100644 --- a/types/lolex/index.d.ts +++ b/types/lolex/index.d.ts @@ -1,10 +1,76 @@ -// Type definitions for lolex 2.1 +// Type definitions for lolex 3 // Project: https://github.com/sinonjs/lolex // Definitions by: Wim Looman // Josh Goldberg // Rogier Schouten +// Yishai Zehavi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/** + * Names of clock methods that may be faked by install. + */ +type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime"; + +/** + * Global methods avaliable to every clock and also as standalone methods (inside `timers` global object). + */ +export interface GlobalTimers { + /** + * Schedules a callback to be fired once timeout milliseconds have ticked by. + * + * @param callback Callback to be fired. + * @param timeout How many ticks to wait to run the callback. + * @param args Any extra arguments to pass to the callback. + * @returns Time identifier for cancellation. + */ + setTimeout: (callback: () => void, timeout: number, ...args: any[]) => TTimerId; + + /** + * Clears a timer, as long as it was created using setTimeout. + * + * @param id Timer ID or object. + */ + clearTimeout: (id: TimerId) => void; + + /** + * Schedules a callback to be fired every time timeout milliseconds have ticked by. + * + * @param callback Callback to be fired. + * @param timeout How many ticks to wait between callbacks. + * @param args Any extra arguments to pass to the callback. + * @returns Time identifier for cancellation. + */ + setInterval: (callback: () => void, timeout: number, ...args: any[]) => TTimerId; + + /** + * Clears a timer, as long as it was created using setInterval. + * + * @param id Timer ID or object. + */ + clearInterval: (id: TTimerId) => void; + + /** + * Schedules the callback to be fired once 0 milliseconds have ticked by. + * + * @param callback Callback to be fired. + * @remarks You'll still have to call clock.tick() for the callback to fire. + * @remarks If called during a tick the callback won't fire until 1 millisecond has ticked by. + */ + setImmediate: (callback: () => void) => TTimerId; + + /** + * Clears a timer, as long as it was created using setImmediate. + * + * @param id Timer ID or object. + */ + clearImmediate: (id: TTimerId) => void; + + /** + * Implements the Date object but using this clock to provide the correct time. + */ + Date: typeof Date; +} + /** * Timer object used in node. */ @@ -25,102 +91,47 @@ export interface NodeTimer { */ export type TimerId = number | NodeTimer; -/** - * Lolex clock for a browser environment. - */ -type BrowserClock = LolexClock; - -/** - * Lolex clock for a Node environment. - */ -type NodeClock = LolexClock & { - /** - * Mimicks process.hrtime(). - * - * @param prevTime Previous system time to calculate time elapsed. - * @returns High resolution real time as [seconds, nanoseconds]. - */ - hrtime(prevTime?: [number, number]): [number, number]; -}; - -/** - * Clock object created by lolex. - */ -type Clock = BrowserClock | NodeClock; - -/** - * Names of clock methods that may be faked by install. - */ -type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime"; - /** * Controls the flow of time. */ -export interface LolexClock { +export interface LolexClock extends GlobalTimers { /** * Current clock time. */ now: number; /** - * Implements the Date object but using this clock to provide the correct time. + * Don't know what this prop is for, but it was included in the clocks that `createClock` or + * `install` return (it is never used in the code, for now). */ - Date: typeof Date; + timeouts: {}; /** - * Schedules a callback to be fired once timeout milliseconds have ticked by. + * Maximum number of timers that will be run when calling runAll(). + */ + loopLimit: number; + + /** + * Schedule callback to run in the next animation frame. * * @param callback Callback to be fired. - * @param timeout How many ticks to wait to run the callback. - * @param args Any extra arguments to pass to the callback. - * @returns Time identifier for cancellation. + * @returns Request id. */ - setTimeout: (callback: () => any, timeout: number, ...args: any[]) => TTimerId; + requestAnimationFrame: (callback: (time: number) => void) => TTimerId; /** - * Clears a timer, as long as it was created using setTimeout. + * Cancel animation frame request. * - * @param id Timer ID or object. + * @param id The id returned from requestAnimationFrame method. */ - clearTimeout: (id: TTimerId) => void; + cancelAnimationFrame: (id: TTimerId) => void; - /** - * Schedules a callback to be fired every time timeout milliseconds have ticked by. - * - * @param callback Callback to be fired. - * @param timeout How many ticks to wait between callbacks. - * @param args Any extra arguments to pass to the callback. - * @returns Time identifier for cancellation. - */ - setInterval: (callback: () => any, timeout: number, ...args: any[]) => TTimerId; - - /** - * Clears a timer, as long as it was created using setInterval. - * - * @param id Timer ID or object. - */ - clearInterval: (id: TTimerId) => void; - - /** - * Schedules the callback to be fired once 0 milliseconds have ticked by. - * - * @param callback Callback to be fired. - * @remarks You'll still have to call clock.tick() for the callback to fire. - * @remarks If called during a tick the callback won't fire until 1 millisecond has ticked by. - */ - setImmediate: (callback: () => any) => TTimerId; - - /** - * Clears a timer, as long as it was created using setImmediate. - * - * @param id Timer ID or object. - */ - clearImmediate: (id: TTimerId) => void; - - /** - * Simulates process.nextTick(); - */ - nextTick: (callback: () => void) => void; + /** + * Get the number of waiting timers. + * + * @returns number of waiting timers. + */ + countTimers: () => number; /** * Advances the clock to the the moment of the first scheduled timer, firing it. @@ -134,6 +145,11 @@ export interface LolexClock { */ tick: (time: number | string) => void; + /** + * Removes all timers and tick without firing them and restore now to its original value. + */ + reset: () => void; + /** * Runs all pending timers until there are none remaining. * @@ -141,6 +157,11 @@ export interface LolexClock { */ runAll: () => void; + /** + * Advanced the clock to the next animation frame while firing all scheduled callbacks. + */ + runToFrame: () => void; + /** * Takes note of the last scheduled timer when it is run, and advances the clock to * that time firing callbacks as necessary. @@ -154,13 +175,62 @@ export interface LolexClock { * @remarks This affects the current time but it does not in itself cause timers to fire. */ setSystemTime: (now?: number | Date) => void; +} +/** + * Lolex clock for a browser environment. + */ +type BrowserClock = LolexClock & { + /** + * Mimics performance.now(). + */ + performance: { + now: () => number; + } +}; + +/** + * Lolex clock for a Node environment. + */ +type NodeClock = LolexClock & { + /** + * Mimicks process.hrtime(). + * + * @param prevTime Previous system time to calculate time elapsed. + * @returns High resolution real time as [seconds, nanoseconds]. + */ + hrtime(prevTime?: [number, number]): [number, number]; + + /** + * Mimics process.nextTick() explicitly dropping additional arguments. + */ + queueMicrotask: (callback: () => void) => void; + + /** + * Simulates process.nextTick(). + */ + nextTick: (callback: () => void) => void; + + /** + * Run all pending microtasks scheduled with nextTick. + */ + runMicrotasks: () => void; +}; + +/** + * Clock object created by lolex. + */ +type Clock = BrowserClock | NodeClock; + +type InstalledClock = Clock & { /** * Restores the original methods on the context that was passed to lolex.install, * or the native timers if no context was given. */ uninstall: () => void; -} + + methods: FakeMethod[]; +}; /** * Creates a clock. @@ -174,7 +244,6 @@ export interface LolexClock { */ export declare function createClock(now?: number | Date, loopLimit?: number): TClock; - export interface LolexInstallOpts { /** * Installs lolex onto the specified target context (default: global) @@ -215,6 +284,22 @@ export interface LolexInstallOpts { * * @param now Current time for the clock, as with lolex.createClock(). * @param toFake Names of methods that should be faked. - * @type TClock Type of clock to create. + * @type InstalledClock Type of clock to create. */ -export declare function install(opts?: LolexInstallOpts): TClock; +export declare function install(opts?: LolexInstallOpts): InstalledClock; + +export interface LolexWithContext { + timers: GlobalTimers; + createClock: (now?: number | Date, loopLimit?: number) => TClock; + install: (opts?: LolexInstallOpts) => InstalledClock; + withGlobal: (global: object) => LolexWithContext; +} + +/** + * Apply new context to lolex. + * + * @param global New context to apply like `window` (in browsers) or `global` (in node). + */ +export declare function withGlobal(global: object): LolexWithContext; + +export declare const timers: GlobalTimers; From c96f272c35599ad8f8aca46ad29f92d5da953a45 Mon Sep 17 00:00:00 2001 From: Yishai Zehavi Date: Tue, 6 Nov 2018 13:33:30 +0200 Subject: [PATCH 0026/1304] Added tests to version 3 --- types/lolex/lolex-tests.ts | 50 ++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/types/lolex/lolex-tests.ts b/types/lolex/lolex-tests.ts index f698eac3cc..56505c62e9 100644 --- a/types/lolex/lolex-tests.ts +++ b/types/lolex/lolex-tests.ts @@ -1,5 +1,17 @@ import lolex = require("lolex"); +const global: lolex.LolexWithContext = lolex.withGlobal({}); +const timers: lolex.GlobalTimers = lolex.timers; + +const lolexTimeout: lolex.TimerId = timers.setTimeout(() => {}, 42); +const lolexInterval: lolex.TimerId = timers.setInterval(() => {}, 42); +const lolexImmediate: lolex.TimerId = timers.setImmediate(() => {}); +const lolexDate: Date = new timers.Date(); + +timers.clearTimeout(lolexTimeout); +timers.clearInterval(lolexInterval); +timers.clearImmediate(lolexImmediate); + let browserClock: lolex.BrowserClock = lolex.createClock() as lolex.BrowserClock; let nodeClock: lolex.NodeClock = lolex.createClock() as lolex.NodeClock; @@ -16,7 +28,7 @@ lolex.createClock(new Date()); lolex.createClock(7, 9001); lolex.createClock(new Date(), 9001); -lolex.install({ +const installedClock = lolex.install({ advanceTimeDelta: 20, loopLimit: 10, now: 0, @@ -25,7 +37,7 @@ lolex.install({ toFake: ["setTimeout", "nextTick", "hrtime"] }); -lolex.install({ +lolex.install({ advanceTimeDelta: 20, loopLimit: 10, now: new Date(0), @@ -35,7 +47,10 @@ lolex.install({ }); const browserNow: number = browserClock.now; +const browserTimeouts: Object = browserClock.timeouts; +const browserLoopLimit: number = browserClock.loopLimit; const browserDate: Date = new browserClock.Date(); +const browserPerformanceNow: number = browserClock.performance.now(); const nodeNow: number = nodeClock.now; const nodeDate: Date = new nodeClock.Date(); @@ -43,30 +58,45 @@ const nodeDate: Date = new nodeClock.Date(); const browserTimeout: number = browserClock.setTimeout(() => {}, 7); const browserInterval: number = browserClock.setInterval(() => {}, 7); const browserImmediate: number = browserClock.setImmediate(() => {}); +const browserAnimationFrame: number = browserClock.requestAnimationFrame(() => {}); const nodeTimeout: lolex.NodeTimer = nodeClock.setTimeout(() => {}, 7); const nodeInterval: lolex.NodeTimer = nodeClock.setInterval(() => {}, 7); const nodeImmediate: lolex.NodeTimer = nodeClock.setImmediate(() => {}); +const nodeAnimationFrame: lolex.NodeTimer = nodeClock.requestAnimationFrame(() => {}); + +nodeTimeout.ref(); +nodeTimeout.unref(); browserClock.clearTimeout(browserTimeout); browserClock.clearInterval(browserInterval); browserClock.clearImmediate(browserImmediate); +browserClock.cancelAnimationFrame(browserAnimationFrame); nodeClock.clearTimeout(nodeTimeout); nodeClock.clearInterval(nodeInterval); nodeClock.clearImmediate(nodeImmediate); +nodeClock.cancelAnimationFrame(nodeAnimationFrame); browserClock.tick(7); browserClock.tick("08"); nodeClock.tick(7); -nodeClock.tick("08"); +nodeClock.tick("08:03"); browserClock.next(); nodeClock.next(); +browserClock.reset(); +nodeClock.reset(); + browserClock.runAll(); nodeClock.runAll(); +nodeClock.runMicrotasks(); + +browserClock.runToFrame(); +nodeClock.runToFrame(); + browserClock.runToLast(); nodeClock.runToLast(); @@ -79,9 +109,19 @@ nodeClock.setSystemTime(7); nodeClock.setSystemTime(new Date()); nodeClock.nextTick(() => undefined); +nodeClock.queueMicrotask(() => {}); -browserClock.uninstall(); -nodeClock.uninstall(); +const browserTimersCount: number = browserClock.countTimers(); +const nodeTimersCount: number = nodeClock.countTimers(); + +let [secs, nanos] = nodeClock.hrtime([0, 0]); +[secs, nanos] = nodeClock.hrtime(); + +// shows that typescript successfully infer the return values as numbers. +secs.toFixed(); +nanos.toExponential(); + +installedClock.uninstall(); // Clocks should be typed to have unbound method signatures that can be passed around const { clearTimeout } = browserClock; From 56c35cf65676ee1aba392d1a7f2209ae41c63e4a Mon Sep 17 00:00:00 2001 From: Yishai Zehavi Date: Tue, 6 Nov 2018 13:33:30 +0200 Subject: [PATCH 0027/1304] Added tests to version 3 --- types/lolex/index.d.ts | 4 +-- types/lolex/lolex-tests.ts | 50 ++++++++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts index 7ad5c11898..d34f958eb9 100644 --- a/types/lolex/index.d.ts +++ b/types/lolex/index.d.ts @@ -292,7 +292,7 @@ export interface LolexWithContext { timers: GlobalTimers; createClock: (now?: number | Date, loopLimit?: number) => TClock; install: (opts?: LolexInstallOpts) => InstalledClock; - withGlobal: (global: object) => LolexWithContext; + withGlobal: (global: Object) => LolexWithContext; } /** @@ -300,6 +300,6 @@ export interface LolexWithContext { * * @param global New context to apply like `window` (in browsers) or `global` (in node). */ -export declare function withGlobal(global: object): LolexWithContext; +export declare function withGlobal(global: Object): LolexWithContext; export declare const timers: GlobalTimers; diff --git a/types/lolex/lolex-tests.ts b/types/lolex/lolex-tests.ts index f698eac3cc..56505c62e9 100644 --- a/types/lolex/lolex-tests.ts +++ b/types/lolex/lolex-tests.ts @@ -1,5 +1,17 @@ import lolex = require("lolex"); +const global: lolex.LolexWithContext = lolex.withGlobal({}); +const timers: lolex.GlobalTimers = lolex.timers; + +const lolexTimeout: lolex.TimerId = timers.setTimeout(() => {}, 42); +const lolexInterval: lolex.TimerId = timers.setInterval(() => {}, 42); +const lolexImmediate: lolex.TimerId = timers.setImmediate(() => {}); +const lolexDate: Date = new timers.Date(); + +timers.clearTimeout(lolexTimeout); +timers.clearInterval(lolexInterval); +timers.clearImmediate(lolexImmediate); + let browserClock: lolex.BrowserClock = lolex.createClock() as lolex.BrowserClock; let nodeClock: lolex.NodeClock = lolex.createClock() as lolex.NodeClock; @@ -16,7 +28,7 @@ lolex.createClock(new Date()); lolex.createClock(7, 9001); lolex.createClock(new Date(), 9001); -lolex.install({ +const installedClock = lolex.install({ advanceTimeDelta: 20, loopLimit: 10, now: 0, @@ -25,7 +37,7 @@ lolex.install({ toFake: ["setTimeout", "nextTick", "hrtime"] }); -lolex.install({ +lolex.install({ advanceTimeDelta: 20, loopLimit: 10, now: new Date(0), @@ -35,7 +47,10 @@ lolex.install({ }); const browserNow: number = browserClock.now; +const browserTimeouts: Object = browserClock.timeouts; +const browserLoopLimit: number = browserClock.loopLimit; const browserDate: Date = new browserClock.Date(); +const browserPerformanceNow: number = browserClock.performance.now(); const nodeNow: number = nodeClock.now; const nodeDate: Date = new nodeClock.Date(); @@ -43,30 +58,45 @@ const nodeDate: Date = new nodeClock.Date(); const browserTimeout: number = browserClock.setTimeout(() => {}, 7); const browserInterval: number = browserClock.setInterval(() => {}, 7); const browserImmediate: number = browserClock.setImmediate(() => {}); +const browserAnimationFrame: number = browserClock.requestAnimationFrame(() => {}); const nodeTimeout: lolex.NodeTimer = nodeClock.setTimeout(() => {}, 7); const nodeInterval: lolex.NodeTimer = nodeClock.setInterval(() => {}, 7); const nodeImmediate: lolex.NodeTimer = nodeClock.setImmediate(() => {}); +const nodeAnimationFrame: lolex.NodeTimer = nodeClock.requestAnimationFrame(() => {}); + +nodeTimeout.ref(); +nodeTimeout.unref(); browserClock.clearTimeout(browserTimeout); browserClock.clearInterval(browserInterval); browserClock.clearImmediate(browserImmediate); +browserClock.cancelAnimationFrame(browserAnimationFrame); nodeClock.clearTimeout(nodeTimeout); nodeClock.clearInterval(nodeInterval); nodeClock.clearImmediate(nodeImmediate); +nodeClock.cancelAnimationFrame(nodeAnimationFrame); browserClock.tick(7); browserClock.tick("08"); nodeClock.tick(7); -nodeClock.tick("08"); +nodeClock.tick("08:03"); browserClock.next(); nodeClock.next(); +browserClock.reset(); +nodeClock.reset(); + browserClock.runAll(); nodeClock.runAll(); +nodeClock.runMicrotasks(); + +browserClock.runToFrame(); +nodeClock.runToFrame(); + browserClock.runToLast(); nodeClock.runToLast(); @@ -79,9 +109,19 @@ nodeClock.setSystemTime(7); nodeClock.setSystemTime(new Date()); nodeClock.nextTick(() => undefined); +nodeClock.queueMicrotask(() => {}); -browserClock.uninstall(); -nodeClock.uninstall(); +const browserTimersCount: number = browserClock.countTimers(); +const nodeTimersCount: number = nodeClock.countTimers(); + +let [secs, nanos] = nodeClock.hrtime([0, 0]); +[secs, nanos] = nodeClock.hrtime(); + +// shows that typescript successfully infer the return values as numbers. +secs.toFixed(); +nanos.toExponential(); + +installedClock.uninstall(); // Clocks should be typed to have unbound method signatures that can be passed around const { clearTimeout } = browserClock; From 368c7a78cfba464d7551a27b5bd75fee57e5aa05 Mon Sep 17 00:00:00 2001 From: Yishai Zehavi Date: Thu, 8 Nov 2018 12:50:49 +0200 Subject: [PATCH 0028/1304] Updated InstalledClock type --- types/lolex/index.d.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts index d34f958eb9..35c4880a5b 100644 --- a/types/lolex/index.d.ts +++ b/types/lolex/index.d.ts @@ -222,7 +222,10 @@ type NodeClock = LolexClock & { */ type Clock = BrowserClock | NodeClock; -type InstalledClock = Clock & { +/** + * Additional methods that installed clock have. + */ +type InstalledMethods = { /** * Restores the original methods on the context that was passed to lolex.install, * or the native timers if no context was given. @@ -232,6 +235,13 @@ type InstalledClock = Clock & { methods: FakeMethod[]; }; +/** + * Clock object created by calling `install();`. + * + * @type TClock type of base clock (e.g BrowserClock). + */ +type InstalledClock = TClock & InstalledMethods; + /** * Creates a clock. * @@ -284,14 +294,14 @@ export interface LolexInstallOpts { * * @param now Current time for the clock, as with lolex.createClock(). * @param toFake Names of methods that should be faked. - * @type InstalledClock Type of clock to create. + * @type TClock Type of clock to create. */ -export declare function install(opts?: LolexInstallOpts): InstalledClock; +export declare function install(opts?: LolexInstallOpts): InstalledClock; export interface LolexWithContext { timers: GlobalTimers; createClock: (now?: number | Date, loopLimit?: number) => TClock; - install: (opts?: LolexInstallOpts) => InstalledClock; + install: (opts?: LolexInstallOpts) => InstalledClock; withGlobal: (global: Object) => LolexWithContext; } From d7f6e54c62affd4ede49dbb521e719b9babfa421 Mon Sep 17 00:00:00 2001 From: Yishai Zehavi Date: Thu, 8 Nov 2018 12:51:02 +0200 Subject: [PATCH 0029/1304] Updated tests --- types/lolex/lolex-tests.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/types/lolex/lolex-tests.ts b/types/lolex/lolex-tests.ts index 56505c62e9..7137ba261d 100644 --- a/types/lolex/lolex-tests.ts +++ b/types/lolex/lolex-tests.ts @@ -28,7 +28,10 @@ lolex.createClock(new Date()); lolex.createClock(7, 9001); lolex.createClock(new Date(), 9001); -const installedClock = lolex.install({ +// showing two ways to specify the exact clock type for `install()` method: + +// first way: passing the exact clock type to `install()`. +const browserInstalledClock = lolex.install({ advanceTimeDelta: 20, loopLimit: 10, now: 0, @@ -37,7 +40,8 @@ const installedClock = lolex.install({ toFake: ["setTimeout", "nextTick", "hrtime"] }); -lolex.install({ +// second way: specify type for the clock variable as InstallClock. +const nodeInstalledClock: lolex.InstalledClock = lolex.install({ advanceTimeDelta: 20, loopLimit: 10, now: new Date(0), @@ -121,7 +125,11 @@ let [secs, nanos] = nodeClock.hrtime([0, 0]); secs.toFixed(); nanos.toExponential(); -installedClock.uninstall(); +browserInstalledClock.performance.now(); +nodeInstalledClock.nextTick(() => {}); + +browserInstalledClock.uninstall(); +nodeInstalledClock.uninstall(); // Clocks should be typed to have unbound method signatures that can be passed around const { clearTimeout } = browserClock; From 37c539d61955892cdcf7f2539c54b690fa84e106 Mon Sep 17 00:00:00 2001 From: Yishai Zehavi Date: Thu, 8 Nov 2018 12:59:55 +0200 Subject: [PATCH 0030/1304] Fixed tests --- types/lolex/lolex-tests.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/types/lolex/lolex-tests.ts b/types/lolex/lolex-tests.ts index 7137ba261d..2a01dd5916 100644 --- a/types/lolex/lolex-tests.ts +++ b/types/lolex/lolex-tests.ts @@ -28,9 +28,6 @@ lolex.createClock(new Date()); lolex.createClock(7, 9001); lolex.createClock(new Date(), 9001); -// showing two ways to specify the exact clock type for `install()` method: - -// first way: passing the exact clock type to `install()`. const browserInstalledClock = lolex.install({ advanceTimeDelta: 20, loopLimit: 10, @@ -40,8 +37,7 @@ const browserInstalledClock = lolex.install({ toFake: ["setTimeout", "nextTick", "hrtime"] }); -// second way: specify type for the clock variable as InstallClock. -const nodeInstalledClock: lolex.InstalledClock = lolex.install({ +const nodeInstalledClock = lolex.install({ advanceTimeDelta: 20, loopLimit: 10, now: new Date(0), From f8c68f6b3e2113dda0ad9564eec96463da0d727f Mon Sep 17 00:00:00 2001 From: Antoine Brault Date: Wed, 5 Dec 2018 10:09:58 -0500 Subject: [PATCH 0031/1304] [jest] add type inference --- types/expect-puppeteer/index.d.ts | 2 +- types/jest-axe/index.d.ts | 2 +- types/jest-image-snapshot/index.d.ts | 2 +- types/jest-in-case/index.d.ts | 2 +- types/jest-in-case/jest-in-case-tests.ts | 8 +-- types/jest-json-schema/index.d.ts | 2 +- types/jest-matchers/index.d.ts | 2 +- types/jest-plugin-context/index.d.ts | 2 +- types/jest-specific-snapshot/index.d.ts | 2 +- types/jest-when/index.d.ts | 18 +++--- types/jest-when/jest-when-tests.ts | 16 +++-- types/jest/index.d.ts | 63 ++++++++++---------- types/jest/jest-tests.ts | 56 +++++++++++++---- types/jest/tsconfig.json | 1 + types/storybook__addon-storyshots/index.d.ts | 2 +- 15 files changed, 105 insertions(+), 75 deletions(-) diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index b77bc948bd..018e342ce8 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Josh Goldberg // Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.0 /// diff --git a/types/jest-axe/index.d.ts b/types/jest-axe/index.d.ts index 60375e3605..506236773f 100644 --- a/types/jest-axe/index.d.ts +++ b/types/jest-axe/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/nickcolley/jest-axe // Definitions by: Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 3.0 /// diff --git a/types/jest-image-snapshot/index.d.ts b/types/jest-image-snapshot/index.d.ts index c15e435cc9..8eeff20990 100644 --- a/types/jest-image-snapshot/index.d.ts +++ b/types/jest-image-snapshot/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/americanexpress/jest-image-snapshot#readme // Definitions by: Janeene Beeforth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 /// diff --git a/types/jest-in-case/index.d.ts b/types/jest-in-case/index.d.ts index 02d7d08af9..9762bc39d3 100644 --- a/types/jest-in-case/index.d.ts +++ b/types/jest-in-case/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/thinkmill/jest-in-case#readme // Definitions by: Geovani de Souza // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 /// /// diff --git a/types/jest-in-case/jest-in-case-tests.ts b/types/jest-in-case/jest-in-case-tests.ts index 283ade76c1..6af60a5fd4 100644 --- a/types/jest-in-case/jest-in-case-tests.ts +++ b/types/jest-in-case/jest-in-case-tests.ts @@ -11,8 +11,8 @@ function subtract(minuend: number, subtrahend: number) { } beforeEach(() => { - jest.spyOn(global, 'describe').mockImplementation((title, fn) => fn()); - jest.spyOn(global, 'test').mockImplementation((name, fn) => fn()); + jest.spyOn(global, 'describe').mockImplementation((title, fn) => jest.fn()); + jest.spyOn(global, 'test').mockImplementation((name, fn) => jest.fn()); global.test.skip = jest.fn((name, fn) => fn()); global.test.only = jest.fn((name, fn) => fn()); }); @@ -54,8 +54,8 @@ test('array', () => { }); test('object', () => { - jest.spyOn(global, 'describe').mockImplementation((title, fn) => fn()); - jest.spyOn(global, 'test').mockImplementation((name, fn) => fn()); + jest.spyOn(global, 'describe').mockImplementation((title, fn) => jest.fn()); + jest.spyOn(global, 'test').mockImplementation((name, fn) => jest.fn()); const title = 'add(augend, addend)'; diff --git a/types/jest-json-schema/index.d.ts b/types/jest-json-schema/index.d.ts index 67f1c51f7e..b2133526dc 100644 --- a/types/jest-json-schema/index.d.ts +++ b/types/jest-json-schema/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/americanexpress/jest-json-schema#readme // Definitions by: Igor Korolev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 /// import * as ajv from "ajv"; diff --git a/types/jest-matchers/index.d.ts b/types/jest-matchers/index.d.ts index 3b028f8929..705f993ea3 100644 --- a/types/jest-matchers/index.d.ts +++ b/types/jest-matchers/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/facebook/jest#readme // Definitions by: Joscha Feth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 /// export = expect; diff --git a/types/jest-plugin-context/index.d.ts b/types/jest-plugin-context/index.d.ts index da2698b78e..814b334b12 100644 --- a/types/jest-plugin-context/index.d.ts +++ b/types/jest-plugin-context/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/negativetwelve/jest-plugins/tree/master/packages/jest-plugin-context // Definitions by: Jonas Heinrich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 /// diff --git a/types/jest-specific-snapshot/index.d.ts b/types/jest-specific-snapshot/index.d.ts index 61a65a416a..0e0a43d895 100644 --- a/types/jest-specific-snapshot/index.d.ts +++ b/types/jest-specific-snapshot/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/igor-dv/jest-specific-snapshot#readme // Definitions by: Janeene Beeforth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.0 /// diff --git a/types/jest-when/index.d.ts b/types/jest-when/index.d.ts index af62a95830..fbd938b5ff 100644 --- a/types/jest-when/index.d.ts +++ b/types/jest-when/index.d.ts @@ -2,21 +2,17 @@ // Project: https://github.com/timkindberg/jest-when#readme // Definitions by: Alden Taylor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 /// -export interface PartialMockInstance { - mockReturnValue: jest.MockInstance['mockReturnValue']; -} +export type PartialMockInstance = Pick, 'mockReturnValue' | 'mockReturnValueOnce' | 'mockResolvedValue' + | 'mockResolvedValueOnce' | 'mockRejectedValue' | 'mockRejectedValueOnce'>; -export interface When { - (fn: jest.Mocked | jest.Mock): When; - // due to no-unnecessary-generics lint rule, the generics have been replaced with 'any' - // calledWith(...matchers: any[]): PartialMockInstance; - // expectCalledWith(...matchers: any[]): PartialMockInstance; - calledWith(...matchers: any[]): PartialMockInstance; - expectCalledWith(...matchers: any[]): PartialMockInstance; +export interface When { + (fn: jest.Mock): When; + calledWith(...matchers: Y): PartialMockInstance; + expectCalledWith(...matchers: Y): PartialMockInstance; } export const when: When; diff --git a/types/jest-when/jest-when-tests.ts b/types/jest-when/jest-when-tests.ts index 13da65928d..70e0041341 100644 --- a/types/jest-when/jest-when-tests.ts +++ b/types/jest-when/jest-when-tests.ts @@ -31,16 +31,20 @@ describe('mock-when test', () => { it('Supports compound declarations:', () => { const fn = jest.fn(); - when(fn).calledWith(1).mockReturnValue('no'); + when(fn).calledWith(1).mockReturnValueOnce('no').mockReturnValue('yes'); when(fn).calledWith(2).mockReturnValue('way?'); - when(fn).calledWith(3).mockReturnValue('yes'); - when(fn).calledWith(4).mockReturnValue('way!'); + when(fn).calledWith(3).mockResolvedValueOnce('no'); + when(fn).calledWith(3).mockResolvedValue('yes'); + when(fn).calledWith(4).mockRejectedValueOnce('no'); + when(fn).calledWith(4).mockRejectedValue('yes'); expect(fn(1)).toEqual('no'); + expect(fn(1)).toEqual('yes'); expect(fn(2)).toEqual('way?'); - expect(fn(3)).toEqual('yes'); - expect(fn(4)).toEqual('way!'); - expect(fn(5)).toEqual(undefined); + expect(fn(3)).resolves.toEqual('no'); + expect(fn(3)).resolves.toEqual('yes'); + expect(fn(4)).rejects.toEqual('no'); + expect(fn(4)).rejects.toEqual('yes'); }); it('Assert the args:', () => { diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index d434b5e198..f303230f76 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -17,8 +17,9 @@ // Martin Hochel // Sebastian Sebald // Andy +// Antoine Brault // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 declare var beforeAll: jest.Lifecycle; declare var beforeEach: jest.Lifecycle; @@ -35,6 +36,8 @@ declare var xtest: jest.It; declare const expect: jest.Expect; +type ArgsType = T extends (...args: infer A) => any ? A : never; + interface NodeRequire { /** * Returns the actual module instead of a mock, bypassing all checks on @@ -110,11 +113,7 @@ declare namespace jest { /** * Creates a mock function. Optionally takes a mock implementation. */ - function fn(implementation: (...args: any[]) => T): Mock; - /** - * Creates a mock function. Optionally takes a mock implementation. - */ - function fn(implementation?: (...args: any[]) => any): Mock; + function fn(implementation?: (...args: Y) => T): Mock; /** * Use the automatic mocking system to generate a mocked version of the given module. */ @@ -122,7 +121,7 @@ declare namespace jest { /** * Returns whether the given function is a mock function. */ - function isMockFunction(fn: any): fn is Mock; + function isMockFunction(fn: any): fn is Mock; /** * Mocks a module with an auto-mocked version when it is being required. */ @@ -198,7 +197,9 @@ declare namespace jest { * spy.mockRestore(); * }); */ - function spyOn(object: T, method: M, accessType?: 'get' | 'set'): SpyInstance; + function spyOn(object: T, method: M, accessType: 'get'): SpyInstance; + function spyOn(object: T, method: M, accessType: 'set'): SpyInstance; + function spyOn(object: T, method: M): T[M] extends (...args: any[]) => any ? SpyInstance, ArgsType> : never; /** * Indicates that the module system should never return a mocked version of * the specified module from require() (e.g. that it should always return the real module). @@ -762,12 +763,12 @@ declare namespace jest { new (...args: any[]): any; } - interface Mock extends Function, MockInstance { - new (...args: any[]): T; - (...args: any[]): any; + interface Mock extends Function, MockInstance { + new (...args: Y): T; + (...args: Y): T; } - interface SpyInstance extends MockInstance {} + interface SpyInstance extends MockInstance {} /** * Wrap module with mock definitions @@ -781,14 +782,14 @@ declare namespace jest { * myApi.myApiMethod.mockImplementation(() => "test"); */ type Mocked = { - [P in keyof T]: T[P] & MockInstance; + [P in keyof T]: T[P] & MockInstance>; } & T; - interface MockInstance { + interface MockInstance { /** Returns the mock name string set by calling `mockFn.mockName(value)`. */ getMockName(): string; /** Provides access to the mock's metadata */ - mock: MockContext; + mock: MockContext; /** * Resets all information stored in the mockFn.mock.calls and mockFn.mock.instances arrays. * @@ -828,7 +829,7 @@ declare namespace jest { * * Note: `jest.fn(implementation)` is a shorthand for `jest.fn().mockImplementation(implementation)`. */ - mockImplementation(fn?: (...args: any[]) => any): Mock; + mockImplementation(fn?: (...args: Y) => T): Mock; /** * Accepts a function that will be used as an implementation of the mock for one call to the mocked function. * Can be chained so that multiple function calls produce different results. @@ -844,9 +845,9 @@ declare namespace jest { * * myMockFn((err, val) => console.log(val)); // false */ - mockImplementationOnce(fn: (...args: any[]) => any): Mock; + mockImplementationOnce(fn: (...args: Y) => T): Mock; /** Sets the name of the mock`. */ - mockName(name: string): Mock; + mockName(name: string): Mock; /** * Just a simple sugar function for: * @@ -856,7 +857,7 @@ declare namespace jest { * return this; * }); */ - mockReturnThis(): Mock; + mockReturnThis(): Mock; /** * Accepts a value that will be returned whenever the mock function is called. * @@ -868,7 +869,7 @@ declare namespace jest { * mock.mockReturnValue(43); * mock(); // 43 */ - mockReturnValue(value: any): Mock; + mockReturnValue(value: T): Mock; /** * Accepts a value that will be returned for one call to the mock function. Can be chained so that * successive calls to the mock function return different values. When there are no more @@ -885,11 +886,11 @@ declare namespace jest { * console.log(myMockFn(), myMockFn(), myMockFn(), myMockFn()); * */ - mockReturnValueOnce(value: any): Mock; + mockReturnValueOnce(value: T): Mock; /** * Simple sugar function for: `jest.fn().mockImplementation(() => Promise.resolve(value));` */ - mockResolvedValue(value: any): Mock; + mockResolvedValue(value: T | PromiseLike): Mock, Y>; /** * Simple sugar function for: `jest.fn().mockImplementationOnce(() => Promise.resolve(value));` * @@ -909,7 +910,7 @@ declare namespace jest { * }); * */ - mockResolvedValueOnce(value: any): Mock; + mockResolvedValueOnce(value: T | PromiseLike): Mock, Y>; /** * Simple sugar function for: `jest.fn().mockImplementation(() => Promise.reject(value));` * @@ -921,7 +922,7 @@ declare namespace jest { * await asyncMock(); // throws "Async error" * }); */ - mockRejectedValue(value: any): Mock; + mockRejectedValue(value: any): Mock, Y>; /** * Simple sugar function for: `jest.fn().mockImplementationOnce(() => Promise.reject(value));` @@ -939,26 +940,22 @@ declare namespace jest { * }); * */ - mockRejectedValueOnce(value: any): Mock; + mockRejectedValueOnce(value: any): Mock, Y>; } /** * Represents the result of a single call to a mock function. */ interface MockResult { + type: 'return' | 'throw' | 'incomplete'; /** - * True if the function threw. - * False if the function returned. - */ - isThrow: boolean; - /** - * The value that was either thrown or returned by the function. + * The value that was either thrown or returned by the function, or undefined if type = 'incomplete' */ value: any; } - interface MockContext { - calls: any[][]; + interface MockContext { + calls: Y[]; instances: T[]; invocationCallOrder: number[]; /** diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index de1ba90456..b724e5a256 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -253,12 +253,25 @@ jest /* Mocks and spies */ -const mock1: jest.Mock = jest.fn(); -const mock2: jest.Mock = jest.fn(() => undefined); -const mock3: jest.Mock = jest.fn(() => "abc"); -const mock4: jest.Mock<"abc"> = jest.fn((): "abc" => "abc"); -const mock5: jest.Mock = jest.fn((...args: string[]) => args.join("")); -const mock6: jest.Mock = jest.fn((arg: {}) => arg); +// $ExpectType Mock<{}, any[]> +const mock1 = jest.fn(); +// $ExpectType Mock +const mock2 = jest.fn(() => undefined); +// $ExpectType Mock +const mock3 = jest.fn(() => "abc"); +// $ExpectType Mock<"abc", []> +const mock4 = jest.fn((): "abc" => "abc"); +// $ExpectType Mock +const mock5 = jest.fn((...args: string[]) => args.join("")); +// $ExpectType Mock<{}, [{}]> +const mock6 = jest.fn((arg: {}) => arg); +// $ExpectType Mock +const mock7 = jest.fn((arg: number) => arg); + +// $ExpectError +mock7('abc'); +// $ExpectError +mock7.mockImplementation((arg: string) => 1); const genMockModule1: {} = jest.genMockFromModule("moduleName"); const genMockModule2: { a: "b" } = jest.genMockFromModule<{ a: "b" }>("moduleName"); @@ -272,8 +285,8 @@ if (jest.isMockFunction(maybeMock)) { } const mockName: string = jest.fn().getMockName(); -const mockContextVoid: jest.MockContext = jest.fn().mock; -const mockContextString: jest.MockContext = jest.fn(() => "").mock; +const mockContextVoid = jest.fn().mock; +const mockContextString = jest.fn(() => "").mock; jest.fn().mockClear(); @@ -288,9 +301,20 @@ const spiedTarget = { } }; +class SpiedTargetClass { + private _value = 3; + get value() { + return this._value; + } + set value(value) { + this._value = value; + } +} +const spiedTarget2 = new SpiedTargetClass(); + const spy1 = jest.spyOn(spiedTarget, "returnsVoid"); const spy2 = jest.spyOn(spiedTarget, "returnsVoid", "get"); -const spy3 = jest.spyOn(spiedTarget, "returnsString", "set"); +const spy3 = jest.spyOn(spiedTarget, "returnsString"); const spy1Name: string = spy1.getMockName(); const spy2Calls: any[][] = spy2.mock.calls; @@ -298,9 +322,10 @@ const spy2Calls: any[][] = spy2.mock.calls; spy2.mockClear(); spy2.mockReset(); -const spy3Mock: jest.Mock<() => string> = spy3 +const spy3Mock = spy3 .mockImplementation(() => "") .mockImplementation() + // $ExpectError .mockImplementation((arg: {}) => arg) .mockImplementation((...args: string[]) => args.join("")) .mockImplementationOnce(() => "") @@ -313,11 +338,18 @@ const spy3Mock: jest.Mock<() => string> = spy3 .mockRejectedValue("value") .mockRejectedValueOnce("value"); -let spy4: jest.SpyInstance; - +let spy4; spy4 = jest.spyOn(spiedTarget, "returnsString"); spy4.mockRestore(); +// $ExpectType SpyInstance +const spy5 = jest.spyOn(spiedTarget2, "value", "get"); +// $ExpectError +spy5.mockReturnValue('5'); + +// $ExpectType SpyInstance +const spy6 = jest.spyOn(spiedTarget2, "value", "set"); + /* Snapshot serialization */ const snapshotSerializerPlugin: jest.SnapshotSerializerPlugin = { diff --git a/types/jest/tsconfig.json b/types/jest/tsconfig.json index 8a02004840..20bc02a53b 100644 --- a/types/jest/tsconfig.json +++ b/types/jest/tsconfig.json @@ -13,6 +13,7 @@ "typeRoots": [ "../" ], + "target": "es5", "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/storybook__addon-storyshots/index.d.ts b/types/storybook__addon-storyshots/index.d.ts index dc1a2c5953..9b0517cb9f 100644 --- a/types/storybook__addon-storyshots/index.d.ts +++ b/types/storybook__addon-storyshots/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/storybooks/storybook/tree/master/addons/storyshots // Definitions by: Bradley Ayers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.0 import * as React from 'react'; import { StoryObject } from '@storybook/react'; From 3fdb22ed85a782ed5df52f1bfd0a92a6e38784c7 Mon Sep 17 00:00:00 2001 From: antoinebrault Date: Wed, 5 Dec 2018 21:28:24 -0500 Subject: [PATCH 0032/1304] revert MockResult definition --- types/jest/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index f303230f76..02b6cb5cba 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -947,9 +947,13 @@ declare namespace jest { * Represents the result of a single call to a mock function. */ interface MockResult { - type: 'return' | 'throw' | 'incomplete'; /** - * The value that was either thrown or returned by the function, or undefined if type = 'incomplete' + * True if the function threw. + * False if the function returned. + */ + isThrow: boolean; + /** + * The value that was either thrown or returned by the function. */ value: any; } From b33741070dc30e137ad563a68694a9956eeb233b Mon Sep 17 00:00:00 2001 From: antoinebrault Date: Fri, 7 Dec 2018 00:10:10 -0500 Subject: [PATCH 0033/1304] add mockImplementation optional arguments example --- types/jest/jest-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index b724e5a256..b616daaeba 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -273,6 +273,10 @@ mock7('abc'); // $ExpectError mock7.mockImplementation((arg: string) => 1); +const mock8 = jest.fn((a: number, _b: string, _c: {}, _iReallyDontCare: [], _makeItStop: boolean) => Promise.resolve(_makeItStop)); +// mockImplementation not required to declare all arguments +mock8.mockImplementation((a: number) => Promise.resolve(a === 0)); + const genMockModule1: {} = jest.genMockFromModule("moduleName"); const genMockModule2: { a: "b" } = jest.genMockFromModule<{ a: "b" }>("moduleName"); From 3236add57d42a007dd994bf2fe5fd56abff06bfd Mon Sep 17 00:00:00 2001 From: Antoine Brault Date: Mon, 10 Dec 2018 10:28:16 -0500 Subject: [PATCH 0034/1304] rollback default values --- types/jest-when/index.d.ts | 2 +- types/jest/index.d.ts | 6 +++--- types/jest/jest-tests.ts | 13 ++++++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/types/jest-when/index.d.ts b/types/jest-when/index.d.ts index fbd938b5ff..c76fdd1a9b 100644 --- a/types/jest-when/index.d.ts +++ b/types/jest-when/index.d.ts @@ -9,7 +9,7 @@ export type PartialMockInstance = Pick, 'mockReturnValue' | 'mockReturnValueOnce' | 'mockResolvedValue' | 'mockResolvedValueOnce' | 'mockRejectedValue' | 'mockRejectedValueOnce'>; -export interface When { +export interface When { (fn: jest.Mock): When; calledWith(...matchers: Y): PartialMockInstance; expectCalledWith(...matchers: Y): PartialMockInstance; diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 02b6cb5cba..b7486db0ac 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -121,7 +121,7 @@ declare namespace jest { /** * Returns whether the given function is a mock function. */ - function isMockFunction(fn: any): fn is Mock; + function isMockFunction(fn: any): fn is Mock; /** * Mocks a module with an auto-mocked version when it is being required. */ @@ -763,12 +763,12 @@ declare namespace jest { new (...args: any[]): any; } - interface Mock extends Function, MockInstance { + interface Mock extends Function, MockInstance { new (...args: Y): T; (...args: Y): T; } - interface SpyInstance extends MockInstance {} + interface SpyInstance extends MockInstance {} /** * Wrap module with mock definitions diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index b616daaeba..9054bddfa4 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -267,15 +267,20 @@ const mock5 = jest.fn((...args: string[]) => args.join("")); const mock6 = jest.fn((arg: {}) => arg); // $ExpectType Mock const mock7 = jest.fn((arg: number) => arg); +// $ExpectType Mock +const mock8: jest.Mock = jest.fn((arg: number) => arg); // $ExpectError mock7('abc'); // $ExpectError mock7.mockImplementation((arg: string) => 1); +// compiles because mock8 is declared as jest.Mock<{}, any> +mock8('abc'); +mock8.mockImplementation((arg: string) => 1); -const mock8 = jest.fn((a: number, _b: string, _c: {}, _iReallyDontCare: [], _makeItStop: boolean) => Promise.resolve(_makeItStop)); +const mock9 = jest.fn((a: number, _b: string, _c: {}, _iReallyDontCare: [], _makeItStop: boolean) => Promise.resolve(_makeItStop)); // mockImplementation not required to declare all arguments -mock8.mockImplementation((a: number) => Promise.resolve(a === 0)); +mock9.mockImplementation((a: number) => Promise.resolve(a === 0)); const genMockModule1: {} = jest.genMockFromModule("moduleName"); const genMockModule2: { a: "b" } = jest.genMockFromModule<{ a: "b" }>("moduleName"); @@ -342,8 +347,10 @@ const spy3Mock = spy3 .mockRejectedValue("value") .mockRejectedValueOnce("value"); -let spy4; +let spy4: jest.SpyInstance; spy4 = jest.spyOn(spiedTarget, "returnsString"); +// compiles because spy4 is declared as jest.SpyInstance<{}, any> +spy4.mockImplementation(() => 1); spy4.mockRestore(); // $ExpectType SpyInstance From fd0775200e5b709ff3abdb875aa958c2684a791e Mon Sep 17 00:00:00 2001 From: Antoine Brault Date: Tue, 11 Dec 2018 14:21:36 -0500 Subject: [PATCH 0035/1304] use any instead of {} for mock return type --- types/jest/index.d.ts | 4 ++-- types/jest/jest-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index b7486db0ac..89979493b7 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -763,12 +763,12 @@ declare namespace jest { new (...args: any[]): any; } - interface Mock extends Function, MockInstance { + interface Mock extends Function, MockInstance { new (...args: Y): T; (...args: Y): T; } - interface SpyInstance extends MockInstance {} + interface SpyInstance extends MockInstance {} /** * Wrap module with mock definitions diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index 9054bddfa4..0b7b2c21d9 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -305,6 +305,9 @@ jest.fn().mockRestore(); const spiedTarget = { returnsVoid(): void { }, + setValue(value: string): void { + this.value = value; + }, returnsString(): string { return ""; } @@ -361,6 +364,9 @@ spy5.mockReturnValue('5'); // $ExpectType SpyInstance const spy6 = jest.spyOn(spiedTarget2, "value", "set"); +let spy7: jest.SpyInstance; +spy7 = jest.spyOn(spiedTarget, "setValue"); + /* Snapshot serialization */ const snapshotSerializerPlugin: jest.SnapshotSerializerPlugin = { 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 0036/1304] 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 795722e0dc55a6f18a278f594a12bc4ec42d8ebe Mon Sep 17 00:00:00 2001 From: Aleksandar Manukov Date: Sat, 15 Dec 2018 17:25:11 +0200 Subject: [PATCH 0037/1304] Add bootstrap-colorpicker@2.5.3 --- .../bootstrap-colorpicker@2.5.3-tests.ts | 0 types/bootstrap-colorpicker@2.5.3/index.d.ts | 267 ++++++++++++++++++ .../bootstrap-colorpicker@2.5.3/tsconfig.json | 22 ++ types/bootstrap-colorpicker@2.5.3/tslint.json | 1 + 4 files changed, 290 insertions(+) create mode 100644 types/bootstrap-colorpicker@2.5.3/bootstrap-colorpicker@2.5.3-tests.ts create mode 100644 types/bootstrap-colorpicker@2.5.3/index.d.ts create mode 100644 types/bootstrap-colorpicker@2.5.3/tsconfig.json create mode 100644 types/bootstrap-colorpicker@2.5.3/tslint.json diff --git a/types/bootstrap-colorpicker@2.5.3/bootstrap-colorpicker@2.5.3-tests.ts b/types/bootstrap-colorpicker@2.5.3/bootstrap-colorpicker@2.5.3-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/bootstrap-colorpicker@2.5.3/index.d.ts b/types/bootstrap-colorpicker@2.5.3/index.d.ts new file mode 100644 index 0000000000..222b939b89 --- /dev/null +++ b/types/bootstrap-colorpicker@2.5.3/index.d.ts @@ -0,0 +1,267 @@ +// Type definitions for bootstrap-colorpicker 2.5.3 +// Project: https://github.com/farbelous/bootstrap-colorpicker/tree/v2.x +// Definitions by: Aleksandar Manukov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +type ColorPickerAlignOptions = 'right' | 'left'; + +type ColorPickerEvents = 'create' | + 'showPicker' | + 'hidePicker' | + 'changeColor' | + 'disable' | + 'enable' | + 'destroy' + +/** + * You can set colorpicker options either as a plugin parameter or data-* attributes + */ +interface ColorPickerOptions { + /** + * If not false, forces the color format to be hex, rgb or rgba, otherwise the format is automatically detected. + * + * Default: false + */ + format: string; + + /** + * If not false, sets the color to this value. + * + * Default: false + */ + color: string; + + /** + * If not false, the picker will be contained inside this element, otherwise it will be appended to the document body. + * + * Default: false + */ + container: string | JQuery; + + /** + * Children selector for the component or element that trigger the colorpicker and which background color will change (needs an inner element). + * + * Default: '.add-on, .input-group-addon' + */ + component: string | JQuery; + + /** + * Children selector for the input that will store the picker selected value. + * + * Default: 'input' + */ + input: string | JQuery; + + /** + * If true, put a '#' (number sign) before hex strings. + * + * Default: true + */ + hexNumberSignPrefix: boolean; + + /** + * If true, the hue and alpha channel bars will be rendered horizontally, above the saturation selector. + * + * Default: false + */ + horizontal: boolean; + + /** + * If true, forces to show the colorpicker as an inline element. + * + * Default: false + */ + inline: boolean; + + /** + * Vertical sliders configuration (read source code if you really need to tweak this). + */ + sliders: object; + + /** + * Horizontal sliders configuration (read source code if you really need to tweak this). + */ + slidersHorz: object; + + /** + * Customizes the default colorpicker HTML template. + */ + template: string; + + /** + * By default, the colorpicker is aligned to the right of the input. If you need to switch it to the left, set align to 'left'. + * + * Default: 'right' + */ + align: ColorPickerAlignOptions; + + /** + * Adds this class to the colorpicker widget. + * + * Default: null + */ + customClass: string; + + /** + * List of pre selected colors (hex format). If you choose one of these colors, the alias is returned instead of the hex code. + * + * Default: null + */ + colorSelectors: object; + + /** + * Fallback color string that will be applied when the color failed to be parsed. If null, it will keep the current color if any. + * + * Default: null + */ + fallbackColor: string; + + /** + * Fallback color format (e.g. when not specified or for alias mode, when selecting non aliased colors) + * + * Default: hex + */ + fallbackFormat: string; +} + +interface Color { + colors: {}; + fallbackFormat: string; + fallbackValue: string; + hexNumberSignPrefix: boolean; + origFormat: string; + predefinedColors: {}; + value: { + h: number; + s: number; + b: number; + a: number; + } + + /** + * Set a new color. The value is parsed and tries to do a quess on the format. + */ + setColor(value: string): void; + + /** + * Set the HUE with a value between 0 and 1. + */ + setHue(value: number): void; + + /** + * Set the saturation with a value between 0 and 1. + */ + setSaturation(value: number): void; + + /** + * Set the brightness with a value between 0 and 1. + */ + setBrightness(value: number): void; + + /** + * Set the transparency with a value between 0 and 1. + */ + setAlpha(value: number): void; + + /** + * Returns a hash with red, green, blue and alpha. + */ + toRGB(): string; + + /** + * Returns a string with HEX format for the current color. + */ + toHex(): string; + + /** + * Returns a hash with HSLA values. + */ + toHSL(): string; +} + +interface ColorPicker { + color: Color; + component: boolean; + container: boolean; + disabled: boolean; + element: JQuery; + format: string; + input: JQuery; + options: ColorPickerOptions; + picker: JQuery; +} + +interface ColorPickerEventObject { + +} + +interface JQuery { + /** + * Initializes an colorpicker. + */ + colorpicker(): JQuery; + + /** + * Initializes an colorpicker. + */ + colorpicker(options: ColorPickerOptions): JQuery; + + /** + * Gets the value from the input or the data attribute (if has no input), otherwise returns the default value, which defaults to #000000 if not specified. + */ + colorpicker(methodName: 'getValue', defaultValue: string): string; + + /** + * Set a new value for the color picker (also updates everything). Triggers 'changeColor' event. + */ + colorpicker(methodName: 'setValue', value: any): any; + + /** + * Show the color picker + */ + colorpicker(methodName: 'show'): void; + + /** + * Hide the color picker + */ + colorpicker(methodName: 'hide'): void; + + /** + * Updates the color picker's position relative to the element + */ + colorpicker(methodName: 'reposition'): void; + + /** + * Refreshes the widget colors (this is done automatically) + */ + colorpicker(methodName: 'update'): void; + + /** + * Enable the color picker. + */ + colorpicker(methodName: 'enable'): void; + + /** + * Disable the color picker. + */ + colorpicker(methodName: 'disable'): void; + + /** + * Destroys the colorpicker widget and unbind all .colorpicker events from the element and component + */ + colorpicker(methodName: 'destroy'): void; + + /** + * Access to the colorpicker API directly + */ + data(methodName: 'colorpicker'): ColorPicker; + + off(events: ColorPickerEvents, selector?: string, handler?: (event: ColorPickerEventObject) => any): JQuery; + off(events: ColorPickerEvents, handler: (event: ColorPickerEventObject) => any): JQuery; + + on(events: ColorPickerEvents, selector: string, data: any, handler?: (event: ColorPickerEventObject) => any): JQuery; + on(events: ColorPickerEvents, selector: string, handler: (event: ColorPickerEventObject) => any): JQuery; + on(events: ColorPickerEvents, handler: (event: ColorPickerEventObject) => any): JQuery; +} \ No newline at end of file diff --git a/types/bootstrap-colorpicker@2.5.3/tsconfig.json b/types/bootstrap-colorpicker@2.5.3/tsconfig.json new file mode 100644 index 0000000000..61299349f7 --- /dev/null +++ b/types/bootstrap-colorpicker@2.5.3/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", + "bootstrap-colorpicker@2.5.3-tests.ts" + ] +} diff --git a/types/bootstrap-colorpicker@2.5.3/tslint.json b/types/bootstrap-colorpicker@2.5.3/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bootstrap-colorpicker@2.5.3/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From c8a1eeb459f2717f8482ffb2e77cba1be61dbac2 Mon Sep 17 00:00:00 2001 From: Aleksandar Manukov <34056917+aleksandar-manukov@users.noreply.github.com> Date: Sat, 15 Dec 2018 17:55:15 +0200 Subject: [PATCH 0038/1304] Rename bootstrap-colorpicker@2.5.3 to bootstrap-colorpicker@2.x --- .../bootstrap-colorpicker@2.x-tests.ts} | 0 .../index.d.ts | 0 .../tsconfig.json | 0 .../tslint.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename types/{bootstrap-colorpicker@2.5.3/bootstrap-colorpicker@2.5.3-tests.ts => bootstrap-colorpicker@2.x/bootstrap-colorpicker@2.x-tests.ts} (100%) rename types/{bootstrap-colorpicker@2.5.3 => bootstrap-colorpicker@2.x}/index.d.ts (100%) rename types/{bootstrap-colorpicker@2.5.3 => bootstrap-colorpicker@2.x}/tsconfig.json (100%) rename types/{bootstrap-colorpicker@2.5.3 => bootstrap-colorpicker@2.x}/tslint.json (100%) diff --git a/types/bootstrap-colorpicker@2.5.3/bootstrap-colorpicker@2.5.3-tests.ts b/types/bootstrap-colorpicker@2.x/bootstrap-colorpicker@2.x-tests.ts similarity index 100% rename from types/bootstrap-colorpicker@2.5.3/bootstrap-colorpicker@2.5.3-tests.ts rename to types/bootstrap-colorpicker@2.x/bootstrap-colorpicker@2.x-tests.ts diff --git a/types/bootstrap-colorpicker@2.5.3/index.d.ts b/types/bootstrap-colorpicker@2.x/index.d.ts similarity index 100% rename from types/bootstrap-colorpicker@2.5.3/index.d.ts rename to types/bootstrap-colorpicker@2.x/index.d.ts diff --git a/types/bootstrap-colorpicker@2.5.3/tsconfig.json b/types/bootstrap-colorpicker@2.x/tsconfig.json similarity index 100% rename from types/bootstrap-colorpicker@2.5.3/tsconfig.json rename to types/bootstrap-colorpicker@2.x/tsconfig.json diff --git a/types/bootstrap-colorpicker@2.5.3/tslint.json b/types/bootstrap-colorpicker@2.x/tslint.json similarity index 100% rename from types/bootstrap-colorpicker@2.5.3/tslint.json rename to types/bootstrap-colorpicker@2.x/tslint.json 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 0039/1304] 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 0040/1304] 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 0041/1304] 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 0042/1304] 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 0043/1304] 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 0044/1304] 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 bbc6a27c0394914f331dd6457f81166448e04d60 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Wed, 19 Dec 2018 21:49:05 +0000 Subject: [PATCH 0045/1304] [@babel/traverse]: Allowed node aliases as keys in visitors. This is made possible by https://github.com/babel/babel/pull/9110. When the next version after v7.2.2 is released, the package.json can be updated and the build will no longer fail. --- types/babel__traverse/babel__traverse-tests.ts | 5 +++++ types/babel__traverse/index.d.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts index 70f8c5f0b6..98a0338021 100644 --- a/types/babel__traverse/babel__traverse-tests.ts +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -150,3 +150,8 @@ const VisitorStateTest: Visitor = { } } }; + +const VisitorAliasTest: Visitor = { + Function() {}, + Expression() {}, +}; diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts index 89e242129b..fe817d5daf 100644 --- a/types/babel__traverse/index.d.ts +++ b/types/babel__traverse/index.d.ts @@ -145,6 +145,8 @@ export class Binding { export type Visitor = VisitNodeObject & { [Type in Node["type"]]?: VisitNode>; +} & { + [K in keyof t.Aliases]?: VisitNode }; export type VisitNode = VisitNodeFunction | VisitNodeObject; 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 0046/1304] 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 0047/1304] [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 0048/1304] [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 0049/1304] 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 0050/1304] 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 0051/1304] 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 0052/1304] 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 0053/1304] [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 0054/1304] [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 571e4a4208058ff9ec3dd9a443362456cd8b4e71 Mon Sep 17 00:00:00 2001 From: kimcoder-bm Date: Thu, 27 Dec 2018 17:56:27 +0900 Subject: [PATCH 0055/1304] first commit --- types/urlencode/index.d.ts | 51 ++++++++++++++++++++++++++++++ types/urlencode/tsconfig.json | 22 +++++++++++++ types/urlencode/tslint.json | 1 + types/urlencode/urlencode-tests.ts | 15 +++++++++ 4 files changed, 89 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..a74269e486 --- /dev/null +++ b/types/urlencode/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for urlencode 1.1 +// Project: https://github.com/node-modules/urlencode +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*~ If this module is a UMD module that exposes a global variable 'myLib' when + *~ loaded outside a module loader environment, declare that global here. + *~ Otherwise, delete this declaration. + */ +export as namespace urlencode; + +/** + * Encode string + * @param str The string for encoding. + */ +export function encode(str: string, charset?: string): string; + +/** + * Decode string + * @param encodedString The encoded string. + */ +export function decode(encodedString: string, charset?: string): string; + +/** + * Parse querystring + * @param queryString Querystring + * @param charsetParam The charset for parsing + */ +export function parse(queryString: string, charsetParam: charsetParam): string; +export interface charsetParam { + charset: string; +} +/** + * Stringify object + * @param obj Querystring + * @param charsetParam The charset for parsing + */ +export function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): any; + +export default encode; + +// export namespace subProp { +// /*~ For example, given this definition, someone could write: +// *~ import { subProp } from 'yourModule'; +// *~ subProp.foo(); +// *~ or +// *~ import * as yourMod from 'yourModule'; +// *~ yourMod.subProp.foo(); +// */ +// export function foo(): void; +// } \ No newline at end of file diff --git a/types/urlencode/tsconfig.json b/types/urlencode/tsconfig.json new file mode 100644 index 0000000000..bbcc857ffe --- /dev/null +++ b/types/urlencode/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", + "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..5abdb8f9a2 --- /dev/null +++ b/types/urlencode/urlencode-tests.ts @@ -0,0 +1,15 @@ +import urlencode, { decode , parse, stringify } from 'urlencode'; + +urlencode('苏千'); // default is utf8 +urlencode('苏千', 'gbk'); // '%CB%D5%C7%A7' + +// decode gbk +decode('%CB%D5%C7%A7', 'gbk'); // '苏千' + +// parse gbk querystring +parse('nick=%CB%D5%C7%A7', {charset: 'gbk'}); // {nick: '苏千'} + +// stringify obj with gbk encoding +var str = 'x[y][0][v][w]=' + urlencode('雾空', 'gbk'); // x[y][0][v][w]=%CE%ED%BF%D5 +var obj = {'x' : {'y' : [{'v' : {'w' : '雾空'}}]}}; +stringify(obj, {charset: 'gbk'}) \ No newline at end of file From 7d2bb6d01f5f92db93e15c2c68d9b88c602fc698 Mon Sep 17 00:00:00 2001 From: kimcoder Date: Thu, 27 Dec 2018 19:15:23 +0900 Subject: [PATCH 0056/1304] fixed tsconfig, modify lint error --- types/urlencode/index.d.ts | 23 ++++++----------------- types/urlencode/tsconfig.json | 1 + types/urlencode/urlencode-tests.ts | 12 ++++++------ 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/types/urlencode/index.d.ts b/types/urlencode/index.d.ts index a74269e486..0b70cc34be 100644 --- a/types/urlencode/index.d.ts +++ b/types/urlencode/index.d.ts @@ -10,13 +10,13 @@ export as namespace urlencode; /** - * Encode string + * Encode string * @param str The string for encoding. */ export function encode(str: string, charset?: string): string; /** - * Decode string + * Decode string * @param encodedString The encoded string. */ export function decode(encodedString: string, charset?: string): string; @@ -26,26 +26,15 @@ export function decode(encodedString: string, charset?: string): string; * @param queryString Querystring * @param charsetParam The charset for parsing */ -export function parse(queryString: string, charsetParam: charsetParam): string; +export function parse(queryString: string, charsetParam: charsetParam): any; export interface charsetParam { - charset: string; + charset: string; } /** * Stringify object - * @param obj Querystring + * @param obj Query Object * @param charsetParam The charset for parsing */ -export function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): any; +export function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): string; export default encode; - -// export namespace subProp { -// /*~ For example, given this definition, someone could write: -// *~ import { subProp } from 'yourModule'; -// *~ subProp.foo(); -// *~ or -// *~ import * as yourMod from 'yourModule'; -// *~ yourMod.subProp.foo(); -// */ -// export function foo(): void; -// } \ No newline at end of file diff --git a/types/urlencode/tsconfig.json b/types/urlencode/tsconfig.json index bbcc857ffe..197f1167a4 100644 --- a/types/urlencode/tsconfig.json +++ b/types/urlencode/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/urlencode/urlencode-tests.ts b/types/urlencode/urlencode-tests.ts index 5abdb8f9a2..5ee486a92b 100644 --- a/types/urlencode/urlencode-tests.ts +++ b/types/urlencode/urlencode-tests.ts @@ -2,14 +2,14 @@ import urlencode, { decode , parse, stringify } from 'urlencode'; urlencode('苏千'); // default is utf8 urlencode('苏千', 'gbk'); // '%CB%D5%C7%A7' - + // decode gbk decode('%CB%D5%C7%A7', 'gbk'); // '苏千' - + // parse gbk querystring parse('nick=%CB%D5%C7%A7', {charset: 'gbk'}); // {nick: '苏千'} - + // stringify obj with gbk encoding -var str = 'x[y][0][v][w]=' + urlencode('雾空', 'gbk'); // x[y][0][v][w]=%CE%ED%BF%D5 -var obj = {'x' : {'y' : [{'v' : {'w' : '雾空'}}]}}; -stringify(obj, {charset: 'gbk'}) \ No newline at end of file +const str = 'x[y][0][v][w]=' + urlencode('雾空', 'gbk'); // x[y][0][v][w]=%CE%ED%BF%D5 +const obj = {x: {y : [{v : {w : '雾空'}}]}}; +stringify(obj, {charset: 'gbk'}); From 118018bf3bbe1633b78edbec70f685fbd110ec22 Mon Sep 17 00:00:00 2001 From: kimcoder Date: Thu, 27 Dec 2018 19:32:08 +0900 Subject: [PATCH 0057/1304] declare urlencode function ad namespace --- types/urlencode/index.d.ts | 58 ++++++++++++++++-------------- types/urlencode/tsconfig.json | 2 +- types/urlencode/urlencode-tests.ts | 8 ++--- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/types/urlencode/index.d.ts b/types/urlencode/index.d.ts index 0b70cc34be..88281a4120 100644 --- a/types/urlencode/index.d.ts +++ b/types/urlencode/index.d.ts @@ -3,38 +3,44 @@ // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/*~ If this module is a UMD module that exposes a global variable 'myLib' when - *~ loaded outside a module loader environment, declare that global here. - *~ Otherwise, delete this declaration. - */ -export as namespace urlencode; +interface charsetParam { + charset: string; +} /** * Encode string * @param str The string for encoding. */ -export function encode(str: string, charset?: string): string; +declare function urlencode(str: string, charset?: string): string; -/** - * Decode string - * @param encodedString The encoded string. - */ -export function decode(encodedString: string, charset?: string): string; +declare namespace urlencode { + /** + * Encode string + * @param str The string for encoding. + */ + function encode(str: string, charset?: string): string; -/** - * Parse querystring - * @param queryString Querystring - * @param charsetParam The charset for parsing - */ -export function parse(queryString: string, charsetParam: charsetParam): any; -export interface charsetParam { - charset: 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; } -/** - * Stringify object - * @param obj Query Object - * @param charsetParam The charset for parsing - */ -export function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): string; -export default encode; +export default urlencode; diff --git a/types/urlencode/tsconfig.json b/types/urlencode/tsconfig.json index 197f1167a4..8808d5debf 100644 --- a/types/urlencode/tsconfig.json +++ b/types/urlencode/tsconfig.json @@ -7,7 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/urlencode/urlencode-tests.ts b/types/urlencode/urlencode-tests.ts index 5ee486a92b..2008ed3283 100644 --- a/types/urlencode/urlencode-tests.ts +++ b/types/urlencode/urlencode-tests.ts @@ -1,15 +1,15 @@ -import urlencode, { decode , parse, stringify } from 'urlencode'; +import urlencode from 'urlencode'; urlencode('苏千'); // default is utf8 urlencode('苏千', 'gbk'); // '%CB%D5%C7%A7' // decode gbk -decode('%CB%D5%C7%A7', 'gbk'); // '苏千' +urlencode.decode('%CB%D5%C7%A7', 'gbk'); // '苏千' // parse gbk querystring -parse('nick=%CB%D5%C7%A7', {charset: 'gbk'}); // {nick: '苏千'} +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 : '雾空'}}]}}; -stringify(obj, {charset: 'gbk'}); +urlencode.stringify(obj, {charset: 'gbk'}); From 610fbf78ced65aba337029eb61be48dacc4a1010 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 31 Dec 2018 15:11:39 +0100 Subject: [PATCH 0058/1304] Improve selector type --- types/react-redux/index.d.ts | 4 +++- types/react-redux/react-redux-tests.tsx | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index bcbcced0bd..265a7daa49 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -343,7 +343,9 @@ export function connectAdvanced( export type SelectorFactory = (dispatch: Dispatch, factoryOptions: TFactoryOptions) => Selector; -export type Selector = (state: S, ownProps: TOwnProps) => TProps; +export type Selector = TOwnProps extends null + ? (state: S) => TProps + : (state: S, ownProps: TOwnProps) => TProps; export interface ConnectOptions { /** diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 554ace09ff..75d524ce1b 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, Selector } from 'react-redux'; import objectAssign = require('object-assign'); // @@ -1210,3 +1210,16 @@ function TestLibraryManagedAttributes() { const ConnectedComponent2 = connect(mapStateToProps)(Component); {}} />; } + +function TestSelector() { + interface OwnProps { key?: string; } + interface State { key: string; } + + const simpleSelect: Selector = (state: State) => state.key; + const notSimpleSelect: Selector = (state: State, ownProps) => ownProps.key || state.key; + + const ownProps = {}; + const state = { key: 'value' }; + simpleSelect(state); + notSimpleSelect(state, ownProps); +} From feac900bf5d10bfcbd916bacd84dab1b4e4fe13a Mon Sep 17 00:00:00 2001 From: bocai Date: Tue, 1 Jan 2019 23:26:42 +0800 Subject: [PATCH 0059/1304] =?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 0060/1304] =?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 0061/1304] =?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 4653bb866a88555fbad4f78d6946ccd62ff5fcdc Mon Sep 17 00:00:00 2001 From: kimcoder Date: Wed, 2 Jan 2019 12:45:53 +0900 Subject: [PATCH 0062/1304] [@types/urlencode] modify export export default urlencode -> exrpot = urlencode; --- types/urlencode/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/urlencode/index.d.ts b/types/urlencode/index.d.ts index 88281a4120..451626cb79 100644 --- a/types/urlencode/index.d.ts +++ b/types/urlencode/index.d.ts @@ -43,4 +43,4 @@ declare namespace urlencode { function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): string; } -export default urlencode; +export = urlencode; 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 0063/1304] 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 05dc1c5fdc96b1e4b23d635c83bb029b2dec43a8 Mon Sep 17 00:00:00 2001 From: James Lismore Date: Wed, 2 Jan 2019 16:44:56 -0500 Subject: [PATCH 0064/1304] Use better typing for mongo delete return shape --- types/mongoose/index.d.ts | 6 +++--- types/mongoose/mongoose-tests.ts | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 87ce57f05c..92dfd767b3 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -3122,9 +3122,9 @@ declare module "mongoose" { callback?: (err: any, res: T) => void): Promise; /** Removes documents from the collection. */ - remove(conditions: any, callback?: (err: any) => void): Query & QueryHelpers; - deleteOne(conditions: any, callback?: (err: any) => void): Query & QueryHelpers; - deleteMany(conditions: any, callback?: (err: any) => void): Query & QueryHelpers; + remove(conditions: any, callback?: (err: any) => void): Query & QueryHelpers; + deleteOne(conditions: any, callback?: (err: any) => void): Query & QueryHelpers; + deleteMany(conditions: any, callback?: (err: any) => void): Query & QueryHelpers; /** * Same as update(), except MongoDB replace the existing document with the given document (no atomic operators like $set). diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 7d23e6be6b..7d6049a3cb 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1754,6 +1754,11 @@ MongoModel.populate(users, { path: 'weapon' }, function (err, users) { }); MongoModel.remove({ title: 'baby born from alien father' }, cb); MongoModel.remove({_id: '999'}).exec().then(cb).catch(cb); +MongoModel.remove({_id: '999'}).exec().then(res=>console.log(res.ok)); +MongoModel.deleteOne({_id: '999'}).then(res=>console.log(res.ok)); +MongoModel.deleteOne({_id: '999'}).exec().then(res=>console.log(res.ok)); +MongoModel.deleteMany({_id: '999'}).then(res=>console.log('Success?',!!res.ok, 'deleted count', res.n)); +MongoModel.deleteMany({_id: '999'}).exec().then(res=>console.log(res.ok)); MongoModel.update({ age: { $gt: 18 } }, { oldEnough: true }, cb); MongoModel.update({ name: 'Tobi' }, { ferret: true }, { multi: true }, cb); MongoModel.where('age').gte(21).lte(65).exec(cb); 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 0065/1304] 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 0066/1304] 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 0067/1304] 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 0068/1304] 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 0069/1304] 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 0070/1304] [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 0071/1304] 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 0072/1304] 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 0073/1304] 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 0074/1304] 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 0075/1304] 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 0076/1304] 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 144c9b682793bccb1c63bcc17a3abe4590c0b6b2 Mon Sep 17 00:00:00 2001 From: kimcoder-bm Date: Fri, 4 Jan 2019 20:35:44 +0900 Subject: [PATCH 0077/1304] esModuleInterop, allowSyntheticDefaultImports add to tsconfig --- types/urlencode/tsconfig.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/urlencode/tsconfig.json b/types/urlencode/tsconfig.json index 8808d5debf..062ab3224d 100644 --- a/types/urlencode/tsconfig.json +++ b/types/urlencode/tsconfig.json @@ -4,6 +4,8 @@ "lib": [ "es6" ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, From ba53ad7d053e550de17965e9b980b22c40b250a1 Mon Sep 17 00:00:00 2001 From: kimcoder-bm Date: Fri, 4 Jan 2019 20:37:49 +0900 Subject: [PATCH 0078/1304] exprot default urlencode --- types/urlencode/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/urlencode/index.d.ts b/types/urlencode/index.d.ts index 451626cb79..88281a4120 100644 --- a/types/urlencode/index.d.ts +++ b/types/urlencode/index.d.ts @@ -43,4 +43,4 @@ declare namespace urlencode { function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): string; } -export = urlencode; +export default urlencode; From eb98ab858fb7d4c1a3e5eacd99494afdefeda5cd Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:50:54 +0300 Subject: [PATCH 0079/1304] [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 0080/1304] [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 0081/1304] [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 0082/1304] [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 0083/1304] =?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 0084/1304] 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 0085/1304] 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 0086/1304] 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 0087/1304] 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 0088/1304] 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 0089/1304] 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 0e869988bc237d947fa74ca74e8a767f9eff1f78 Mon Sep 17 00:00:00 2001 From: Che Coxshall Date: Fri, 4 Jan 2019 16:23:15 +0000 Subject: [PATCH 0090/1304] Added 'isRange' method definition --- types/moment-range/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/moment-range/index.d.ts b/types/moment-range/index.d.ts index 18538e5c6d..a7d2fd25e6 100644 --- a/types/moment-range/index.d.ts +++ b/types/moment-range/index.d.ts @@ -57,6 +57,7 @@ export class DateRange { export interface MomentRangeMethods { range(range: string | Date[] | moment.Moment[]): DateRange; range(start: Date | moment.Moment, end: Date | moment.Moment): DateRange; + isRange(range: any): range is DateRange; within(range: DateRange): boolean; } From 68a4eba2a1efdc7a470c31675b8da1ff304f3b62 Mon Sep 17 00:00:00 2001 From: Che Coxshall Date: Fri, 4 Jan 2019 16:25:20 +0000 Subject: [PATCH 0091/1304] Forgot to update header --- types/moment-range/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/moment-range/index.d.ts b/types/moment-range/index.d.ts index a7d2fd25e6..f45ab0ed8b 100644 --- a/types/moment-range/index.d.ts +++ b/types/moment-range/index.d.ts @@ -4,6 +4,7 @@ // Wilgert Velinga // Juan Francisco Adame // MartynasZilinskas +// Che Coxshall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import moment = require('moment'); From 511c202dce506ae593082c8295005df075180d26 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Fri, 4 Jan 2019 20:59:58 +0100 Subject: [PATCH 0092/1304] 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 0093/1304] 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 0094/1304] 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 0095/1304] 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 0096/1304] 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 0097/1304] 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 0098/1304] 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 656fa06c9aee710a65b52a31564bd19708aec5d0 Mon Sep 17 00:00:00 2001 From: kimcoder-bm Date: Sat, 5 Jan 2019 11:15:09 +0900 Subject: [PATCH 0099/1304] modify export = --- types/urlencode/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/urlencode/index.d.ts b/types/urlencode/index.d.ts index 88281a4120..451626cb79 100644 --- a/types/urlencode/index.d.ts +++ b/types/urlencode/index.d.ts @@ -43,4 +43,4 @@ declare namespace urlencode { function stringify(obj: any, prefix?: charsetParam, charsetParam?: charsetParam): string; } -export default urlencode; +export = urlencode; From 7af0053a0bc5cd73974dc2c2f7b1495f87b6b728 Mon Sep 17 00:00:00 2001 From: kimcoder-bm Date: Sat, 5 Jan 2019 16:27:38 +0900 Subject: [PATCH 0100/1304] add @types/body-scroll-lock --- .../body-scroll-lock-tests.ts | 11 +++++++++ types/body-scroll-lock/index.d.ts | 13 ++++++++++ types/body-scroll-lock/tsconfig.json | 24 +++++++++++++++++++ types/body-scroll-lock/tslint.json | 1 + 4 files changed, 49 insertions(+) create mode 100644 types/body-scroll-lock/body-scroll-lock-tests.ts create mode 100644 types/body-scroll-lock/index.d.ts create mode 100644 types/body-scroll-lock/tsconfig.json create mode 100644 types/body-scroll-lock/tslint.json diff --git a/types/body-scroll-lock/body-scroll-lock-tests.ts b/types/body-scroll-lock/body-scroll-lock-tests.ts new file mode 100644 index 0000000000..4d716e7355 --- /dev/null +++ b/types/body-scroll-lock/body-scroll-lock-tests.ts @@ -0,0 +1,11 @@ +import { enableBodyScroll, disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock'; + +const dom: HTMLDivElement = new HTMLDivElement(); + +disableBodyScroll(dom, { + reserveScrollBarGap: false, +}); + +enableBodyScroll(dom); + +clearAllBodyScrollLocks(); diff --git a/types/body-scroll-lock/index.d.ts b/types/body-scroll-lock/index.d.ts new file mode 100644 index 0000000000..21d45406ab --- /dev/null +++ b/types/body-scroll-lock/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for body-scroll-lock 2.6 +// Project: https://github.com/willmcpo/body-scroll-lock (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: kimcoder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface BodyScrollOptions { + reserveScrollBarGap?: boolean; + allowTouchMove?: () => void; +} + +export function disableBodyScroll(targetElement: HTMLElement, options?: BodyScrollOptions): void; +export function enableBodyScroll(targetElement: HTMLElement): void; +export function clearAllBodyScrollLocks(): void; diff --git a/types/body-scroll-lock/tsconfig.json b/types/body-scroll-lock/tsconfig.json new file mode 100644 index 0000000000..d94754517f --- /dev/null +++ b/types/body-scroll-lock/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "body-scroll-lock-tests.ts" + ] +} diff --git a/types/body-scroll-lock/tslint.json b/types/body-scroll-lock/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/body-scroll-lock/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a150058ab45d937d171d4d8af97dc702d3536d61 Mon Sep 17 00:00:00 2001 From: kimcoder-bm Date: Sat, 5 Jan 2019 16:30:19 +0900 Subject: [PATCH 0101/1304] removed urlencode types --- 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 deletions(-) delete mode 100644 types/urlencode/index.d.ts delete mode 100644 types/urlencode/tsconfig.json delete mode 100644 types/urlencode/tslint.json delete mode 100644 types/urlencode/urlencode-tests.ts diff --git a/types/urlencode/index.d.ts b/types/urlencode/index.d.ts deleted file mode 100644 index 451626cb79..0000000000 --- a/types/urlencode/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -// 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 deleted file mode 100644 index 062ab3224d..0000000000 --- a/types/urlencode/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "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 deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/urlencode/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/urlencode/urlencode-tests.ts b/types/urlencode/urlencode-tests.ts deleted file mode 100644 index 2008ed3283..0000000000 --- a/types/urlencode/urlencode-tests.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 c38f3d2767f154dc0f425541e004ce5ada484f7e Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Sat, 5 Jan 2019 12:53:07 +0100 Subject: [PATCH 0102/1304] 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 0103/1304] 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 0104/1304] 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 0ccaf36b05c786d4f332658a9f471f0c5bd71acb Mon Sep 17 00:00:00 2001 From: antoinebrault Date: Sat, 5 Jan 2019 15:16:49 -0500 Subject: [PATCH 0105/1304] add jest-when type inference --- types/jest-when/index.d.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/types/jest-when/index.d.ts b/types/jest-when/index.d.ts index c76fdd1a9b..386911ed7c 100644 --- a/types/jest-when/index.d.ts +++ b/types/jest-when/index.d.ts @@ -6,13 +6,17 @@ /// -export type PartialMockInstance = Pick, 'mockReturnValue' | 'mockReturnValueOnce' | 'mockResolvedValue' - | 'mockResolvedValueOnce' | 'mockRejectedValue' | 'mockRejectedValueOnce'>; - -export interface When { - (fn: jest.Mock): When; - calledWith(...matchers: Y): PartialMockInstance; - expectCalledWith(...matchers: Y): PartialMockInstance; +export interface WhenMock extends jest.Mock { + calledWith(...matchers: Y): WhenMock; + expectCalledWith(...matchers: Y): WhenMock; + mockReturnValue(value: T): WhenMock; + mockReturnValueOnce(value: T): WhenMock; + mockResolvedValue(value: T | PromiseLike): WhenMock, Y>; + mockResolvedValueOnce(value: T | PromiseLike): WhenMock, Y>; + mockRejectedValue(value: T | PromiseLike): WhenMock, Y>; + mockRejectedValueOnce(value: T | PromiseLike): WhenMock, Y>; } +export type When = (fn: jest.Mock) => WhenMock; + export const when: When; From 58e01e780d39cf25fd5a9241b9d271b4e035f3a2 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 5 Jan 2019 16:26:04 -0500 Subject: [PATCH 0106/1304] 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 0107/1304] 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 0108/1304] 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 0109/1304] 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 0110/1304] 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 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 0111/1304] 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 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 0112/1304] 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 0113/1304] 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 0114/1304] 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 0115/1304] 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 0116/1304] 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 0117/1304] 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 0118/1304] 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 0119/1304] 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 0120/1304] 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 0121/1304] 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 4de11f4fb370f9e5bb0b1e7864b31ad97d2ccad2 Mon Sep 17 00:00:00 2001 From: Anton Astashov Date: Sun, 6 Jan 2019 15:10:40 -0600 Subject: [PATCH 0122/1304] [@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 0123/1304] 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 79d1731c9ab4d33270dcd54c3ec9503c5c6d14d1 Mon Sep 17 00:00:00 2001 From: Oskar Lindgren Date: Mon, 7 Jan 2019 11:35:49 +0900 Subject: [PATCH 0124/1304] 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 0125/1304] 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 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 0126/1304] =?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 0127/1304] 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 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 0128/1304] 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 0129/1304] 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 0130/1304] 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 0131/1304] 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 0132/1304] 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 0133/1304] 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 0134/1304] 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 0135/1304] 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 0136/1304] 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 0137/1304] 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 0138/1304] 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 0139/1304] 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 0140/1304] 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 0141/1304] 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 0142/1304] 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 0143/1304] 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 2d72e749a3414fc830df2072cf9cd1b850453c4a Mon Sep 17 00:00:00 2001 From: Wouter R Date: Mon, 7 Jan 2019 17:11:58 +0100 Subject: [PATCH 0144/1304] 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 0145/1304] 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 0146/1304] 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 0147/1304] 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 0148/1304] 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 0149/1304] 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 0150/1304] 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 0151/1304] 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 3ca0032c6aa4bc2ebe6a9386feaaab070c2ad41a Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Mon, 7 Jan 2019 22:09:30 +0100 Subject: [PATCH 0152/1304] 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 0153/1304] 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 0154/1304] 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 052b722ac1ff53186c754fed182e095012b6973e Mon Sep 17 00:00:00 2001 From: kimcoder Date: Tue, 8 Jan 2019 07:43:55 +0900 Subject: [PATCH 0155/1304] modify allowTouchMove type --- types/body-scroll-lock/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/body-scroll-lock/index.d.ts b/types/body-scroll-lock/index.d.ts index 21d45406ab..f771e2969a 100644 --- a/types/body-scroll-lock/index.d.ts +++ b/types/body-scroll-lock/index.d.ts @@ -5,7 +5,7 @@ export interface BodyScrollOptions { reserveScrollBarGap?: boolean; - allowTouchMove?: () => void; + allowTouchMove?: (el: HTMLElement) => void; } export function disableBodyScroll(targetElement: HTMLElement, options?: BodyScrollOptions): void; From 314a93b409d40f27ca6ad26021966e8a5f8b5cf2 Mon Sep 17 00:00:00 2001 From: Nicholas Steicke Date: Tue, 8 Jan 2019 09:57:42 +1030 Subject: [PATCH 0156/1304] 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 0157/1304] 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 0158/1304] 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 0159/1304] [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 0160/1304] 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 0161/1304] 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 0162/1304] 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 0163/1304] 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 0164/1304] 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 0165/1304] [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 0166/1304] 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 0167/1304] 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 0168/1304] =?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 0169/1304] =?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 0170/1304] [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 0171/1304] 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 0172/1304] =?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 0173/1304] =?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 0174/1304] =?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 0175/1304] 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 0176/1304] =?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 0177/1304] 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 0178/1304] 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 0179/1304] =?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 0180/1304] =?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 0181/1304] =?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 0182/1304] 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 0183/1304] 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 0184/1304] 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 8347dc7f1586ca6b2c139a71160019512045be28 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 8 Jan 2019 14:00:46 +0100 Subject: [PATCH 0185/1304] 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 0186/1304] 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 0187/1304] 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 0188/1304] 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 0189/1304] 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 0190/1304] 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 0191/1304] 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 f5a570b0394a8f6d1b9d5baf3b92d88d4e64865a Mon Sep 17 00:00:00 2001 From: Malthe Borch Date: Tue, 8 Jan 2019 17:08:29 +0100 Subject: [PATCH 0192/1304] 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 0193/1304] 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 0194/1304] 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 0195/1304] 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 0196/1304] 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 0197/1304] 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 0198/1304] 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 0199/1304] 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 0200/1304] 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 0201/1304] 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 0202/1304] 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 0203/1304] [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 0204/1304] 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 0205/1304] 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 0206/1304] [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 a57f667049a912095a0d11490ee6bcb5a5ed97af Mon Sep 17 00:00:00 2001 From: James Lawrence Date: Tue, 8 Jan 2019 23:18:16 +0000 Subject: [PATCH 0207/1304] Allow dynamic CSS values based on component props --- types/react-jss/lib/injectSheet.d.ts | 50 +++++++++++++++++----------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/types/react-jss/lib/injectSheet.d.ts b/types/react-jss/lib/injectSheet.d.ts index fd66af5c38..be3bee933b 100644 --- a/types/react-jss/lib/injectSheet.d.ts +++ b/types/react-jss/lib/injectSheet.d.ts @@ -53,26 +53,35 @@ export type PropsOf = C extends new (props: infer P) => React.Component */ export type PropInjector = < C extends React.ComponentType, InjectedProps>> ->( + >( component: C ) => React.ComponentType< Omit>, keyof InjectedProps> & - AdditionalProps ->; + AdditionalProps + >; -export interface CSSProperties extends CSS.Properties { +type cssNumberOrString = CSS.Properties + +// Allow functions that take the properties of the component and return a CSS value +export type CssRule = { + [K in keyof cssNumberOrString]: + | (cssNumberOrString[K]) + | ((props: Props) => cssNumberOrString[K]) +}[keyof CSS.Properties] + +export interface CSSProperties { // Allow pseudo selectors and media queries [k: string]: - | CSS.Properties[keyof CSS.Properties] - | CSSProperties; + | CssRule + | CSSProperties; } -export type Styles = Record< +export type Styles = Record< ClassKey, - CSSProperties ->; -export type StyleCreator = ( + CSSProperties + >; +export type StyleCreator = ( theme: T -) => Styles; +) => Styles; export interface Theming { channel: string; @@ -89,15 +98,16 @@ export interface InjectOptions extends CreateStyleSheetOptions { export type ClassNameMap = Record; export type WithSheet< S extends string | Styles | StyleCreator, - GivenTheme = undefined -> = { + GivenTheme = undefined, + Props = {} + > = { classes: ClassNameMap< S extends string ? S - : S extends StyleCreator - ? C - : S extends Styles ? C : never - >; + : S extends StyleCreator + ? C + : S extends Styles ? C : never + >; } & WithTheme ? T : GivenTheme>; export interface WithTheme { @@ -110,7 +120,7 @@ export interface StyledComponentProps { innerRef?: React.Ref | React.RefObject; } -export default function injectSheet( - stylesOrCreator: Styles | StyleCreator, +export default function injectSheet( + stylesOrCreator: Styles | StyleCreator, options?: InjectOptions -): PropInjector, StyledComponentProps>; +): PropInjector, StyledComponentProps>; From c9d1d8aa3fcc6f224a29abf0a7c049ca703487ef Mon Sep 17 00:00:00 2001 From: Javon Harper Date: Tue, 8 Jan 2019 18:21:50 -0500 Subject: [PATCH 0208/1304] 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 6f2624fb38349499664984ca14893f72f9c4e461 Mon Sep 17 00:00:00 2001 From: James Lawrence Date: Tue, 8 Jan 2019 23:31:16 +0000 Subject: [PATCH 0209/1304] Add attribution, fix linter errors --- types/react-jss/index.d.ts | 1 + types/react-jss/lib/injectSheet.d.ts | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/types/react-jss/index.d.ts b/types/react-jss/index.d.ts index 7656897a08..c2ee0a008a 100644 --- a/types/react-jss/index.d.ts +++ b/types/react-jss/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-jss 8.6 // Project: https://github.com/cssinjs/react-jss#readme // Definitions by: Sebastian Silbermann +// James Lawrence // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import { createGenerateClassName, JSS, SheetsRegistry } from "jss"; diff --git a/types/react-jss/lib/injectSheet.d.ts b/types/react-jss/lib/injectSheet.d.ts index be3bee933b..5aa3b0925b 100644 --- a/types/react-jss/lib/injectSheet.d.ts +++ b/types/react-jss/lib/injectSheet.d.ts @@ -60,14 +60,12 @@ export type PropInjector = < AdditionalProps >; -type cssNumberOrString = CSS.Properties - // Allow functions that take the properties of the component and return a CSS value export type CssRule = { - [K in keyof cssNumberOrString]: - | (cssNumberOrString[K]) - | ((props: Props) => cssNumberOrString[K]) -}[keyof CSS.Properties] + [K in keyof CSS.Properties]: + | (CSS.Properties[K]) + | ((props: Props) => CSS.Properties[K]) +}[keyof CSS.Properties]; export interface CSSProperties { // Allow pseudo selectors and media queries From 3aaa16ae95e86c39f33827bb24ea1e92c7fb96d3 Mon Sep 17 00:00:00 2001 From: Benjamin Davies Date: Wed, 9 Jan 2019 12:33:28 +1300 Subject: [PATCH 0210/1304] 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 2b59ec43297e987f39a4b46eed4f8adcf7656771 Mon Sep 17 00:00:00 2001 From: Nitesh Phadatare Date: Wed, 9 Jan 2019 09:52:02 +0530 Subject: [PATCH 0211/1304] [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 0212/1304] [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 0213/1304] 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 0214/1304] 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 0215/1304] 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 bf6a005b882f1ab66f5d22368c94e35a46406744 Mon Sep 17 00:00:00 2001 From: AlessandroFerrariFood Date: Wed, 9 Jan 2019 12:26:15 +0100 Subject: [PATCH 0216/1304] 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 0217/1304] 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 0218/1304] 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 0219/1304] 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 0220/1304] 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 0221/1304] 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 0222/1304] 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 0223/1304] 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 0224/1304] @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 0225/1304] [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 0226/1304] 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 0227/1304] [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 0228/1304] [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 0229/1304] [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 8515615be78eecfcf2918b197d38e0a2236d382e Mon Sep 17 00:00:00 2001 From: Andy Chen Date: Wed, 9 Jan 2019 14:59:47 -0800 Subject: [PATCH 0230/1304] 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 0231/1304] 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 0232/1304] [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 0233/1304] [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 6eb77511162839e409a5dbaeff533006b655a312 Mon Sep 17 00:00:00 2001 From: James Lawrence Date: Thu, 10 Jan 2019 01:05:38 +0000 Subject: [PATCH 0234/1304] Rename to DynamicCSSRule --- types/react-jss/lib/injectSheet.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-jss/lib/injectSheet.d.ts b/types/react-jss/lib/injectSheet.d.ts index 5aa3b0925b..ef6bdb3dbb 100644 --- a/types/react-jss/lib/injectSheet.d.ts +++ b/types/react-jss/lib/injectSheet.d.ts @@ -61,16 +61,16 @@ export type PropInjector = < >; // Allow functions that take the properties of the component and return a CSS value -export type CssRule = { +export type DynamicCSSRule = { [K in keyof CSS.Properties]: - | (CSS.Properties[K]) + | CSS.Properties[K] | ((props: Props) => CSS.Properties[K]) }[keyof CSS.Properties]; export interface CSSProperties { // Allow pseudo selectors and media queries [k: string]: - | CssRule + | DynamicCSSRule | CSSProperties; } export type Styles = Record< From 3180fea53f4827c599e89369d613b33d4e167048 Mon Sep 17 00:00:00 2001 From: James Lawrence Date: Thu, 10 Jan 2019 01:06:44 +0000 Subject: [PATCH 0235/1304] Update tests - had to disable strict function checking, if anyone knows how to make it work with this, please do! --- types/react-jss/react-jss-tests.tsx | 59 ++++++++++++++++------------- types/react-jss/tsconfig.json | 2 +- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/types/react-jss/react-jss-tests.tsx b/types/react-jss/react-jss-tests.tsx index 803170bb99..6e86bed492 100644 --- a/types/react-jss/react-jss-tests.tsx +++ b/types/react-jss/react-jss-tests.tsx @@ -17,42 +17,44 @@ interface MyTheme { /** * helper function to counter typescripts type widening */ -function createStyles(styles: Styles): Styles { +function createStyles(styles: Styles): Styles { return styles; } -const styles = (theme: MyTheme) => - createStyles({ - myButton: { - color: theme.color.primary, - margin: 1, - "& span": { - fontWeight: "revert" - } - }, - myLabel: { - fontStyle: "italic" - } - }); -interface ButtonProps extends WithSheet { +interface ButtonProps { label: string; + active?: boolean; } -const Button: React.SFC = ({ classes, children }) => { +const styles = (theme: MyTheme) => createStyles({ + myButton: { + color: (props: ButtonProps) => props.active ? 'red': theme.color.primary, + margin: 1, + "& span": { + fontWeight: "revert" + } + }, + myLabel: { + fontStyle: "italic" + } +}); +const Button: React.SFC> = ({active, classes, children}) => { return ( - + <> + + ); }; const ManuallyStyles = () => { return (