diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 52ecbc00412664..e069b9cc7ffc9f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,7 +30,7 @@ jobs: matrix: ${{ steps.matrix.outputs.matrix }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: # Need this to be able to inquire about origin/master filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ @@ -62,7 +62,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: # Need this to be able to inquire about origin/master filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ @@ -132,7 +132,7 @@ jobs: - test steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: ./.github/actions/setup-for-scripts - name: Get suggestions dir @@ -162,7 +162,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: ./.github/actions/setup-for-scripts - run: pnpm tsc -p ./scripts diff --git a/.github/workflows/UpdateCodeowners.yml b/.github/workflows/UpdateCodeowners.yml index c4289124db4f53..97b823239842f4 100644 --- a/.github/workflows/UpdateCodeowners.yml +++ b/.github/workflows/UpdateCodeowners.yml @@ -21,7 +21,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 diff --git a/.github/workflows/format-and-commit.yml b/.github/workflows/format-and-commit.yml index a8919204fd4bdb..29b51cae45db8b 100644 --- a/.github/workflows/format-and-commit.yml +++ b/.github/workflows/format-and-commit.yml @@ -16,7 +16,7 @@ jobs: contents: write if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: ./.github/actions/setup-for-scripts - name: Get date diff --git a/.github/workflows/ghostbuster.yml b/.github/workflows/ghostbuster.yml index 9744d5523bd540..b905a1be4f129a 100644 --- a/.github/workflows/ghostbuster.yml +++ b/.github/workflows/ghostbuster.yml @@ -23,7 +23,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: ./.github/actions/setup-for-scripts - run: node ./scripts/ghostbuster.js > ${{ runner.temp }}/comment.md env: diff --git a/.github/workflows/lint-md.yml b/.github/workflows/lint-md.yml index 745c2f61c177c3..55b3a83e302802 100644 --- a/.github/workflows/lint-md.yml +++ b/.github/workflows/lint-md.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-slim if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: ./.github/actions/setup-for-scripts - run: pnpm remark --frail . .github diff --git a/.github/workflows/pnpm-cache.yml b/.github/workflows/pnpm-cache.yml index da41cf6fa3fe03..89641a7719151c 100644 --- a/.github/workflows/pnpm-cache.yml +++ b/.github/workflows/pnpm-cache.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'DefinitelyTyped/DefinitelyTyped' }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: '24' diff --git a/.github/workflows/support-window.yml b/.github/workflows/support-window.yml index 2cb4936f2e5164..841f1d19de23b2 100644 --- a/.github/workflows/support-window.yml +++ b/.github/workflows/support-window.yml @@ -23,7 +23,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' runs-on: ubuntu-slim steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: ./.github/actions/setup-for-scripts - name: Fetch TypeScript versions and release dates from npm diff --git a/attw.json b/attw.json index 1cf80f10a88de1..9c04e9cd9b4a6b 100644 --- a/attw.json +++ b/attw.json @@ -174,7 +174,6 @@ "megajs", "memdown", "mergerino", - "micromodal", "mimetext", "minify", "mixpanel-browser", diff --git a/types/micromodal/index.d.ts b/types/micromodal/index.d.ts index fc4bdceff9fa1f..bee768bda12a80 100644 --- a/types/micromodal/index.d.ts +++ b/types/micromodal/index.d.ts @@ -1,12 +1,19 @@ /** * MicroModal configuration options */ -export interface MicroModalConfig { +interface Config { + /** + * Custom data attribute used to identify a modal element, and to store + * an auto-generated id when a modal is opened by element. Default is + * data-micromodal-id. + */ + identifier?: string | undefined; + /** This is fired when the modal is opening. */ - onShow?: ((modal?: HTMLElement) => void) | undefined; + onShow?: ((modal: HTMLElement, activeElement: Element | null, event: Event | null) => void) | undefined; /** This is fired when the modal is closing. */ - onClose?: ((modal?: HTMLElement) => void) | undefined; + onClose?: ((modal: HTMLElement, activeElement: Element | null, event: Event | null) => void) | undefined; /** Custom data attribute to open modal. Default is data-micromodal-trigger. */ openTrigger?: string | undefined; @@ -43,23 +50,58 @@ export interface MicroModalConfig { * MicroModal controller */ declare namespace MicroModal { + type MicroModalConfig = Config; + /** * Binds click handlers to all modal triggers * @param config configuration options */ function init(config?: MicroModalConfig): void; + /** + * Initializes a single modal and caches it without binding it to a + * trigger, so it can later be shown with `show`. + * @param targetModal The id or element of the modal to initialize + * @param config configuration options + */ + function initModal(targetModal: string | HTMLElement, config?: MicroModalConfig): void; + + /** + * Updates the configuration of an already-initialized modal. + * @param targetModal The id or element of the modal to reconfigure + * @param config configuration options + */ + function config(targetModal: string | HTMLElement, config: MicroModalConfig): void; + /** * Shows a particular modal - * @param targetModal The id of the modal to display + * @param targetModal The id or element of the modal to display * @param config configuration options */ - function show(targetModal: string, config?: MicroModalConfig): void; + function show(targetModal: string | HTMLElement, config?: MicroModalConfig): void; + + /** + * Closes a particular modal, or the most recently opened modal when + * no modal is given. + * @param targetModal The id or element of the modal to close + */ + function close(targetModal?: string | HTMLElement): void; + + /** + * Closes every open modal. + */ + function closeAll(): void; /** - * Closes the active modal + * Closes the modal if it is open and discards its cached instance, so + * the next `show` re-resolves the modal element. Useful when the + * modal's DOM element is recreated between opens. + * @param targetModal The id or element of the modal to remove */ - function close(targetModal?: string): void; + function removeModal(targetModal: string | HTMLElement): void; } -export default MicroModal; +// Upstream ships a UMD module {init, ...} and an ES module {default: {init, ...}}. +// eslint-disable-next-line @definitelytyped/export-just-namespace +export = MicroModal; +export as namespace MicroModal; diff --git a/types/micromodal/micromodal-tests.ts b/types/micromodal/micromodal-tests.ts index a1cec9a4b51476..5bcbabdeffc96c 100644 --- a/types/micromodal/micromodal-tests.ts +++ b/types/micromodal/micromodal-tests.ts @@ -1,11 +1,12 @@ import MicroModal, { MicroModalConfig } from "micromodal"; const config: MicroModalConfig = { - onShow: (modal) => { - console.log(modal!.id); + identifier: "data-modal-id", + onShow: (modal, activeElement, event) => { + console.log(modal.id, activeElement, event); }, - onClose: (modal) => { - console.log(modal!.id); + onClose: (modal, activeElement, event) => { + console.log(modal.id, activeElement, event); }, openTrigger: "data-modal-open", closeTrigger: "data-modal-close", @@ -19,6 +20,31 @@ const config: MicroModalConfig = { MicroModal.init(config); +MicroModal.initModal("my-modal", config); + +MicroModal.config("my-modal", config); + MicroModal.show("my-modal"); +MicroModal.show("my-modal", config); + +MicroModal.close("my-modal"); + MicroModal.close(); + +MicroModal.closeAll(); + +MicroModal.removeModal("my-modal"); + +// A string id or the modal element itself may be passed. +const modalElement = document.getElementById("my-modal")!; + +MicroModal.initModal(modalElement, config); + +MicroModal.config(modalElement, config); + +MicroModal.show(modalElement); + +MicroModal.close(modalElement); + +MicroModal.removeModal(modalElement); diff --git a/types/micromodal/package.json b/types/micromodal/package.json index 143cd691708d02..b9286c2681402c 100644 --- a/types/micromodal/package.json +++ b/types/micromodal/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/micromodal", - "version": "0.3.9999", + "version": "0.7.9999", "projects": [ "https://github.com/ghosh/micromodal#readme" ], @@ -12,6 +12,10 @@ { "name": "Wayne Carson", "githubUsername": "wcarson" + }, + { + "name": "Anders Kaseorg", + "githubUsername": "andersk" } ] } diff --git a/types/oracledb/index.d.ts b/types/oracledb/index.d.ts index 1eac06dbc24373..fd83bd5dc094e9 100644 --- a/types/oracledb/index.d.ts +++ b/types/oracledb/index.d.ts @@ -1011,7 +1011,10 @@ declare namespace OracleDB { * @see https://node-oracledb.readthedocs.io/en/latest/api_manual/connection.html#executebindparams */ type BindParameters = - | Record | Buffer | null | undefined> + | Record< + string, + BindParameter | string | number | bigint | boolean | Date | DBObject_IN | Buffer | null | undefined + > | BindParameter[] | any[]; @@ -4378,9 +4381,8 @@ declare namespace OracleDB { */ rows?: T[] | undefined; /** - * For DML statements (including SELECT FOR UPDATE) this contains the number of rows affected, - * for example the number of rows inserted. For non-DML statements such as queries and PL/SQL statements, - * rowsAffected is undefined. + * For DML statements this contains the number of rows affected, for example the number of rows inserted. + * For non-DML statements such as queries and PL/SQL statements, rowsAffected is undefined. */ rowsAffected?: number | undefined; /** diff --git a/types/puppeteer-screenshot-tester/index.d.ts b/types/puppeteer-screenshot-tester/index.d.ts index b4d9dd7b5bd827..0db909b2938020 100644 --- a/types/puppeteer-screenshot-tester/index.d.ts +++ b/types/puppeteer-screenshot-tester/index.d.ts @@ -1,7 +1,7 @@ import type { Page, ScreenshotOptions as PuppeteerScreenshotOptions } from "puppeteer" with { "resolution-mode": "import", }; -import type { JpegOptions, PngOptions, WebpOptions } from "sharp" with { "resolution-mode": "import" }; +import sharp = require("sharp"); interface PngOutputSettings { /** @@ -29,7 +29,7 @@ interface PngOutputSettings { * * @defaultValue `{}` */ - overrides?: PngOptions; + overrides?: sharp.PngOptions; } interface JpegOutputSettings { @@ -56,7 +56,7 @@ interface JpegOutputSettings { * * @defaultValue `{}` */ - overrides?: JpegOptions; + overrides?: sharp.JpegOptions; } interface WebpOutputSettings { @@ -83,7 +83,7 @@ interface WebpOutputSettings { * * @defaultValue `{}` */ - overrides?: WebpOptions; + overrides?: sharp.WebpOptions; } declare namespace ScreenshotTester {