From 10b5525e8d8358d7fb312a4be582d0168ff1765e Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 8 Apr 2025 02:06:50 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72410=20feat(b?= =?UTF-8?q?s58):=20remove=20types=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notNeededPackages.json | 4 ++++ types/bs58/.npmignore | 6 ------ types/bs58/bs58-tests.ts | 8 -------- types/bs58/index.d.ts | 7 ------- types/bs58/package.json | 25 ------------------------- types/bs58/tsconfig.json | 19 ------------------- types/bs58/v3/.npmignore | 5 ----- types/bs58/v3/bs58-tests.ts | 10 ---------- types/bs58/v3/index.d.ts | 7 ------- types/bs58/v3/package.json | 20 -------------------- types/bs58/v3/tsconfig.json | 19 ------------------- 11 files changed, 4 insertions(+), 126 deletions(-) delete mode 100644 types/bs58/.npmignore delete mode 100644 types/bs58/bs58-tests.ts delete mode 100644 types/bs58/index.d.ts delete mode 100644 types/bs58/package.json delete mode 100644 types/bs58/tsconfig.json delete mode 100644 types/bs58/v3/.npmignore delete mode 100644 types/bs58/v3/bs58-tests.ts delete mode 100644 types/bs58/v3/index.d.ts delete mode 100644 types/bs58/v3/package.json delete mode 100644 types/bs58/v3/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 677f96f5b61188..7d4ac0083074bb 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -540,6 +540,10 @@ "libraryName": "browserslist", "asOfVersion": "4.15.0" }, + "bs58": { + "libraryName": "bs58", + "asOfVersion": "5.0.0" + }, "bson": { "libraryName": "bson", "asOfVersion": "4.2.0" diff --git a/types/bs58/.npmignore b/types/bs58/.npmignore deleted file mode 100644 index 54c4a06d9989eb..00000000000000 --- a/types/bs58/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts -/v3/ diff --git a/types/bs58/bs58-tests.ts b/types/bs58/bs58-tests.ts deleted file mode 100644 index 0a10d38c0656e8..00000000000000 --- a/types/bs58/bs58-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ -import bs58 = require("bs58"); - -const bytes = Buffer.from("003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187", "hex"); -const address = bs58.encode(bytes); -address; // $ExpectType string - -bs58.decode(address); // $ExpectType Buffer || Buffer -bs58.decodeUnsafe(address); // $ExpectType Buffer | undefined || Buffer | undefined diff --git a/types/bs58/index.d.ts b/types/bs58/index.d.ts deleted file mode 100644 index 5c454e84281b67..00000000000000 --- a/types/bs58/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -import { BaseConverter } from "base-x"; - -declare const base58: BaseConverter; - -export = base58; diff --git a/types/bs58/package.json b/types/bs58/package.json deleted file mode 100644 index 709e748ca65800..00000000000000 --- a/types/bs58/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "private": true, - "name": "@types/bs58", - "version": "4.0.9999", - "projects": [ - "https://github.com/cryptocoinjs/bs58" - ], - "dependencies": { - "@types/node": "*", - "base-x": "^3.0.6" - }, - "devDependencies": { - "@types/bs58": "workspace:." - }, - "owners": [ - { - "name": "Ilya Mochalov", - "githubUsername": "chrootsu" - }, - { - "name": "BendingBender", - "githubUsername": "BendingBender" - } - ] -} diff --git a/types/bs58/tsconfig.json b/types/bs58/tsconfig.json deleted file mode 100644 index 32566044ab579a..00000000000000 --- a/types/bs58/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bs58-tests.ts" - ] -} diff --git a/types/bs58/v3/.npmignore b/types/bs58/v3/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/bs58/v3/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/bs58/v3/bs58-tests.ts b/types/bs58/v3/bs58-tests.ts deleted file mode 100644 index ba7ad004b71bbe..00000000000000 --- a/types/bs58/v3/bs58-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as bs58 from "bs58"; - -{ - let encoded: string; - - encoded = bs58.encode([255]); - encoded = bs58.encode({ 0: 255, length: 1 }); -} - -const decoded: number[] = bs58.decode("5Q"); diff --git a/types/bs58/v3/index.d.ts b/types/bs58/v3/index.d.ts deleted file mode 100644 index 8155104be8ada6..00000000000000 --- a/types/bs58/v3/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as BaseX from "base-x"; - -declare namespace base58 {} - -declare let base58: BaseX.BaseConverter; - -export = base58; diff --git a/types/bs58/v3/package.json b/types/bs58/v3/package.json deleted file mode 100644 index fa8ae04ff48fc5..00000000000000 --- a/types/bs58/v3/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/bs58", - "version": "3.0.9999", - "projects": [ - "https://github.com/cryptocoinjs/bs58" - ], - "dependencies": { - "@types/base-x": "^1.0.30" - }, - "devDependencies": { - "@types/bs58": "workspace:." - }, - "owners": [ - { - "name": "Ilya Mochalov", - "githubUsername": "chrootsu" - } - ] -} diff --git a/types/bs58/v3/tsconfig.json b/types/bs58/v3/tsconfig.json deleted file mode 100644 index 32566044ab579a..00000000000000 --- a/types/bs58/v3/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bs58-tests.ts" - ] -} From 9ce48a586c331abad8748c1c4338c3cf8cb90c33 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 8 Apr 2025 02:10:53 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72409=20feat(t?= =?UTF-8?q?itle):=20remove=20types=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notNeededPackages.json | 4 ++++ types/title/.npmignore | 5 ----- types/title/index.d.ts | 16 ---------------- types/title/package.json | 21 --------------------- types/title/title-tests.ts | 8 -------- types/title/tsconfig.json | 19 ------------------- 6 files changed, 4 insertions(+), 69 deletions(-) delete mode 100644 types/title/.npmignore delete mode 100644 types/title/index.d.ts delete mode 100644 types/title/package.json delete mode 100644 types/title/title-tests.ts delete mode 100644 types/title/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 7d4ac0083074bb..d3891841a20beb 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -7123,6 +7123,10 @@ "libraryName": "tiny-secp256k1", "asOfVersion": "2.0.0" }, + "title": { + "libraryName": "title", + "asOfVersion": "4.0.0" + }, "title-case": { "libraryName": "title-case", "asOfVersion": "1.1.2" diff --git a/types/title/.npmignore b/types/title/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/title/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/title/index.d.ts b/types/title/index.d.ts deleted file mode 100644 index 57dddfd198632e..00000000000000 --- a/types/title/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This package correctly capitalizes your titles as per The Chicago Manual of Style. - * Furthermore, all of Vercel's product names are capitalized properly as well. - */ -declare function title(string: string, options?: title.Options): string; - -declare namespace title { - interface Options { - /** - * @default undefined - */ - special?: string[] | undefined; - } -} - -export = title; diff --git a/types/title/package.json b/types/title/package.json deleted file mode 100644 index c7c39dd7cc2244..00000000000000 --- a/types/title/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@types/title", - "version": "3.4.9999", - "projects": [ - "https://github.com/vercel/title#readme" - ], - "devDependencies": { - "@types/title": "workspace:." - }, - "owners": [ - { - "name": "Fahad", - "githubUsername": "fa7ad" - }, - { - "name": "Piotr Błażejewicz", - "githubUsername": "peterblazejewicz" - } - ] -} diff --git a/types/title/title-tests.ts b/types/title/title-tests.ts deleted file mode 100644 index e5d8b2cd658988..00000000000000 --- a/types/title/title-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ -import title = require("title"); - -title("tHe cHicaGo maNual oF StyLe"); // $ExpectType string -title("TypeSCRipt is great", {}); // $ExpectType string -// $ExpectType string -title("TypeSCRipt is great", { - special: ["TypeScript"], -}); diff --git a/types/title/tsconfig.json b/types/title/tsconfig.json deleted file mode 100644 index e5c6679db7b57e..00000000000000 --- a/types/title/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "title-tests.ts" - ] -} From 26cd4e4ab87c56608d95ee7cf25bbbe5d7e4c9b0 Mon Sep 17 00:00:00 2001 From: Sam Ramon <15154970+samantharamon@users.noreply.github.com> Date: Mon, 7 Apr 2025 11:40:05 -0700 Subject: [PATCH 3/6] [office-js][office-js-preview] (Outlook) Clarify attachment types and extensions (#72357) --- types/office-js-preview/index.d.ts | 38 ++++++++++++++++++++++++++--- types/office-js/index.d.ts | 39 +++++++++++++++++++++++++++--- 2 files changed, 69 insertions(+), 8 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index c66096b76b89ac..2548eff0d4670c 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -12844,6 +12844,21 @@ declare namespace Office { interface AttachmentDetailsCompose { /** * Gets a value that indicates the attachment's type. + * + * @remarks + * + * **Important**: + * + * - In Outlook on the web and new Outlook on Windows, a message or appointment that's locally saved then attached using + * drag-and-drop or the **Attach Item** option is of type `Office.MailboxEnums.AttachmentType.File`. The file name extension is + * returned in the `name` property. However, a message or appointment that's attached using the **Forward as Attachment** option + * is of type `Office.MailboxEnums.AttachmentType.Item`. In this case, an extension isn't returned in the `name` property. + * + * - In classic Outlook on Windows, a message or appointment that's attached using drag-and-drop, **Attach File**, or + * **Forward as Attachment** is of type `Office.MailboxEnums.AttachmentType.Item`. A file name extension isn't returned in the `name` property. + * + * - In Outlook on Mac, a message or appointment that's attached using drag-and-drop, **Attach Item**, or **Forward as Attachment** is of type + * `Office.MailboxEnums.AttachmentType.File`. The file name extension is returned in the `name` property. */ attachmentType: MailboxEnums.AttachmentType | string; /** @@ -12857,8 +12872,22 @@ declare namespace Office { /** * Gets the name of the attachment. * - * **Important**: For message or appointment items that were attached by drag-and-drop or "Attach Item", - * `name` includes a file extension in Outlook on Mac, but excludes the extension on the web or on Windows. + * @remarks + * + * **Important**: + * + * - An attachment of type `Office.MailboxEnums.AttachmentType.Item` doesn't return a file name extension in the `name` property. + * + * - In Outlook on the web and new Outlook on Windows, a message or appointment that's locally saved then attached using + * drag-and-drop or the **Attach Item** option is of type `Office.MailboxEnums.AttachmentType.File`. The file name extension is + * returned in the `name` property. However, a message or appointment that's attached using the **Forward as Attachment** option + * is of type `Office.MailboxEnums.AttachmentType.Item`. In this case, an extension isn't returned in the `name` property. + * + * - In classic Outlook on Windows, a message or appointment that's attached using drag-and-drop, **Attach File**, or + * **Forward as Attachment** is of type `Office.MailboxEnums.AttachmentType.Item`. A file name extension isn't returned in the `name` property. + * + * - In Outlook on Mac, a message or appointment that's attached using drag-and-drop, **Attach Item**, or **Forward as Attachment** is of type + * `Office.MailboxEnums.AttachmentType.File`. The file name extension is returned in the `name` property. */ name: string; /** @@ -12909,8 +12938,9 @@ declare namespace Office { /** * Gets the name of the attachment. * - * **Important**: For message or appointment items that were attached by drag-and-drop or "Attach Item", - * `name` includes a file extension in Outlook on Mac, but excludes the extension on the web or on Windows. + * @remarks + * + * **Important**: An attachment of type `Office.MailboxEnums.AttachmentType.Item` doesn't return a file name extension in the `name` property. */ name: string; /** diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 6e35732cbdf82e..82f3fd5cc00bef 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -12757,6 +12757,21 @@ declare namespace Office { interface AttachmentDetailsCompose { /** * Gets a value that indicates the attachment's type. + * + * @remarks + * + * **Important**: + * + * - In Outlook on the web and new Outlook on Windows, a message or appointment that's locally saved then attached using + * drag-and-drop or the **Attach Item** option is of type `Office.MailboxEnums.AttachmentType.File`. The file name extension is + * returned in the `name` property. However, a message or appointment that's attached using the **Forward as Attachment** option + * is of type `Office.MailboxEnums.AttachmentType.Item`. In this case, an extension isn't returned in the `name` property. + * + * - In classic Outlook on Windows, a message or appointment that's attached using drag-and-drop, **Attach File**, or + * **Forward as Attachment** is of type `Office.MailboxEnums.AttachmentType.Item`. A file name extension isn't returned in the `name` property. + * + * - In Outlook on Mac, a message or appointment that's attached using drag-and-drop, **Attach Item**, or **Forward as Attachment** is of type + * `Office.MailboxEnums.AttachmentType.File`. The file name extension is returned in the `name` property. */ attachmentType: MailboxEnums.AttachmentType | string; /** @@ -12770,8 +12785,23 @@ declare namespace Office { /** * Gets the name of the attachment. * - * **Important**: For message or appointment items that were attached by drag-and-drop or "Attach Item", - * `name` includes a file extension in Outlook on Mac, but excludes the extension on the web or on Windows. + * @remarks + * + * **Important**: + * + * - An attachment of type `Office.MailboxEnums.AttachmentType.Item` doesn't return a file name extension in the `name` property. + * + * - In Outlook on the web and new Outlook on Windows, a message or appointment that's locally saved then attached using + * drag-and-drop or the **Attach Item** option is of type `Office.MailboxEnums.AttachmentType.File`. The file name extension is + * returned in the `name` property. However, a message or appointment that's attached using the **Forward as Attachment** option + * is of type `Office.MailboxEnums.AttachmentType.Item`. In this case, an extension isn't returned in the `name` property. + * + * - In classic Outlook on Windows, a message or appointment that's attached using drag-and-drop, **Attach Item**, or + * **Forward as Attachment** is of type `Office.MailboxEnums.AttachmentType.Item`. A file name extension isn't returned in the `name` property. + * A calendar item that's attached + * + * - In Outlook on Mac, a message or appointment that's attached using drag-and-drop, **Attach Item**, or **Forward as Attachment** is of type + * `Office.MailboxEnums.AttachmentType.File`. The file name extension is returned in the `name` property. */ name: string; /** @@ -12822,8 +12852,9 @@ declare namespace Office { /** * Gets the name of the attachment. * - * **Important**: For message or appointment items that were attached by drag-and-drop or "Attach Item", - * `name` includes a file extension in Outlook on Mac, but excludes the extension on the web or on Windows. + * @remarks + * + * **Important**: An attachment of type `Office.MailboxEnums.AttachmentType.Item` doesn't return a file name extension in the `name` property. */ name: string; /** From 527ad93685e60b00da0f52a2b38d0e554d4478b8 Mon Sep 17 00:00:00 2001 From: Sam Ramon <15154970+samantharamon@users.noreply.github.com> Date: Mon, 7 Apr 2025 11:40:53 -0700 Subject: [PATCH 4/6] [office-js][office-js-preview] (Outlook) Add note about the InitializationContextChanged event (#72407) --- types/office-js-preview/index.d.ts | 12 ++++++++++++ types/office-js/index.d.ts | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 2548eff0d4670c..86fe6d38839f89 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -21529,6 +21529,10 @@ declare namespace Office { * * - To retrieve the JSON data, call `Office.context.mailboxitem.getInitializationContextAsync`. If you create a JSON string using * `JSON.stringify()` and assign it to the `contextData` property, you must parse the string using `JSON.parse()` once you retrieve it. + * + * - To prevent the task pane of a notification message from relaunching if it's already open, implement a handler for the `Office.EventType.InitializationContextChanged` event. + * You can then pass the {@link https://learn.microsoft.com/javascript/api/outlook/office.initializationcontextchangedeventargs?view=outlook-js-1.15&preserve-view=true | event arguments} + * to the `contextData` property. */ contextData: any; } @@ -23674,6 +23678,10 @@ declare namespace Office { * * - When you configure a button in the Smart Alerts dialog to run a function, a button for the function is also added to the ribbon or action bar of the Outlook client. * Use the `contextData` option to distinguish when a user runs the function from the Smart Alerts dialog. + * + * - To prevent the task pane of a Smart Alerts add-in from relaunching if it's already open, implement a handler for the `Office.EventType.InitializationContextChanged` event. + * You can then pass the {@link https://learn.microsoft.com/javascript/api/outlook/office.initializationcontextchangedeventargs?view=outlook-js-1.15&preserve-view=true | event arguments} + * to the `contextData` property. */ contextData?: any; /** @@ -23853,6 +23861,10 @@ declare namespace Office { * * - If you implement a task pane to open after a reported message is processed, when the `event.completed` call occurs, any task pane that's open or pinned is closed. * + * - To prevent the task pane of a spam-reporting add-in from relaunching if it's already open, implement a handler for the `Office.EventType.InitializationContextChanged` event. + * You can then pass the {@link https://learn.microsoft.com/javascript/api/outlook/office.initializationcontextchangedeventargs?view=outlook-js-1.15&preserve-view=true | event arguments} + * to the `contextData` property. + * * - To retrieve the value of the `contextData` property, you must call `Office.context.mailbox.item.getInitializationContextAsync` in the JavaScript implementation * of your task pane. If you create a JSON string using `JSON.stringify()` and assign it to the `contextData` property, you must parse the string using * `JSON.parse()` once you retrieve it. diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 82f3fd5cc00bef..c4ad7c38e14064 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -21064,6 +21064,10 @@ declare namespace Office { * * - To retrieve the JSON data, call `Office.context.mailboxitem.getInitializationContextAsync`. If you create a JSON string using * `JSON.stringify()` and assign it to the `contextData` property, you must parse the string using `JSON.parse()` once you retrieve it. + * + * - To prevent the task pane of a notification message from relaunching if it's already open, implement a handler for the `Office.EventType.InitializationContextChanged` event. + * You can then pass the {@link https://learn.microsoft.com/javascript/api/outlook/office.initializationcontextchangedeventargs?view=outlook-js-1.15&preserve-view=true | event arguments} + * to the `contextData` property. */ contextData: any; } @@ -23150,6 +23154,10 @@ declare namespace Office { * * - When you configure a button in the Smart Alerts dialog to run a function, a button for the function is also added to the ribbon or action bar of the Outlook client. * Use the `contextData` option to distinguish when a user runs the function from the Smart Alerts dialog. + * + * - To prevent the task pane of a Smart Alerts add-in from relaunching if it's already open, implement a handler for the `Office.EventType.InitializationContextChanged` event. + * You can then pass the {@link https://learn.microsoft.com/javascript/api/outlook/office.initializationcontextchangedeventargs?view=outlook-js-1.15&preserve-view=true | event arguments} + * to the `contextData` property. */ contextData?: any; /** @@ -23329,6 +23337,10 @@ declare namespace Office { * * - If you implement a task pane to open after a reported message is processed, when the `event.completed` call occurs, any task pane that's open or pinned is closed. * + * - To prevent the task pane of a spam-reporting add-in from relaunching if it's already open, implement a handler for the `Office.EventType.InitializationContextChanged` event. + * You can then pass the {@link https://learn.microsoft.com/javascript/api/outlook/office.initializationcontextchangedeventargs?view=outlook-js-1.15&preserve-view=true | event arguments} + * to the `contextData` property. + * * - To retrieve the value of the `contextData` property, you must call `Office.context.mailbox.item.getInitializationContextAsync` in the JavaScript implementation * of your task pane. If you create a JSON string using `JSON.stringify()` and assign it to the `contextData` property, you must parse the string using * `JSON.parse()` once you retrieve it. From 7afd625f8477ae4e76cb30602809155bafb38215 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 8 Apr 2025 04:14:24 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72422=20feat(s?= =?UTF-8?q?urvicate=5F=5Freact-native-survicate):=20remove=20types=20by=20?= =?UTF-8?q?@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notNeededPackages.json | 4 ++++ .../.npmignore | 5 ----- .../index.d.ts | 15 ------------- .../package.json | 21 ------------------- ...survicate__react-native-survicate-tests.ts | 10 --------- .../tsconfig.json | 19 ----------------- 6 files changed, 4 insertions(+), 70 deletions(-) delete mode 100644 types/survicate__react-native-survicate/.npmignore delete mode 100644 types/survicate__react-native-survicate/index.d.ts delete mode 100644 types/survicate__react-native-survicate/package.json delete mode 100644 types/survicate__react-native-survicate/survicate__react-native-survicate-tests.ts delete mode 100644 types/survicate__react-native-survicate/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index d3891841a20beb..94eea83afb10c8 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -6931,6 +6931,10 @@ "libraryName": "survey-knockout", "asOfVersion": "0.10.0" }, + "survicate__react-native-survicate": { + "libraryName": "@survicate/react-native-survicate", + "asOfVersion": "4.0.0" + }, "svg-pan-zoom": { "libraryName": "svg-pan-zoom", "asOfVersion": "3.4.0" diff --git a/types/survicate__react-native-survicate/.npmignore b/types/survicate__react-native-survicate/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/survicate__react-native-survicate/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/survicate__react-native-survicate/index.d.ts b/types/survicate__react-native-survicate/index.d.ts deleted file mode 100644 index 91428cc67b819c..00000000000000 --- a/types/survicate__react-native-survicate/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare namespace Survicate { - /** - * @deprecated Use `initializeSdk` instead. This method will be removed in version 4.0. - */ - function initialize(): void; - function initializeSdk(): void; - function invokeEvent(eventName: string): void; - function enterScreen(screenName: string): void; - function leaveScreen(screenName: string): void; - function setUserId(screenName: string): void; - function setUserTrait(traitName: string, traitValue: string): void; - function reset(): void; -} - -export default Survicate; diff --git a/types/survicate__react-native-survicate/package.json b/types/survicate__react-native-survicate/package.json deleted file mode 100644 index 6dd98196d1e326..00000000000000 --- a/types/survicate__react-native-survicate/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@types/survicate__react-native-survicate", - "version": "1.1.9999", - "projects": [ - "https://github.com/Survicate/react-native-survicate#readme" - ], - "devDependencies": { - "@types/survicate__react-native-survicate": "workspace:." - }, - "owners": [ - { - "name": "Ian Mobley", - "githubUsername": "iMobs" - }, - { - "name": "Pawel", - "githubUsername": "SurvicatePawelGodlewski" - } - ] -} diff --git a/types/survicate__react-native-survicate/survicate__react-native-survicate-tests.ts b/types/survicate__react-native-survicate/survicate__react-native-survicate-tests.ts deleted file mode 100644 index 9e9652f148bd4f..00000000000000 --- a/types/survicate__react-native-survicate/survicate__react-native-survicate-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import Survicate from "@survicate/react-native-survicate"; - -Survicate.initialize(); -Survicate.initializeSdk(); -Survicate.invokeEvent("test"); -Survicate.enterScreen("test"); -Survicate.leaveScreen("test"); -Survicate.setUserId("test"); -Survicate.setUserTrait("test", "value"); -Survicate.reset(); diff --git a/types/survicate__react-native-survicate/tsconfig.json b/types/survicate__react-native-survicate/tsconfig.json deleted file mode 100644 index ff73273e6bfeb7..00000000000000 --- a/types/survicate__react-native-survicate/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "survicate__react-native-survicate-tests.ts" - ] -} From 48f1c2575df6c4265ef2aa6b6ed8fc79c589c0cb Mon Sep 17 00:00:00 2001 From: Daryl LaBar <9728423+daryllabar@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:01:00 -0400 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72427=20Fix=20?= =?UTF-8?q?for=20not=20returning=20null=20for=20array=20get=20commands=20b?= =?UTF-8?q?y=20@daryllabar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/xrm/index.d.ts | 28 +++++++++++++++++++++++++--- types/xrm/xrm-tests.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/types/xrm/index.d.ts b/types/xrm/index.d.ts index 21c6fa5bb1e6b1..e89eee0f61e0d3 100644 --- a/types/xrm/index.d.ts +++ b/types/xrm/index.d.ts @@ -1169,7 +1169,18 @@ declare namespace Xrm { */ getAttribute( delegateFunction?: Collection.MatchingDelegate, - ): Collection.ItemCollection | null; + ): Attributes.Attribute[]; + + /** + * Gets a collection of attributes using a delegate function or gets all attributes if delegateFunction is not provided. + * @param T An Attribute type. + * @param delegateFunction A matching delegate function + * @returns An collection of attributes. + * @see {@link https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/collections External Link: Collections (Client API reference)} + */ + getAttribute( + delegateFunction?: Collection.MatchingDelegate, + ): T[]; /** * Gets a control by name or index. @@ -1194,7 +1205,18 @@ declare namespace Xrm { */ getControl( delegateFunction?: Collection.MatchingDelegate, - ): Collection.ItemCollection | null; + ): Controls.Control[]; + + /** + * Gets a collection of controls using a delegate function or gets all controls if delegateFunction is not provided. + * @param T A Control type. There is no guarentee that all control types will match. + * @param delegateFunction A matching delegate function. + * @returns An collection of controls. + * @see {@link https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/collections External Link: Collections (Client API reference)} + */ + getControl( + delegateFunction?: Collection.MatchingDelegate, + ): T[]; } /** @@ -1859,7 +1881,7 @@ declare namespace Xrm { * @param delegate A matching delegate function * @returns A T[] whose members have been validated by delegate or a entire array of T[] */ - get(delegate?: MatchingDelegate): T[] | null; + get(delegate?: MatchingDelegate): T[]; /** * Gets the length of the collection. diff --git a/types/xrm/xrm-tests.ts b/types/xrm/xrm-tests.ts index 131723fb6946c4..a04a5648da3ce0 100644 --- a/types/xrm/xrm-tests.ts +++ b/types/xrm/xrm-tests.ts @@ -723,3 +723,38 @@ function ActionOnPostsave(context: Xrm.Events.PostSaveEventContext) { console.log(args.getSaveErrorInfo()); } } + +// Demonstrate non-index/name getAttribute/getControl returns non-null array + +function GetAll(context: Xrm.FormContext) { + const allAttributes: Xrm.Attributes.Attribute[] = context.getAttribute(); + const allAttributesTyped: Xrm.Attributes.StringAttribute[] = context.getAttribute(); + const noAttributes: Xrm.Attributes.Attribute[] = context.getAttribute(() => false); + const noAttributesTyped: Xrm.Attributes.StringAttribute[] = context.getAttribute( + () => false, + ); + if ( + allAttributes === null + || allAttributesTyped === null + || noAttributes === null + || noAttributesTyped === null + ) { + throw new Error("Will return an empty array if no attributes are present."); + } + + const allControls: Xrm.Controls.Control[] = context.getControl(); + const allControlsTyped: Xrm.Controls.StringControl[] = context.getControl(); + const itemCollection: Xrm.Controls.Control[] = (context.getControl("mySection") as unknown as Xrm.Controls.Section) + .controls.get(); + const noControls: Xrm.Controls.Control[] = context.getControl(() => false); + const noControlsTyped: Xrm.Controls.StringControl[] = context.getControl(() => false); + if ( + allControls === null + || allControlsTyped === null + || itemCollection === null + || noControls === null + || noControlsTyped === null + ) { + throw new Error("Will return an empty array if no controls are present."); + } +}