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
2 changes: 1 addition & 1 deletion .github/actions/setup-for-scripts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
- uses: pnpm/action-setup@739bfe42ca9233c5e6aca07c1a25a9d34aca49b0 # v6.0.7
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
node-version: '24'

- uses: pnpm/action-setup@739bfe42ca9233c5e6aca07c1a25a9d34aca49b0 # v6.0.7
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- id: matrix
run: |
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
printf "Aborting: symlinks found:\n%s" "$symlinks"; exit 1
fi

- uses: pnpm/action-setup@739bfe42ca9233c5e6aca07c1a25a9d34aca49b0 # v6.0.7
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Get pnpm cache info
id: pnpm-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pnpm-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
- uses: pnpm/action-setup@739bfe42ca9233c5e6aca07c1a25a9d34aca49b0 # v6.0.7
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Get pnpm cache info
id: pnpm-cache
Expand Down
9 changes: 6 additions & 3 deletions types/koa/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ declare class Application<
}

declare namespace Application {
interface DefaultContextDelegatedRequest extends ContextDelegatedRequest {}
interface DefaultContextDelegatedResponse extends ContextDelegatedResponse {}

type DefaultStateExtends = any;
/**
* This interface can be augmented by users to add types to Koa's default state
Expand All @@ -564,7 +567,7 @@ declare namespace Application {
ParameterizedContext<StateT, ContextT, ResponseBodyT>
>;

interface BaseRequest extends ContextDelegatedRequest {
interface BaseRequest extends DefaultContextDelegatedRequest {
/**
* Get the charset when present or undefined.
*/
Expand Down Expand Up @@ -592,7 +595,7 @@ declare namespace Application {
toJSON(): any;
}

interface BaseResponse extends ContextDelegatedResponse {
interface BaseResponse extends DefaultContextDelegatedResponse {
/**
* Return the request socket.
*
Expand Down Expand Up @@ -654,7 +657,7 @@ declare namespace Application {
toJSON(): any;
}

interface BaseContext extends ContextDelegatedRequest, ContextDelegatedResponse {
interface BaseContext extends DefaultContextDelegatedRequest, DefaultContextDelegatedResponse {
/**
* util.inspect() implementation, which
* just returns the JSON output.
Expand Down
31 changes: 31 additions & 0 deletions types/koa/test/augment-delegated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Koa = require("koa");

declare module "koa" {
interface DefaultContextDelegatedRequest {
requestId: string;
}

interface DefaultContextDelegatedResponse {
sendCustom(payload: unknown): void;
}
}

const app = new Koa();

app.use((ctx, next) => {
// Augmented members are visible on ctx (delegated through BaseContext).
ctx.requestId; // $ExpectType string
ctx.sendCustom({ ok: true });

// Augmented members are visible on request/response as well.
ctx.request.requestId; // $ExpectType string
ctx.response.sendCustom("hello");

// Original delegated members still exist — augmentation must not erase them.
ctx.redirect("/login");
ctx.attachment("file.txt");
ctx.header; // $ExpectType IncomingHttpHeaders
ctx.method; // $ExpectType string

return next();
});
3 changes: 2 additions & 1 deletion types/koa/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"test/constructor.ts",
"test/default.ts",
"test/settings.ts",
"test/typed-response-body.ts"
"test/typed-response-body.ts",
"test/augment-delegated.ts"
],
"compilerOptions": {
"module": "node16",
Expand Down
9 changes: 6 additions & 3 deletions types/koa/v2/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ declare class Application<
}

declare namespace Application {
interface DefaultContextDelegatedRequest extends ContextDelegatedRequest {}
interface DefaultContextDelegatedResponse extends ContextDelegatedResponse {}

type DefaultStateExtends = any;
/**
* This interface can be augmented by users to add types to Koa's default state
Expand All @@ -553,7 +556,7 @@ declare namespace Application {
ParameterizedContext<StateT, ContextT, ResponseBodyT>
>;

interface BaseRequest extends ContextDelegatedRequest {
interface BaseRequest extends DefaultContextDelegatedRequest {
/**
* Get the charset when present or undefined.
*/
Expand Down Expand Up @@ -581,7 +584,7 @@ declare namespace Application {
toJSON(): any;
}

interface BaseResponse extends ContextDelegatedResponse {
interface BaseResponse extends DefaultContextDelegatedResponse {
/**
* Return the request socket.
*
Expand Down Expand Up @@ -643,7 +646,7 @@ declare namespace Application {
toJSON(): any;
}

interface BaseContext extends ContextDelegatedRequest, ContextDelegatedResponse {
interface BaseContext extends DefaultContextDelegatedRequest, DefaultContextDelegatedResponse {
/**
* util.inspect() implementation, which
* just returns the JSON output.
Expand Down
31 changes: 31 additions & 0 deletions types/koa/v2/test/augment-delegated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Koa = require("koa");

declare module "koa" {
interface DefaultContextDelegatedRequest {
requestId: string;
}

interface DefaultContextDelegatedResponse {
sendCustom(payload: unknown): void;
}
}

const app = new Koa();

app.use((ctx, next) => {
// Augmented members are visible on ctx (delegated through BaseContext).
ctx.requestId; // $ExpectType string
ctx.sendCustom({ ok: true });

// Augmented members are visible on request/response as well.
ctx.request.requestId; // $ExpectType string
ctx.response.sendCustom("hello");

// Original delegated members still exist — augmentation must not erase them.
ctx.redirect("/login");
ctx.attachment("file.txt");
ctx.header; // $ExpectType IncomingHttpHeaders
ctx.method; // $ExpectType string

return next();
});
3 changes: 2 additions & 1 deletion types/koa/v2/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"test/constructor.ts",
"test/default.ts",
"test/settings.ts",
"test/typed-response-body.ts"
"test/typed-response-body.ts",
"test/augment-delegated.ts"
],
"compilerOptions": {
"module": "node16",
Expand Down
8 changes: 8 additions & 0 deletions types/node/node-tests/stream-iter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FileHandle, open } from "node:fs/promises";
import { bytes, from, fromSync, pipeTo, pull, pullSync, text, textSync } from "node:stream/iter";
import { setTimeout } from "node:timers/promises";
import { compressGzip, compressGzipSync, decompressGzip, decompressGzipSync } from "node:zlib/iter";

// Async round-trip
Expand Down Expand Up @@ -31,3 +32,10 @@ void async function() {
using syncDispose = fh.writer();
await using asyncDispose = fh.writer();
};

void async function() {
pull("hello", async (chunk: Uint8Array[] | null) => {
await setTimeout(1000);
return chunk;
});
};
5 changes: 4 additions & 1 deletion types/node/stream/iter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ declare module "node:stream/iter" {
signal: AbortSignal;
}
interface StatelessTransformFn {
(chunks: Uint8Array[] | null, options: TransformCallbackOptions): TransformResult | null;
(
chunks: Uint8Array[] | null,
options: TransformCallbackOptions,
): Promise<TransformResult | null> | TransformResult | null;
}
interface SyncStatelessTransformFn {
(chunks: Uint8Array[] | null): SyncTransformResult | null;
Expand Down
2 changes: 1 addition & 1 deletion types/oracledb/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ declare namespace OracleDB {
*
* For non-CLOB types, the conversion to string is handled by Oracle client libraries and is often referred to as defining the fetch type.
*/
let fetchAsString: Array<typeof DATE | typeof NUMBER | typeof BUFFER | typeof CLOB>;
let fetchAsString: Array<typeof DATE | typeof NUMBER | typeof BUFFER | typeof CLOB | typeof NCLOB>;
/**
* Converter can be used with fetch type handlers to change the returned data.
* If the value returned by the fetch type handler function is undefined then no conversion takes place.
Expand Down
2 changes: 1 addition & 1 deletion types/oracledb/oracledb-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ export const fetchAsBufferTests = (): void => {
};

export const fetchAsStringTests = (): void => {
defaultOracledb.fetchAsString = [oracledb.DATE, oracledb.NUMBER, oracledb.BUFFER, oracledb.CLOB];
defaultOracledb.fetchAsString = [oracledb.DATE, oracledb.NUMBER, oracledb.BUFFER, oracledb.CLOB, oracledb.NCLOB];
// @ts-expect-error
defaultOracledb.fetchAsString = [{}];
// @ts-expect-error
Expand Down
4 changes: 2 additions & 2 deletions types/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3166,7 +3166,7 @@ declare namespace React {
alt?: string | undefined;
crossOrigin?: CrossOrigin;
decoding?: "async" | "auto" | "sync" | undefined;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
height?: number | string | undefined;
loading?: "eager" | "lazy" | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
Expand Down Expand Up @@ -3339,7 +3339,7 @@ declare namespace React {
as?: string | undefined;
blocking?: "render" | (string & {}) | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
integrity?: string | undefined;
Expand Down
4 changes: 2 additions & 2 deletions types/react/ts5.0/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3165,7 +3165,7 @@ declare namespace React {
alt?: string | undefined;
crossOrigin?: CrossOrigin;
decoding?: "async" | "auto" | "sync" | undefined;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
height?: number | string | undefined;
loading?: "eager" | "lazy" | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
Expand Down Expand Up @@ -3338,7 +3338,7 @@ declare namespace React {
as?: string | undefined;
blocking?: "render" | (string & {}) | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
integrity?: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion types/react/v15/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,7 @@ declare namespace React {
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
as?: string | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
integrity?: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion types/react/v16/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2299,7 +2299,7 @@ declare namespace React {
as?: string | undefined;
blocking?: "render" | (string & {}) | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
integrity?: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion types/react/v17/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@ declare namespace React {
as?: string | undefined;
blocking?: "render" | (string & {}) | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
integrity?: string | undefined;
Expand Down
4 changes: 2 additions & 2 deletions types/react/v18/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3271,7 +3271,7 @@ declare namespace React {
alt?: string | undefined;
crossOrigin?: CrossOrigin;
decoding?: "async" | "auto" | "sync" | undefined;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
height?: number | string | undefined;
loading?: "eager" | "lazy" | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
Expand Down Expand Up @@ -3436,7 +3436,7 @@ declare namespace React {
as?: string | undefined;
blocking?: "render" | (string & {}) | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
integrity?: string | undefined;
Expand Down
4 changes: 2 additions & 2 deletions types/react/v18/ts5.0/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3272,7 +3272,7 @@ declare namespace React {
alt?: string | undefined;
crossOrigin?: CrossOrigin;
decoding?: "async" | "auto" | "sync" | undefined;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
height?: number | string | undefined;
loading?: "eager" | "lazy" | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
Expand Down Expand Up @@ -3437,7 +3437,7 @@ declare namespace React {
as?: string | undefined;
blocking?: "render" | (string & {}) | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: "high" | "low" | "auto";
fetchPriority?: "high" | "low" | "auto" | undefined;
href?: string | undefined;
hrefLang?: string | undefined;
integrity?: string | undefined;
Expand Down
5 changes: 5 additions & 0 deletions types/rtpengine-client/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
Loading