diff --git a/README.es.md b/README.es.md index b2fa6ae5914f73..5814d19c90c359 100644 --- a/README.es.md +++ b/README.es.md @@ -139,7 +139,7 @@ Ve todas las opciones en [dts-gen](https://github.com/microsoft/DefinitelyTyped- Los miembros de Definitely Typed frecuentemente monitorean nuevos PRs, pero ten en mente que la cantidad de PRs podrían ralentizar el proceso. -Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). +Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js). #### Remover un paquete diff --git a/README.fr.md b/README.fr.md index ab3df440cd3e0e..8f2c5e824497e5 100644 --- a/README.fr.md +++ b/README.fr.md @@ -202,7 +202,7 @@ Si vous avez des fichiers `.d.ts` en plus de `index.d.ts`, assurez-vous qu'ils s Les membres de Definitely Typed surveillent régulièrement les nouveaux PRs, bien qu'il faille garder à l'esprit que le nombre d'autres PRs peut ralentir les choses. -Pour un bon exemple de package, voir [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). +Pour un bon exemple de package, voir [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js). #### Supprimer un package diff --git a/README.it.md b/README.it.md index e749ffb27f94ca..c95f4888a31c8c 100644 --- a/README.it.md +++ b/README.it.md @@ -177,7 +177,7 @@ Se hai file `.d.ts` oltre all'`index.d.ts`, assicurati che siano referenziati o I membri di Definitely Typed controllano continuamente le nuove pull request, perciò sii al corrente che un alto numero di pull request potrebbe rallentarci il lavoro. -Per l'esempio di un buon package, guarda [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). +Per l'esempio di un buon package, guarda [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js). #### Rimuovere un package diff --git a/README.ja.md b/README.ja.md index 54912b6d6fa540..afb7522f0171fc 100644 --- a/README.ja.md +++ b/README.ja.md @@ -176,7 +176,7 @@ dts-gen の全オプションは[こちら](https://github.com/microsoft/Definit Definitely Typed のメンバーは常に新しい PR をチェックしていますが、他の PR の数によっては対応が遅れる場合があることをご了承ください。 -[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js) を、パッケージのサンプルとして参考にするのがよいでしょう。 +[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js) を、パッケージのサンプルとして参考にするのがよいでしょう。 #### パッケージを削除する diff --git a/README.ko.md b/README.ko.md index 2c7120f21f1570..c3676e933dc680 100644 --- a/README.ko.md +++ b/README.ko.md @@ -160,7 +160,7 @@ npm 에 올라가 있지 않은 패키지를 위한 자료형(Typing) 패키지 Definitely Typed 의 관리자들이 주기적으로 새로운 풀 리퀘스트(Pull request)들을 확인하기는 하지만, 다른 풀 리퀘스트(Pull request)가 많을 경우 확인이 느려질 수 있다는 걸 알아주세요. -[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js) 패키지는 좋은 예시 중 하나입니다. +[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js) 패키지는 좋은 예시 중 하나입니다. #### 패키지 삭제하기 diff --git a/README.md b/README.md index 994458e1d12dbb..b62b8d7fb05fe2 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ If you have `.d.ts` files besides `index.d.ts`, make sure that they are referenc Definitely Typed members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down. -For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). +For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js). #### Removing a package diff --git a/README.pt.md b/README.pt.md index 3ea9d72f94bc52..bd7cf21fa01da3 100644 --- a/README.pt.md +++ b/README.pt.md @@ -152,7 +152,7 @@ Se há outros arquivos `.d.ts` além do arquivo `index.d.ts`, tenha certeza de q Os membros do Definitely Typed frequentemente monitoram os novos PRs, porém tenha em mente de que a quantidade de PRs pode atrasar o processo. -Para ver um bom exemplo, veja o pacote [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). +Para ver um bom exemplo, veja o pacote [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js). #### Removendo um pacote diff --git a/README.ru.md b/README.ru.md index 8822bf6d51cf60..01e82f27656ad3 100644 --- a/README.ru.md +++ b/README.ru.md @@ -159,7 +159,7 @@ Definitely Typed работает только благодаря вкладу Члены группы Definitely Typed регулярно следят за новыми PR, но имейте в виду, что количество других PR может замедлить ход событий. -Хороший пример пакета смотрите [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). +Хороший пример пакета смотрите [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js). #### Удаление пакета diff --git a/README.zh-Hans.md b/README.zh-Hans.md index 3fe80ace7d357c..70b460086d5cfb 100644 --- a/README.zh-Hans.md +++ b/README.zh-Hans.md @@ -193,7 +193,7 @@ declare module "libname" { Definitely Typed 的成员会定期查看新的 PR,但是请留意,当 PR 数量过多的时候,检查速度可能会减慢。 -如果你想要真实的示例,[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js) 是个很好的例子。 +如果你想要真实的示例,[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/a2ff1d2088143cbacc15786c7f3b0ec67179523c/types/base64-js) 是个很好的例子。 #### 删除软件包 diff --git a/notNeededPackages.json b/notNeededPackages.json index 01cd209033735d..8969045baccc67 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -5951,6 +5951,10 @@ "libraryName": "react-vega", "asOfVersion": "7.0.0" }, + "react-virtualized-auto-sizer": { + "libraryName": "react-virtualized-auto-sizer", + "asOfVersion": "1.0.8" + }, "react-visibility-sensor": { "libraryName": "react-visibility-sensor", "asOfVersion": "5.1.0" diff --git a/types/dom-mediacapture-record/package.json b/types/dom-mediacapture-record/package.json index 59f714c6b44615..d51a96a564b41f 100644 --- a/types/dom-mediacapture-record/package.json +++ b/types/dom-mediacapture-record/package.json @@ -9,11 +9,6 @@ ], "types": "index", "typesVersions": { - "<=5.0": { - "*": [ - "ts5.0/*" - ] - }, "<=5.6": { "*": [ "ts5.6/*" diff --git a/types/dom-mediacapture-record/ts5.0/dom-mediacapture-record-tests.ts b/types/dom-mediacapture-record/ts5.0/dom-mediacapture-record-tests.ts deleted file mode 100644 index aad35787af3786..00000000000000 --- a/types/dom-mediacapture-record/ts5.0/dom-mediacapture-record-tests.ts +++ /dev/null @@ -1,68 +0,0 @@ -const isWebmSupported: boolean = window.MediaRecorder.isTypeSupported( - "video/webm", -); - -const mediaStream = new MediaStream(); - -const mediaRecorderOptions: MediaRecorderOptions = { - mimeType: "video/webm", - audioBitsPerSecond: 1000000, - videoBitsPerSecond: 4000000, - audioBitrateMode: "variable", -}; - -const blobEvent = new BlobEvent("dataavailable", { - data: new Blob(), - bubbles: false, -}); -const errorEvent = new MediaRecorderErrorEvent("error", { - error: new DOMException(), - bubbles: false, -}); - -const onDataAvailable = (event: BlobEvent) => { - const blobType = event.data.type; -}; - -const onError = (event: Event) => { - const errorMessage = (event as MediaRecorderErrorEvent).error.message; -}; - -const onEvent = (event: Event) => {}; - -let recorder = new window.MediaRecorder(mediaStream); -recorder = new MediaRecorder(mediaStream, mediaRecorderOptions); - -recorder.start(); -recorder.stop(); -recorder.start(1000); -recorder.pause(); -recorder.requestData(); -const state: "inactive" | "recording" | "paused" = recorder.state; -const isRecording = state === "recording"; -const isAudioVariableBitrate = recorder.audioBitrateMode === "variable"; - -recorder.addEventListener("start", onEvent); -recorder.removeEventListener("start", onEvent); -recorder.dispatchEvent(blobEvent); - -recorder.ondataavailable = onDataAvailable; -recorder.ondataavailable = onEvent; -recorder.onerror = onError; -recorder.onpause = onEvent; -recorder.onresume = onEvent; -recorder.onstart = onEvent; -recorder.onstop = onEvent; - -recorder.ondataavailable = null; -recorder.onerror = null; -recorder.onpause = null; -recorder.onresume = null; -recorder.onstart = null; -recorder.onstop = null; - -recorder.addEventListener("dataavailable", (e: BlobEvent) => {}); -recorder.addEventListener("error", (e: Event) => {}); -recorder.addEventListener("pause", onEvent); -recorder.addEventListener("resume", onEvent); -recorder.addEventListener("dataavailable", onEvent); diff --git a/types/dom-mediacapture-record/ts5.0/index.d.ts b/types/dom-mediacapture-record/ts5.0/index.d.ts deleted file mode 100644 index fed16c76f3df1b..00000000000000 --- a/types/dom-mediacapture-record/ts5.0/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -interface MediaRecorderErrorEventInit extends EventInit { - error: DOMException; -} - -interface MediaRecorderErrorEvent extends Event { - readonly error: DOMException; -} - -declare var MediaRecorderErrorEvent: { - prototype: MediaRecorderErrorEvent; - new(type: string, eventInitDict: MediaRecorderErrorEventInit): MediaRecorderErrorEvent; -}; - -interface BlobEventInit extends EventInit { - data: Blob; - timecode?: number | undefined; -} - -interface BlobEvent extends Event { - readonly data: Blob; - readonly timecode: DOMHighResTimeStamp; -} - -declare var BlobEvent: { - prototype: BlobEvent; - new(type: string, eventInitDict: BlobEventInit): BlobEvent; -}; - -type BitrateMode = "variable" | "constant"; - -interface MediaRecorderOptions { - mimeType?: string | undefined; - audioBitsPerSecond?: number | undefined; - videoBitsPerSecond?: number | undefined; - bitsPerSecond?: number | undefined; - audioBitrateMode?: BitrateMode | undefined; -} - -interface MediaRecorderEventMap { - dataavailable: BlobEvent; - error: Event; - pause: Event; - resume: Event; - start: Event; - stop: Event; -} - -interface MediaRecorder extends EventTarget { - readonly stream: MediaStream; - readonly mimeType: string; - readonly state: "inactive" | "recording" | "paused"; - readonly videoBitsPerSecond: number; - readonly audioBitsPerSecond: number; - readonly audioBitrateMode: BitrateMode; - - ondataavailable: ((this: MediaRecorder, event: BlobEvent) => any) | null; - onerror: ((this: MediaRecorder, event: Event) => any) | null; - onpause: ((this: MediaRecorder, event: Event) => any) | null; - onresume: ((this: MediaRecorder, event: Event) => any) | null; - onstart: ((this: MediaRecorder, event: Event) => any) | null; - onstop: ((this: MediaRecorder, event: Event) => any) | null; - - addEventListener( - type: K, - listener: (this: MediaRecorder, ev: MediaRecorderEventMap[K]) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: (this: MediaRecorder, ev: MediaRecorderEventMap[K]) => any, - options?: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; - - start(timeslice?: number): void; - stop(): void; - resume(): void; - pause(): void; - requestData(): void; -} - -declare var MediaRecorder: { - prototype: MediaRecorder; - new(stream: MediaStream, options?: MediaRecorderOptions): MediaRecorder; - isTypeSupported(type: string): boolean; -}; - -interface Window { - MediaRecorder: typeof MediaRecorder; - BlobEvent: typeof BlobEvent; - MediaRecorderErrorEvent: typeof MediaRecorderErrorEvent; -} diff --git a/types/dom-mediacapture-record/ts5.0/tsconfig.json b/types/dom-mediacapture-record/ts5.0/tsconfig.json deleted file mode 100644 index 419e660a91ee10..00000000000000 --- a/types/dom-mediacapture-record/ts5.0/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "dom-mediacapture-record-tests.ts" - ] -} diff --git a/types/node/fs.d.ts b/types/node/fs.d.ts index 17f742b4891839..2f583a0c929d87 100644 --- a/types/node/fs.d.ts +++ b/types/node/fs.d.ts @@ -581,7 +581,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + export function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous truncate(2) - Truncate a file to a specified length. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -593,7 +593,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param len If not specified, defaults to `0`. */ - function __promisify__(path: PathLike, len?: number | null): Promise; + function __promisify__(path: PathLike, len?: number): Promise; } /** * Truncates the file. Returns `undefined`. A file descriptor can also be @@ -604,7 +604,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncateSync(path: PathLike, len?: number | null): void; + export function truncateSync(path: PathLike, len?: number): void; /** * Truncates the file descriptor. No arguments other than a possible exception are * given to the completion callback. @@ -648,7 +648,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + export function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous ftruncate(2) - Truncate a file to a specified length. * @param fd A file descriptor. @@ -660,7 +660,7 @@ declare module "fs" { * @param fd A file descriptor. * @param len If not specified, defaults to `0`. */ - function __promisify__(fd: number, len?: number | null): Promise; + function __promisify__(fd: number, len?: number): Promise; } /** * Truncates the file descriptor. Returns `undefined`. @@ -670,7 +670,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncateSync(fd: number, len?: number | null): void; + export function ftruncateSync(fd: number, len?: number): void; /** * Asynchronously changes owner and group of a file. No arguments other than a * possible exception are given to the completion callback. diff --git a/types/node/test/fs.ts b/types/node/test/fs.ts index 14e66483b04250..4639cfa1ba9910 100644 --- a/types/node/test/fs.ts +++ b/types/node/test/fs.ts @@ -539,6 +539,24 @@ async function testPromisify() { }); } +{ + fs.truncate("path/file.txt", () => {}); + fs.truncate("path/file.txt", 5, () => {}); + fs.truncate("path/file.txt", undefined, () => {}); + + fs.truncateSync("path/file.txt"); + fs.truncateSync("path/file.txt", 5); + fs.truncateSync("path/file.txt", undefined); + + fs.ftruncate(123, () => {}); + fs.ftruncate(123, 5, () => {}); + fs.ftruncate(123, undefined, () => {}); + + fs.ftruncateSync(123); + fs.ftruncateSync(123, 5); + fs.ftruncateSync(123, undefined); +} + (async () => { const handle: FileHandle = await openAsync("test", "r"); const writeStream = fs.createWriteStream("./index.d.ts", { diff --git a/types/node/v18/fs.d.ts b/types/node/v18/fs.d.ts index 771a4d704b7f78..591083f0378bd4 100644 --- a/types/node/v18/fs.d.ts +++ b/types/node/v18/fs.d.ts @@ -609,7 +609,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + export function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous truncate(2) - Truncate a file to a specified length. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -621,7 +621,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param len If not specified, defaults to `0`. */ - function __promisify__(path: PathLike, len?: number | null): Promise; + function __promisify__(path: PathLike, len?: number): Promise; } /** * Truncates the file. Returns `undefined`. A file descriptor can also be @@ -632,7 +632,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncateSync(path: PathLike, len?: number | null): void; + export function truncateSync(path: PathLike, len?: number): void; /** * Truncates the file descriptor. No arguments other than a possible exception are * given to the completion callback. @@ -676,7 +676,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + export function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous ftruncate(2) - Truncate a file to a specified length. * @param fd A file descriptor. @@ -688,7 +688,7 @@ declare module "fs" { * @param fd A file descriptor. * @param len If not specified, defaults to `0`. */ - function __promisify__(fd: number, len?: number | null): Promise; + function __promisify__(fd: number, len?: number): Promise; } /** * Truncates the file descriptor. Returns `undefined`. @@ -698,7 +698,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncateSync(fd: number, len?: number | null): void; + export function ftruncateSync(fd: number, len?: number): void; /** * Asynchronously changes owner and group of a file. No arguments other than a * possible exception are given to the completion callback. diff --git a/types/node/v20/fs.d.ts b/types/node/v20/fs.d.ts index a19ff8abcc65ba..afee55f69b717c 100644 --- a/types/node/v20/fs.d.ts +++ b/types/node/v20/fs.d.ts @@ -579,7 +579,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + export function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous truncate(2) - Truncate a file to a specified length. * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. @@ -591,7 +591,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param len If not specified, defaults to `0`. */ - function __promisify__(path: PathLike, len?: number | null): Promise; + function __promisify__(path: PathLike, len?: number): Promise; } /** * Truncates the file. Returns `undefined`. A file descriptor can also be @@ -602,7 +602,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function truncateSync(path: PathLike, len?: number | null): void; + export function truncateSync(path: PathLike, len?: number): void; /** * Truncates the file descriptor. No arguments other than a possible exception are * given to the completion callback. @@ -646,7 +646,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + export function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void; /** * Asynchronous ftruncate(2) - Truncate a file to a specified length. * @param fd A file descriptor. @@ -658,7 +658,7 @@ declare module "fs" { * @param fd A file descriptor. * @param len If not specified, defaults to `0`. */ - function __promisify__(fd: number, len?: number | null): Promise; + function __promisify__(fd: number, len?: number): Promise; } /** * Truncates the file descriptor. Returns `undefined`. @@ -668,7 +668,7 @@ declare module "fs" { * @since v0.8.6 * @param [len=0] */ - export function ftruncateSync(fd: number, len?: number | null): void; + export function ftruncateSync(fd: number, len?: number): void; /** * Asynchronously changes owner and group of a file. No arguments other than a * possible exception are given to the completion callback. diff --git a/types/react-virtualized-auto-sizer/.npmignore b/types/react-virtualized-auto-sizer/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/react-virtualized-auto-sizer/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/react-virtualized-auto-sizer/index.d.ts b/types/react-virtualized-auto-sizer/index.d.ts deleted file mode 100644 index 0af839ba9f6848..00000000000000 --- a/types/react-virtualized-auto-sizer/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import * as React from "react"; - -export interface Size { - height: number; - width: number; -} - -export interface AutoSizerProps { - /** Function responsible for rendering children. */ - children: (size: Size) => React.ReactNode; - - /** Optional custom CSS class name to attach to root AutoSizer element. */ - className?: string | undefined; - - /** Default height to use for initial render; useful for SSR */ - defaultHeight?: number | undefined; - - /** Default width to use for initial render; useful for SSR */ - defaultWidth?: number | undefined; - - /** Disable dynamic :height property */ - disableHeight?: boolean | undefined; - - /** Disable dynamic :width property */ - disableWidth?: boolean | undefined; - - /** Nonce of the inlined stylesheet for Content Security Policy */ - nonce?: string | undefined; - - /** Callback to be invoked on-resize */ - onResize?: ((size: Size) => void) | undefined; - - /** Optional inline style */ - style?: React.CSSProperties | undefined; -} - -export default class extends React.Component {} diff --git a/types/react-virtualized-auto-sizer/package.json b/types/react-virtualized-auto-sizer/package.json deleted file mode 100644 index 90570cf35ac8ca..00000000000000 --- a/types/react-virtualized-auto-sizer/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/react-virtualized-auto-sizer", - "version": "1.0.9999", - "projects": [ - "https://github.com/bvaughn/react-virtualized-auto-sizer/" - ], - "dependencies": { - "@types/react": "*" - }, - "devDependencies": { - "@types/react-virtualized-auto-sizer": "workspace:." - }, - "owners": [ - { - "name": "Hidemi Yukita", - "githubUsername": "otofu-square" - } - ] -} diff --git a/types/react-virtualized-auto-sizer/react-virtualized-auto-sizer-tests.tsx b/types/react-virtualized-auto-sizer/react-virtualized-auto-sizer-tests.tsx deleted file mode 100644 index 72093a55fe05c9..00000000000000 --- a/types/react-virtualized-auto-sizer/react-virtualized-auto-sizer-tests.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import * as React from "react"; -import AutoSizer, { Size } from "react-virtualized-auto-sizer"; - -class TestAutoSizer extends AutoSizer {} - -class TestApp extends React.Component { - onResize = (size: Size) => { - console.log(`width: ${size.width}`); - console.log(`height: ${size.height}`); - }; - - render() { - return ( - <> - - {({ width, height }) => { - const _width: number = width; - const _height: number = height; - console.log(`width: ${_width}`); - console.log(`height: ${_height}`); - return null; - }} - - - {({ width, height }) => { - const _width: number = width; - const _height: number = height; - console.log(`width: ${_width}`); - console.log(`height: ${_height}`); - return null; - }} - - - ); - } -} diff --git a/types/react-virtualized-auto-sizer/tsconfig.json b/types/react-virtualized-auto-sizer/tsconfig.json deleted file mode 100644 index 191b3c88fbb5e6..00000000000000 --- a/types/react-virtualized-auto-sizer/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6", - "dom" - ], - "jsx": "react", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": true - }, - "files": [ - "index.d.ts", - "react-virtualized-auto-sizer-tests.tsx" - ] -} diff --git a/types/webrtc/package.json b/types/webrtc/package.json index be671503d5fbaf..cff9526b2eb11e 100644 --- a/types/webrtc/package.json +++ b/types/webrtc/package.json @@ -27,11 +27,6 @@ "*": [ "ts5.3/*" ] - }, - "<=5.0": { - "*": [ - "ts5.0/*" - ] } }, "devDependencies": { diff --git a/types/webrtc/ts5.0/.eslintrc.json b/types/webrtc/ts5.0/.eslintrc.json deleted file mode 100644 index 122f8d0a42c5f7..00000000000000 --- a/types/webrtc/ts5.0/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "rules": { - "@typescript-eslint/adjacent-overload-signatures": "off", - "@typescript-eslint/no-empty-interface": "off" - } -} diff --git a/types/webrtc/ts5.0/MediaStream.d.ts b/types/webrtc/ts5.0/MediaStream.d.ts deleted file mode 100644 index dafc7f5af94ee1..00000000000000 --- a/types/webrtc/ts5.0/MediaStream.d.ts +++ /dev/null @@ -1,194 +0,0 @@ -// Taken from http://dev.w3.org/2011/webrtc/editor/getusermedia.html -// version: W3C Editor's Draft 29 June 2015 - -interface ConstrainBooleanParameters { - exact?: boolean | undefined; - ideal?: boolean | undefined; -} - -interface NumberRange { - max?: number | undefined; - min?: number | undefined; -} - -interface ConstrainNumberRange extends NumberRange { - exact?: number | undefined; - ideal?: number | undefined; -} - -interface ConstrainStringParameters { - exact?: string | string[] | undefined; - ideal?: string | string[] | undefined; -} - -interface MediaStreamConstraints { - video?: boolean | MediaTrackConstraints | undefined; - audio?: boolean | MediaTrackConstraints | undefined; -} - -declare namespace W3C { - type LongRange = NumberRange; - type DoubleRange = NumberRange; - type ConstrainBoolean = boolean | ConstrainBooleanParameters; - type ConstrainNumber = number | ConstrainNumberRange; - type ConstrainLong = ConstrainNumber; - type ConstrainDouble = ConstrainNumber; - type ConstrainString = string | string[] | ConstrainStringParameters; -} - -interface MediaTrackConstraints extends MediaTrackConstraintSet { - advanced?: MediaTrackConstraintSet[] | undefined; -} - -interface MediaTrackConstraintSet { - width?: W3C.ConstrainLong | undefined; - height?: W3C.ConstrainLong | undefined; - aspectRatio?: W3C.ConstrainDouble | undefined; - frameRate?: W3C.ConstrainDouble | undefined; - facingMode?: W3C.ConstrainString | undefined; - volume?: W3C.ConstrainDouble | undefined; - sampleRate?: W3C.ConstrainLong | undefined; - sampleSize?: W3C.ConstrainLong | undefined; - echoCancellation?: W3C.ConstrainBoolean | undefined; - latency?: W3C.ConstrainDouble | undefined; - deviceId?: W3C.ConstrainString | undefined; - groupId?: W3C.ConstrainString | undefined; -} - -interface MediaTrackSupportedConstraints { - width?: boolean | undefined; - height?: boolean | undefined; - aspectRatio?: boolean | undefined; - frameRate?: boolean | undefined; - facingMode?: boolean | undefined; - volume?: boolean | undefined; - sampleRate?: boolean | undefined; - sampleSize?: boolean | undefined; - echoCancellation?: boolean | undefined; - latency?: boolean | undefined; - deviceId?: boolean | undefined; - groupId?: boolean | undefined; -} - -interface MediaStream extends EventTarget { - // id: string; - // active: boolean; - - // onactive: EventListener; - // oninactive: EventListener; - // onaddtrack: (event: MediaStreamTrackEvent) => any; - // onremovetrack: (event: MediaStreamTrackEvent) => any; - - clone(): MediaStream; - stop(): void; - - getAudioTracks(): MediaStreamTrack[]; - getVideoTracks(): MediaStreamTrack[]; - getTracks(): MediaStreamTrack[]; - - getTrackById(trackId: string): MediaStreamTrack; - - addTrack(track: MediaStreamTrack): void; - removeTrack(track: MediaStreamTrack): void; -} - -interface MediaStreamTrackEvent extends Event { - // track: MediaStreamTrack; -} - -interface MediaStreamTrack extends EventTarget { - // id: string; - // kind: string; - // label: string; - enabled: boolean; - // muted: boolean; - // remote: boolean; - // readyState: MediaStreamTrackState; - - // onmute: EventListener; - // onunmute: EventListener; - // onended: EventListener; - // onoverconstrained: EventListener; - - clone(): MediaStreamTrack; - - stop(): void; - - getCapabilities(): MediaTrackCapabilities; - getConstraints(): MediaTrackConstraints; - getSettings(): MediaTrackSettings; - applyConstraints(constraints: MediaTrackConstraints): Promise; -} - -interface MediaTrackCapabilities { - // width: number | W3C.LongRange; - // height: number | W3C.LongRange; - // aspectRatio: number | W3C.DoubleRange; - // frameRate: number | W3C.DoubleRange; - // facingMode: string; - // volume: number | W3C.DoubleRange; - // sampleRate: number | W3C.LongRange; - // sampleSize: number | W3C.LongRange; - // echoCancellation: boolean[]; - latency?: W3C.DoubleRange | undefined; - // deviceId: string; - // groupId: string; -} - -interface MediaTrackSettings { - // width: number; - // height: number; - // aspectRatio: number; - // frameRate: number; - // facingMode: string; - // volume: number; - // sampleRate: number; - // sampleSize: number; - // echoCancellation: boolean; - latency?: number | undefined; - // deviceId: string; - // groupId: string; -} - -interface MediaStreamError { - readonly name: string; - readonly message: string | null; - readonly constraintName: string | null; -} - -interface NavigatorGetUserMedia { - ( - constraints: MediaStreamConstraints, - successCallback: (stream: MediaStream) => void, - errorCallback: (error: MediaStreamError) => void, - ): void; -} - -// to use with adapter.js, see: https://github.com/webrtc/adapter -declare var getUserMedia: NavigatorGetUserMedia; - -interface Navigator { - getUserMedia: NavigatorGetUserMedia; - - webkitGetUserMedia: NavigatorGetUserMedia; - - mozGetUserMedia: NavigatorGetUserMedia; - - msGetUserMedia: NavigatorGetUserMedia; - - readonly mediaDevices: MediaDevices; -} - -interface MediaDevices { - getSupportedConstraints(): MediaTrackSupportedConstraints; - - getUserMedia(constraints: MediaStreamConstraints): Promise; - enumerateDevices(): Promise; -} - -interface MediaDeviceInfo { - // label: string; - // deviceId: string; - // kind: string; - // groupId: string; -} diff --git a/types/webrtc/ts5.0/RTCPeerConnection.d.ts b/types/webrtc/ts5.0/RTCPeerConnection.d.ts deleted file mode 100644 index 7e2e50319237fa..00000000000000 --- a/types/webrtc/ts5.0/RTCPeerConnection.d.ts +++ /dev/null @@ -1,459 +0,0 @@ -// Note: Commented out definitions clash with definitions in lib.es6.d.ts. I -// still kept them in here though, as sometimes they're more specific than the -// ES6 library ones. - -/// - -// https://www.w3.org/TR/webrtc/#idl-def-rtcerror -interface RTCError extends DOMException { - readonly errorDetail: RTCErrorDetailType; - readonly httpRequestStatusCode: number | null; - readonly receivedAlert: number | null; - readonly sctpCauseCode: number | null; - readonly sdpLineNumber: number | null; - readonly sentAlert: number | null; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcerrorinit -interface RTCErrorInit { - errorDetail: RTCErrorDetailType; - httpRequestStatusCode?: number | undefined; - receivedAlert?: number | undefined; - sctpCauseCode?: number | undefined; - sdpLineNumber?: number | undefined; - sentAlert?: number | undefined; -} - -declare var RTCError: { - prototype: RTCError; - new(init: RTCErrorInit, message?: string): RTCError; -}; - -// https://www.w3.org/TR/webrtc/#idl-def-rtcerrorevent -interface RTCErrorEvent extends Event { - readonly error: RTCError; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcerroreventinit -interface RTCErrorEventInit extends EventInit { - error: RTCError; -} - -declare var RTCErrorEvent: { - prototype: RTCErrorEvent; - new(type: string, eventInitDict: RTCErrorEventInit): RTCErrorEvent; -}; - -// https://www.w3.org/TR/webrtc/#idl-def-rtcicecandidatepair -interface RTCIceCandidatePair { - local?: RTCIceCandidate | undefined; - remote?: RTCIceCandidate | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcofferansweroptions -interface RTCOfferAnswerOptions { - voiceActivityDetection?: boolean | undefined; // default = true -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcofferoptions -interface RTCOfferOptions extends RTCOfferAnswerOptions { - iceRestart?: boolean | undefined; // default = false -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcansweroptions -interface RTCAnswerOptions extends RTCOfferAnswerOptions { -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtciceserver -interface RTCIceServer { - credential?: string | undefined; - urls: string | string[]; - username?: string | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtciceparameters -interface RTCIceParameters { - iceLite?: boolean | undefined; - password?: string | undefined; - usernameFragment?: string | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcicerole -type RTCIceRole = "controlled" | "controlling" | "unknown"; - -interface RTCIceTransportEventMap { - "gatheringstatechange": Event; - "selectedcandidatepairchange": Event; - "statechange": Event; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcicetransport -type IceTransportEventHandler = ((this: RTCIceTransport, ev: Event) => any) | null; -interface RTCIceTransport extends EventTarget { - readonly role: RTCIceRole; - // readonly component: RTCIceComponent; - // readonly state: RTCIceTransportState; - readonly gatheringState: RTCIceGatheringState; - getLocalCandidates(): RTCIceCandidate[]; - getRemoteCandidates(): RTCIceCandidate[]; - getLocalParameters(): RTCIceParameters | null; - getRemoteParameters(): RTCIceParameters | null; - getSelectedCandidatePair(): RTCIceCandidatePair | null; - onstatechange: IceTransportEventHandler; - ongatheringstatechange: IceTransportEventHandler; - onselectedcandidatepairchange: IceTransportEventHandler; - addEventListener( - type: K, - listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, - options: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; -} - -interface RTCDtlsTransportEventMap { - "error": Event; - "statechange": Event; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcdtlstransport -type DtlsTransportEventHandler = ((this: RTCDtlsTransport, ev: E) => any) | null; -interface RTCDtlsTransport extends EventTarget { - readonly iceTransport: RTCIceTransport; - readonly state: RTCDtlsTransportState; - getRemoteCertificates(): ArrayBuffer[]; - onerror: DtlsTransportEventHandler; - onstatechange: DtlsTransportEventHandler; - addEventListener( - type: K, - listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, - options?: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcodeccapability -interface RTCRtpCodecCapability { - mimeType: string; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpheaderextensioncapability -interface RTCRtpHeaderExtensionCapability { - uri?: string | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcapabilities -interface RTCRtpCapabilities { - // codecs: RTCRtpCodecCapability[]; - // headerExtensions: RTCRtpHeaderExtensionCapability[]; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtprtxparameters -interface RTCRtpRtxParameters { - // ssrc: number; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpfecparameters -interface RTCRtpFecParameters { - // ssrc: number; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpencodingparameters -interface RTCRtpEncodingParameters { - // ssrc: number; - // rtx: RTCRtpRtxParameters; - // fec: RTCRtpFecParameters; - // dtx?: RTCDtxStatus; - // active: boolean; - // priority: RTCPriorityType; - // maxBitrate: number; - rid: string; - scaleResolutionDownBy?: number | undefined; // default = 1 -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpheaderextensionparameters -interface RTCRtpHeaderExtensionParameters { - // uri: string; - // id: number; - encrypted?: boolean | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtcpparameters -interface RTCRtcpParameters { - // cname: string; - // reducedSize: boolean; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcodecparameters -interface RTCRtpCodecParameters { - // payloadType: number; - mimeType: string; - // clockRate: number; - channels?: number | undefined; // default = 1 - sdpFmtpLine?: string | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpparameters -interface RTCRtpParameters { - transactionId: string; - // encodings: RTCRtpEncodingParameters[]; - // headerExtensions: RTCRtpHeaderExtensionParameters[]; - // rtcp: RTCRtcpParameters; - // codecs: RTCRtpCodecParameters[]; - // degradationPreference?: RTCDegradationPreference; // default = 'balanced' -} - -// https://www.w3.org/TR/webrtc/#dom-rtcrtpcontributingsource -interface RTCRtpContributingSource { - // readonly timestamp: number; - source: number; - // readonly audioLevel: number | null; - readonly voiceActivityFlag?: boolean | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcapabilities -interface RTCRtcCapabilities { - codecs: RTCRtpCodecCapability[]; - headerExtensions: RTCRtpHeaderExtensionCapability[]; -} - -// https://www.w3.org/TR/webrtc/#dom-rtcrtpsender -interface RTCRtpSender { - // readonly track?: MediaStreamTrack; - // readonly transport?: RTCDtlsTransport; - // readonly rtcpTransport?: RTCDtlsTransport; - setParameters(parameters?: RTCRtpParameters): Promise; - getParameters(): RTCRtpParameters; - replaceTrack(withTrack: MediaStreamTrack): Promise; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtpreceiver -interface RTCRtpReceiver { - // readonly track?: MediaStreamTrack; - // readonly transport?: RTCDtlsTransport; - // readonly rtcpTransport?: RTCDtlsTransport; - getParameters(): RTCRtpParameters; - getContributingSources(): RTCRtpContributingSource[]; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtptransceiver -interface RTCRtpTransceiver { - readonly mid: string | null; - readonly sender: RTCRtpSender; - readonly receiver: RTCRtpReceiver; - readonly stopped: boolean; - direction: RTCRtpTransceiverDirection; - setDirection(direction: RTCRtpTransceiverDirection): void; - stop(): void; - setCodecPreferences(codecs: RTCRtpCodecCapability[]): void; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcrtptransceiverinit -interface RTCRtpTransceiverInit { - direction?: RTCRtpTransceiverDirection | undefined; // default = 'sendrecv' - streams?: MediaStream[] | undefined; - sendEncodings?: RTCRtpEncodingParameters[] | undefined; -} - -// https://www.w3.org/TR/webrtc/#dom-rtccertificate -interface RTCCertificate { - readonly expires: number; - getAlgorithm(): string; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcconfiguration -interface RTCConfiguration { - iceServers?: RTCIceServer[] | undefined; - iceTransportPolicy?: RTCIceTransportPolicy | undefined; // default = 'all' - bundlePolicy?: RTCBundlePolicy | undefined; // default = 'balanced' - rtcpMuxPolicy?: RTCRtcpMuxPolicy | undefined; // default = 'require' - peerIdentity?: string | undefined; // default = null - certificates?: RTCCertificate[] | undefined; - iceCandidatePoolSize?: number | undefined; // default = 0 -} - -// Compatibility for older definitions on DefinitelyTyped. -type RTCPeerConnectionConfig = RTCConfiguration; - -// https://www.w3.org/TR/webrtc/#idl-def-rtcsctptransport -interface RTCSctpTransport { - readonly transport: RTCDtlsTransport; - readonly maxMessageSize: number; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannelinit -interface RTCDataChannelInit { - ordered?: boolean | undefined; // default = true - maxPacketLifeTime?: number | undefined; - maxRetransmits?: number | undefined; - protocol?: string | undefined; // default = '' - negotiated?: boolean | undefined; // default = false - id?: number | undefined; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannel -type DataChannelEventHandler = ((this: RTCDataChannel, ev: E) => any) | null; -interface RTCDataChannel extends EventTarget { - readonly label: string; - readonly ordered: boolean; - readonly maxPacketLifeTime: number | null; - readonly maxRetransmits: number | null; - readonly protocol: string; - readonly negotiated: boolean; - readonly id: number | null; - readonly readyState: RTCDataChannelState; - readonly bufferedAmount: number; - bufferedAmountLowThreshold: number; - // binaryType: string; - - close(): void; - send(data: string | Blob | ArrayBuffer | ArrayBufferView): void; - - onopen: DataChannelEventHandler; - onmessage: DataChannelEventHandler; - onbufferedamountlow: DataChannelEventHandler; - // onerror: DataChannelEventHandler; - onclose: DataChannelEventHandler; -} - -// https://www.w3.org/TR/webrtc/#h-rtctrackevent -interface RTCTrackEvent extends Event { - readonly receiver: RTCRtpReceiver; - readonly track: MediaStreamTrack; - readonly streams: readonly MediaStream[]; - readonly transceiver: RTCRtpTransceiver; -} - -// https://www.w3.org/TR/webrtc/#h-rtcpeerconnectioniceevent -interface RTCPeerConnectionIceEvent extends Event { - readonly url: string | null; -} - -// https://www.w3.org/TR/webrtc/#h-rtcpeerconnectioniceerrorevent -interface RTCPeerConnectionIceErrorEvent extends Event { - readonly hostCandidate: string; - readonly url: string; - readonly errorCode: number; - readonly errorText: string; -} - -// https://www.w3.org/TR/webrtc/#h-rtcdatachannelevent -interface RTCDataChannelEvent { - readonly channel: RTCDataChannel; -} - -// https://www.w3.org/TR/webrtc/#idl-def-rtcpeerconnection -type PeerConnectionEventHandler = ((this: RTCPeerConnection, ev: E) => any) | null; -interface RTCPeerConnection extends EventTarget { - createOffer(options?: RTCOfferOptions): Promise; - createAnswer(options?: RTCAnswerOptions): Promise; - - setLocalDescription(description: RTCSessionDescriptionInit): Promise; - readonly localDescription: RTCSessionDescription | null; - readonly currentLocalDescription: RTCSessionDescription | null; - readonly pendingLocalDescription: RTCSessionDescription | null; - - setRemoteDescription(description: RTCSessionDescriptionInit): Promise; - readonly remoteDescription: RTCSessionDescription | null; - readonly currentRemoteDescription: RTCSessionDescription | null; - readonly pendingRemoteDescription: RTCSessionDescription | null; - - addIceCandidate(candidate?: RTCIceCandidateInit | RTCIceCandidate): Promise; - - readonly signalingState: RTCSignalingState; - readonly connectionState: RTCPeerConnectionState; - - getConfiguration(): RTCConfiguration; - setConfiguration(configuration: RTCConfiguration): void; - close(): void; - - onicecandidateerror: PeerConnectionEventHandler; - onconnectionstatechange: PeerConnectionEventHandler; - - // Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions - getSenders(): RTCRtpSender[]; - getReceivers(): RTCRtpReceiver[]; - getTransceivers(): RTCRtpTransceiver[]; - addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender; - removeTrack(sender: RTCRtpSender): void; - addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver; - ontrack: PeerConnectionEventHandler; - - // Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions-1 - readonly sctp: RTCSctpTransport | null; - createDataChannel(label: string | null, dataChannelDict?: RTCDataChannelInit): RTCDataChannel; - ondatachannel: PeerConnectionEventHandler; - - // Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions-2 - getStats(selector?: MediaStreamTrack | null): Promise; - - // Extension: https://www.w3.org/TR/webrtc/#legacy-interface-extensions - // Deprecated! - createOffer( - successCallback: RTCSessionDescriptionCallback, - failureCallback: RTCPeerConnectionErrorCallback, - options?: RTCOfferOptions, - ): Promise; - setLocalDescription( - description: RTCSessionDescriptionInit, - successCallback: () => void, - failureCallback: RTCPeerConnectionErrorCallback, - ): Promise; - createAnswer( - successCallback: RTCSessionDescriptionCallback, - failureCallback: RTCPeerConnectionErrorCallback, - ): Promise; - setRemoteDescription( - description: RTCSessionDescriptionInit, - successCallback: () => void, - failureCallback: RTCPeerConnectionErrorCallback, - ): Promise; - addIceCandidate( - candidate: RTCIceCandidateInit | RTCIceCandidate, - successCallback: () => void, - failureCallback: RTCPeerConnectionErrorCallback, - ): Promise; - getStats( - selector: MediaStreamTrack | null, - successCallback: (report: RTCStatsReport) => void, - failureCallback: RTCPeerConnectionErrorCallback, - ): Promise; -} -interface RTCPeerConnectionStatic { - new(configuration?: RTCConfiguration, options?: any): RTCPeerConnection; - readonly defaultIceServers: RTCIceServer[]; - - // Extension: https://www.w3.org/TR/webrtc/#sec.cert-mgmt - generateCertificate(keygenAlgorithm: string): Promise; -} - -interface Window { - RTCPeerConnection: RTCPeerConnectionStatic; -} diff --git a/types/webrtc/ts5.0/index.d.ts b/types/webrtc/ts5.0/index.d.ts deleted file mode 100644 index f950da1943286d..00000000000000 --- a/types/webrtc/ts5.0/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -/// diff --git a/types/webrtc/ts5.0/test/MediaStream.ts b/types/webrtc/ts5.0/test/MediaStream.ts deleted file mode 100644 index 0668afab8bca95..00000000000000 --- a/types/webrtc/ts5.0/test/MediaStream.ts +++ /dev/null @@ -1,36 +0,0 @@ -const mediaStreamConstraints: MediaStreamConstraints = { audio: true, video: true }; - -const mediaTrackConstraintSet: MediaTrackConstraintSet = {}; -const mediaTrackConstraintArray: MediaTrackConstraintSet[] = []; -const mediaTrackConstraints: MediaTrackConstraints = mediaTrackConstraintSet; -const mediaTrackConstraints2: MediaTrackConstraints = { advanced: mediaTrackConstraintArray }; - -navigator.getUserMedia(mediaStreamConstraints, stream => { - const track: MediaStreamTrack = stream.getTracks()[0]; - console.log("label:" + track.label); - console.log("ended:" + track.readyState); - track.onended = (event: Event) => console.log("Track ended"); -}, error => { - console.log("Error message: " + error.message); - console.log("Error name: " + error.name); -}); - -navigator.webkitGetUserMedia(mediaStreamConstraints, stream => { - const track: MediaStreamTrack = stream.getTracks()[0]; - console.log("label:" + track.label); - console.log("ended:" + track.readyState); - track.onended = (event: Event) => console.log("Track ended"); -}, error => { - console.log("Error message: " + error.message); - console.log("Error name: " + error.name); -}); - -navigator.mozGetUserMedia(mediaStreamConstraints, stream => { - const track: MediaStreamTrack = stream.getTracks()[0]; - console.log("label:" + track.label); - console.log("ended:" + track.readyState); - track.onended = (event: Event) => console.log("Track ended"); -}, error => { - console.log("Error message: " + error.message); - console.log("Error name: " + error.name); -}); diff --git a/types/webrtc/ts5.0/test/RTCPeerConnection.ts b/types/webrtc/ts5.0/test/RTCPeerConnection.ts deleted file mode 100644 index 8ea9a2b858bf51..00000000000000 --- a/types/webrtc/ts5.0/test/RTCPeerConnection.ts +++ /dev/null @@ -1,124 +0,0 @@ -let defaultIceServers: RTCIceServer[] = window.RTCPeerConnection.defaultIceServers; -if (defaultIceServers.length > 0) { - const urls = defaultIceServers[0].urls; -} - -// Create a peer connection -let ice1: RTCIceServer = { - urls: "stun:stun.l.google.com:19302", - username: "john", - credential: "1234", -}; -let ice2: RTCIceServer = { urls: ["stun:stunserver.org", "stun:stun.example.com"] }; -let pc: RTCPeerConnection = new RTCPeerConnection({}); -let pc2: RTCPeerConnection = new RTCPeerConnection({ - iceServers: [ice1, ice2], -}); -window.RTCPeerConnection.generateCertificate("sha-256").then((cert: RTCCertificate) => { - new RTCPeerConnection({ - iceServers: [ice1], - iceTransportPolicy: "relay", - bundlePolicy: "max-compat", - rtcpMuxPolicy: "require", - peerIdentity: "dude", - certificates: [cert], - iceCandidatePoolSize: 5, - }); -}); - -// Get/set the configuration -let conf: RTCConfiguration = pc2.getConfiguration(); -pc.setConfiguration(conf); - -// Close peer connection -pc2.close(); - -// Offer/answer flow -pc.createOffer({ iceRestart: true }) - .then((offer: RTCSessionDescriptionInit) => { - pc.setLocalDescription(offer); - pc2.setRemoteDescription(offer); - pc2.createAnswer().then((answer: RTCSessionDescriptionInit) => { - pc2.setLocalDescription(answer); - pc.setRemoteDescription(answer); - }); - }); - -// Event handlers -pc.onnegotiationneeded = ev => console.log(ev.type); -pc.onicecandidate = ev => console.log(ev.candidate); -pc.onicecandidateerror = ev => console.log(ev.type); -pc.onsignalingstatechange = ev => console.log(ev.type); -pc.oniceconnectionstatechange = ev => console.log(ev.type); -pc.onicegatheringstatechange = ev => console.log(ev.type); -pc.onconnectionstatechange = ev => console.log(ev.type); -pc.ontrack = ev => console.log(ev.receiver); -pc.ondatachannel = ev => console.log(ev.channel); - -// State properties -console.log(pc.signalingState); -console.log(pc.iceGatheringState); -console.log(pc.iceConnectionState); -console.log(pc.connectionState); - -// Legacy interface extensions -pc.createOffer( - (sdp: RTCSessionDescription) => console.log(sdp.sdp), - (error: DOMException) => console.log(error.message), - { iceRestart: true }, -).then(() => console.log("createOffer complete")); -pc.setLocalDescription( - { type: "offer", sdp: "foobar" }, - () => console.log("local description set"), - (error: DOMException) => console.log(error.message), -).then(() => console.log("setLocalDescription complete")); -pc.createAnswer( - (sdp: RTCSessionDescription) => console.log(sdp.sdp), - (error: DOMException) => console.log(error.message), -).then(() => console.log("createAnswer complete")); -pc.setRemoteDescription( - { type: "answer", sdp: "foobar" }, - () => console.log("remote description set"), - (error: DOMException) => console.log(error.message), -).then(() => console.log("setRemoteDescription complete")); -pc.addIceCandidate( - { candidate: "candidate", sdpMid: "foo", sdpMLineIndex: 1 }, - () => console.log("candidate added"), - (error: DOMException) => console.log(error.message), -).then(() => console.log("addIceCandidate complete")); -pc.getStats( - null, - (report: RTCStatsReport) => console.log("got report"), - (error: DOMException) => console.log(error.message), -).then(() => console.log("getStats complete")); - -// RTCError -const error = new RTCError({ - errorDetail: "dtls-failure", - httpRequestStatusCode: 400, - receivedAlert: 1, - sctpCauseCode: 1, - sdpLineNumber: 1, - sentAlert: 1, -}); - -// RPCDtlsTransport -const dtlsTransport = pc.sctp!.transport; -dtlsTransport.onerror = (ev: RTCErrorEvent) => console.log(ev.error.errorDetail); -dtlsTransport.onstatechange = ev => console.log(ev.type); -dtlsTransport.addEventListener("error", (ev: RTCErrorEvent) => console.log(ev.error.errorDetail)); -dtlsTransport.addEventListener("statechange", ev => console.log(ev.type)); -console.log(dtlsTransport.state); - -// RPCIceTransport -const iceTransport = dtlsTransport.iceTransport; -iceTransport.onstatechange = ev => console.log(ev.type); -iceTransport.ongatheringstatechange = ev => console.log(ev.type); -iceTransport.onselectedcandidatepairchange = ev => console.log(ev.type); -iceTransport.addEventListener("statechange", ev => console.log(ev.type)); -iceTransport.addEventListener("ongatheringstatechange", ev => console.log(ev.type)); -iceTransport.addEventListener("onselectedcandidatepairchange", ev => console.log(ev.type)); -console.log(iceTransport.role); -console.log(iceTransport.gatheringState); -console.log(iceTransport.getSelectedCandidatePair()!.local); -console.log(iceTransport.getSelectedCandidatePair()!.remote); diff --git a/types/webrtc/ts5.0/tsconfig.json b/types/webrtc/ts5.0/tsconfig.json deleted file mode 100644 index fe96c1dfc187e8..00000000000000 --- a/types/webrtc/ts5.0/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": false, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "test/MediaStream.ts", - "test/RTCPeerConnection.ts" - ] -} diff --git a/types/wicg-file-system-access/package.json b/types/wicg-file-system-access/package.json index 1d33e0cac1bd78..7ae634074a00ea 100644 --- a/types/wicg-file-system-access/package.json +++ b/types/wicg-file-system-access/package.json @@ -7,14 +7,6 @@ "projects": [ "https://github.com/WICG/file-system-access" ], - "types": "index", - "typesVersions": { - "<=5.0": { - "*": [ - "ts5.0/*" - ] - } - }, "devDependencies": { "@types/wicg-file-system-access": "workspace:." }, diff --git a/types/wicg-file-system-access/ts5.0/index.d.ts b/types/wicg-file-system-access/ts5.0/index.d.ts deleted file mode 100644 index 84ce93936311bb..00000000000000 --- a/types/wicg-file-system-access/ts5.0/index.d.ts +++ /dev/null @@ -1,225 +0,0 @@ -export {}; - -declare global { - interface FileSystemHandle { - readonly kind: "file" | "directory"; - readonly name: string; - - isSameEntry(other: FileSystemHandle): Promise; - queryPermission(descriptor?: FileSystemHandlePermissionDescriptor): Promise; - requestPermission(descriptor?: FileSystemHandlePermissionDescriptor): Promise; - - /** - * @deprecated Old property just for Chromium <=85. Use `kind` property in the new API. - */ - readonly isFile: boolean; - - /** - * @deprecated Old property just for Chromium <=85. Use `kind` property in the new API. - */ - readonly isDirectory: boolean; - } - var FileSystemHandle: { - prototype: FileSystemHandle; - new(): FileSystemHandle; - }; - type FileSystemHandleUnion = FileSystemFileHandle | FileSystemDirectoryHandle; - - interface FilePickerAcceptType { - description?: string | undefined; - accept: Record; - } - - interface FilePickerOptions { - types?: FilePickerAcceptType[] | undefined; - excludeAcceptAllOption?: boolean | undefined; - } - - interface OpenFilePickerOptions extends FilePickerOptions { - multiple?: boolean | undefined; - } - - interface SaveFilePickerOptions extends FilePickerOptions { - suggestedName?: string; - } - - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface DirectoryPickerOptions {} - - type FileSystemPermissionMode = "read" | "readwrite"; - - interface FileSystemPermissionDescriptor extends PermissionDescriptor { - handle: FileSystemHandle; - mode?: FileSystemPermissionMode | undefined; - } - - interface FileSystemHandlePermissionDescriptor { - mode?: FileSystemPermissionMode | undefined; - } - - interface FileSystemCreateWritableOptions { - keepExistingData?: boolean | undefined; - } - - interface FileSystemGetFileOptions { - create?: boolean | undefined; - } - - interface FileSystemGetDirectoryOptions { - create?: boolean | undefined; - } - - interface FileSystemRemoveOptions { - recursive?: boolean | undefined; - } - - type WriteParams = - | { type: "write"; position?: number | undefined; data: BufferSource | Blob | string } - | { type: "seek"; position: number } - | { type: "truncate"; size: number }; - - type FileSystemWriteChunkType = BufferSource | Blob | string | WriteParams; - - // TODO: remove this once https://github.com/microsoft/TSJS-lib-generator/issues/881 is fixed. - // Native File System API especially needs this method. - interface WritableStream { - close(): Promise; - } - - class FileSystemWritableFileStream extends WritableStream { - write(data: FileSystemWriteChunkType): Promise; - seek(position: number): Promise; - truncate(size: number): Promise; - } - - interface FileSystemFileHandle extends FileSystemHandle { - readonly kind: "file"; - getFile(): Promise; - createWritable(options?: FileSystemCreateWritableOptions): Promise; - /** - * @deprecated Old property just for Chromium <=85. Use `kind` property in the new API. - */ - readonly isFile: true; - /** - * @deprecated Old property just for Chromium <=85. Use `kind` property in the new API. - */ - readonly isDirectory: false; - } - - var FileSystemFileHandle: { - prototype: FileSystemFileHandle; - new(): FileSystemFileHandle; - }; - - interface FileSystemDirectoryHandle extends FileSystemHandle { - readonly kind: "directory"; - getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise; - getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise; - removeEntry(name: string, options?: FileSystemRemoveOptions): Promise; - resolve(possibleDescendant: FileSystemHandle): Promise; - keys(): AsyncIterableIterator; - values(): AsyncIterableIterator; - entries(): AsyncIterableIterator<[string, FileSystemDirectoryHandle | FileSystemFileHandle]>; - [Symbol.asyncIterator]: FileSystemDirectoryHandle["entries"]; - /** - * @deprecated Old property just for Chromium <=85. Use `kind` property in the new API. - */ - readonly isFile: false; - /** - * @deprecated Old property just for Chromium <=85. Use `kind` property in the new API. - */ - readonly isDirectory: true; - } - - var FileSystemDirectoryHandle: { - prototype: FileSystemDirectoryHandle; - new(): FileSystemDirectoryHandle; - }; - - interface DataTransferItem { - getAsFileSystemHandle(): Promise; - } - - interface StorageManager { - getDirectory(): Promise; - } - - function showOpenFilePicker( - options?: OpenFilePickerOptions & { multiple?: false | undefined }, - ): Promise<[FileSystemFileHandle]>; - function showOpenFilePicker(options?: OpenFilePickerOptions): Promise; - function showSaveFilePicker(options?: SaveFilePickerOptions): Promise; - function showDirectoryPicker(options?: DirectoryPickerOptions): Promise; - - // Old methods available on Chromium 85 instead of the ones above. - - interface ChooseFileSystemEntriesOptionsAccepts { - description?: string | undefined; - mimeTypes?: string[] | undefined; - extensions?: string[] | undefined; - } - - interface ChooseFileSystemEntriesFileOptions { - accepts?: ChooseFileSystemEntriesOptionsAccepts[] | undefined; - excludeAcceptAllOption?: boolean | undefined; - } - - /** - * @deprecated Old method just for Chromium <=85. Use `showOpenFilePicker()` in the new API. - */ - function chooseFileSystemEntries( - options?: ChooseFileSystemEntriesFileOptions & { - type?: "open-file" | undefined; - multiple?: false | undefined; - }, - ): Promise; - /** - * @deprecated Old method just for Chromium <=85. Use `showOpenFilePicker()` in the new API. - */ - function chooseFileSystemEntries( - options: ChooseFileSystemEntriesFileOptions & { - type?: "open-file" | undefined; - multiple: true; - }, - ): Promise; - /** - * @deprecated Old method just for Chromium <=85. Use `showSaveFilePicker()` in the new API. - */ - function chooseFileSystemEntries( - options: ChooseFileSystemEntriesFileOptions & { - type: "save-file"; - }, - ): Promise; - /** - * @deprecated Old method just for Chromium <=85. Use `showDirectoryPicker()` in the new API. - */ - function chooseFileSystemEntries(options: { type: "open-directory" }): Promise; - - interface GetSystemDirectoryOptions { - type: "sandbox"; - } - - interface FileSystemDirectoryHandle { - /** - * @deprecated Old property just for Chromium <=85. Use `.getFileHandle()` in the new API. - */ - getFile: FileSystemDirectoryHandle["getFileHandle"]; - - /** - * @deprecated Old property just for Chromium <=85. Use `.getDirectoryHandle()` in the new API. - */ - getDirectory: FileSystemDirectoryHandle["getDirectoryHandle"]; - - /** - * @deprecated Old property just for Chromium <=85. Use `.keys()`, `.values()`, `.entries()`, or the directory itself as an async iterable in the new API. - */ - getEntries: FileSystemDirectoryHandle["values"]; - } - - interface FileSystemHandlePermissionDescriptor { - /** - * @deprecated Old property just for Chromium <=85. Use `mode: ...` in the new API. - */ - writable?: boolean | undefined; - } -} diff --git a/types/wicg-file-system-access/ts5.0/tsconfig.json b/types/wicg-file-system-access/ts5.0/tsconfig.json deleted file mode 100644 index af69376a4d147b..00000000000000 --- a/types/wicg-file-system-access/ts5.0/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "ES5", - "ES2015.Promise", - "ESNext.AsyncIterable", - "DOM" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "wicg-file-system-access-tests.ts" - ] -} diff --git a/types/wicg-file-system-access/ts5.0/wicg-file-system-access-tests.ts b/types/wicg-file-system-access/ts5.0/wicg-file-system-access-tests.ts deleted file mode 100644 index f0fa86f65369c0..00000000000000 --- a/types/wicg-file-system-access/ts5.0/wicg-file-system-access-tests.ts +++ /dev/null @@ -1,104 +0,0 @@ -(async () => { - let [fileHandle]: [FileSystemFileHandle] = await showOpenFilePicker(); - [fileHandle] = await showOpenFilePicker({ multiple: false }); - const fileHandles: FileSystemFileHandle[] = await showOpenFilePicker({ - excludeAcceptAllOption: true, - multiple: true, - types: [{ accept: { "image/*": [".png", ".jpg"], "text/plain": ".txt" } }], - }); - let w: FileSystemWritableFileStream = await fileHandle.createWritable(); - w = await fileHandle.createWritable({ keepExistingData: true }); - await w.write("abc"); - await w.write(new Uint8Array([1, 2, 3])); - await w.write({ type: "seek", position: 0 }); - await w.seek(1); - await w.write(new Blob(["xyz"])); - await w.write({ type: "write", position: 3, data: new Uint8Array([4, 5, 6]) }); - await w.write({ type: "truncate", size: 2 }); - await w.truncate(1); - await w.close(); - - let permissionState: PermissionState = await fileHandle.queryPermission(); - permissionState = await fileHandle.requestPermission({ mode: "read" }); - permissionState = await fileHandle.requestPermission({ mode: "readwrite" }); - - const saveFilePickerOptions = { - suggestedName: "image.svg", - }; - const filePickerOptions = { - excludeAcceptAllOption: true, - types: [{ description: "SVG images", accept: { "image/svg": ["svg"] } }], - }; - - fileHandle = await showSaveFilePicker(); - fileHandle = await showSaveFilePicker({ - ...filePickerOptions, - }); - fileHandle = await showSaveFilePicker({ - ...saveFilePickerOptions, - }); - fileHandle = await showSaveFilePicker({ - ...saveFilePickerOptions, - ...filePickerOptions, - }); - - const file: File = await fileHandle.getFile(); - new ReadableStream().pipeTo(await fileHandle.createWritable()); - - let dirHandle: FileSystemDirectoryHandle = await showDirectoryPicker(); - dirHandle = await showDirectoryPicker({}); - - (async function* recursivelyWalkDir(dirHandle: FileSystemDirectoryHandle): AsyncIterable { - // Disable due to a bug in TSLint https://github.com/palantir/tslint/issues/3997: - // tslint:disable-next-line await-promise - for await (const [name, handle] of dirHandle) { - if (handle.kind === "file") { - yield handle.getFile(); - } else { - yield* recursivelyWalkDir(handle); - } - } - })(dirHandle); - - const maybePath = await dirHandle.resolve(fileHandle); - if (maybePath) { - const pathItems: string[] = maybePath; - } - - fileHandle = await dirHandle.getFileHandle("temp.txt"); - fileHandle = await dirHandle.getFileHandle("temp.txt", { create: true }); - - dirHandle = await dirHandle.getDirectoryHandle("subdir", { create: false }); - - await dirHandle.removeEntry("temp.txt"); - await dirHandle.removeEntry("nested-dir", { recursive: true }); - - dirHandle = await navigator.storage.getDirectory(); - - // Testing Chromium <=85 methods, remove when all Chromium-based browsers have upgraded. - - fileHandle = await chooseFileSystemEntries(); - fileHandle = await chooseFileSystemEntries({ - type: "open-file", - accepts: [{ description: "Images", extensions: ["png", "jpg"], mimeTypes: ["image/*"] }], - excludeAcceptAllOption: false, - multiple: false, - }); - fileHandle = await chooseFileSystemEntries({ type: "save-file" }); - dirHandle = await chooseFileSystemEntries({ type: "open-directory" }); - dirHandle = await dirHandle.getDirectory("subdir", { create: true }); - fileHandle = await dirHandle.getFile("file.txt"); - - permissionState = await fileHandle.requestPermission({ writable: false }); - permissionState = await fileHandle.requestPermission({ writable: true }); - - (async function* recursivelyWalkDir(dirHandle: FileSystemDirectoryHandle): AsyncIterable { - for await (const handle of dirHandle.getEntries()) { - if (handle.isFile) { - yield handle.getFile(); - } else { - yield* recursivelyWalkDir(handle); - } - } - })(dirHandle); -})();