Skip to content

Commit dc80fe3

Browse files
committed
chore: improve types
1 parent 77b8f58 commit dc80fe3

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lib/tag.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import { Construct } from 'constructs';
22
import type { oas31 } from 'openapi3-ts';
33

4-
interface TagOptions {
5-
name: string;
6-
description?: string;
7-
externalDocs?: oas31.ExternalDocumentationObject;
8-
}
9-
10-
export class Tag extends Construct {
11-
private options: TagOptions;
4+
export class Tag<
5+
T extends oas31.TagObject = oas31.TagObject,
6+
> extends Construct {
7+
private options: T;
128

139
public get name() {
1410
return this.options.name;
1511
}
1612

17-
constructor(scope: Construct, id: string, options: TagOptions) {
13+
constructor(scope: Construct, id: string, options: T) {
1814
super(scope, id);
1915
this.options = options;
2016
}
2117

22-
public synth(): oas31.TagObject {
18+
public synth() {
2319
return this.options;
2420
}
2521
}

0 commit comments

Comments
 (0)