Skip to content

Commit

Permalink
Merge pull request #594 from SimenB/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos authored May 24, 2024
2 parents 3c97054 + ac966fe commit 6a10363
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 22 deletions.
7 changes: 7 additions & 0 deletions .changeset/red-lamps-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@hey-api/openapi-ts": patch
---

Add explicit type annotations to `Interceptors`

This allows the generated code to work with TypeScript 5.5's new `isolatedDeclarations` configuration.
4 changes: 2 additions & 2 deletions packages/openapi-ts/src/templates/core/OpenAPI.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class Interceptors<T> {
this._fns = [];
}

eject(fn: Middleware<T>) {
eject(fn: Middleware<T>): void {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
}
}

use(fn: Middleware<T>) {
use(fn: Middleware<T>): void {
this._fns = [...this._fns, fn];
}
}
Expand Down

0 comments on commit 6a10363

Please sign in to comment.