Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/UpdateCodeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-and-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ghostbuster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/pnpm-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/support-window.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion attw.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@
"megajs",
"memdown",
"mergerino",
"micromodal",
"mimetext",
"minify",
"mixpanel-browser",
Expand Down
58 changes: 50 additions & 8 deletions types/micromodal/index.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
34 changes: 30 additions & 4 deletions types/micromodal/micromodal-tests.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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);
6 changes: 5 additions & 1 deletion types/micromodal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/micromodal",
"version": "0.3.9999",
"version": "0.7.9999",
"projects": [
"https://github.com/ghosh/micromodal#readme"
],
Expand All @@ -12,6 +12,10 @@
{
"name": "Wayne Carson",
"githubUsername": "wcarson"
},
{
"name": "Anders Kaseorg",
"githubUsername": "andersk"
}
]
}
10 changes: 6 additions & 4 deletions types/oracledb/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,10 @@ declare namespace OracleDB {
* @see https://node-oracledb.readthedocs.io/en/latest/api_manual/connection.html#executebindparams
*/
type BindParameters =
| Record<string, BindParameter | string | number | bigint | Date | DBObject_IN<any> | Buffer | null | undefined>
| Record<
string,
BindParameter | string | number | bigint | boolean | Date | DBObject_IN<any> | Buffer | null | undefined
>
| BindParameter[]
| any[];

Expand Down Expand Up @@ -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;
/**
Expand Down
8 changes: 4 additions & 4 deletions types/puppeteer-screenshot-tester/index.d.ts
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down Expand Up @@ -29,7 +29,7 @@ interface PngOutputSettings {
*
* @defaultValue `{}`
*/
overrides?: PngOptions;
overrides?: sharp.PngOptions;
}

interface JpegOutputSettings {
Expand All @@ -56,7 +56,7 @@ interface JpegOutputSettings {
*
* @defaultValue `{}`
*/
overrides?: JpegOptions;
overrides?: sharp.JpegOptions;
}

interface WebpOutputSettings {
Expand All @@ -83,7 +83,7 @@ interface WebpOutputSettings {
*
* @defaultValue `{}`
*/
overrides?: WebpOptions;
overrides?: sharp.WebpOptions;
}

declare namespace ScreenshotTester {
Expand Down