Skip to content

Commit 72fee63

Browse files
committed
refactor: use interface Props in astro components
1 parent a81320c commit 72fee63

23 files changed

Lines changed: 46 additions & 46 deletions

src/components/AnchoredH2.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
type Props = {
2+
interface Props {
33
id: string;
4-
};
4+
}
55
66
const { id } = Astro.props;
77
---

src/components/Declaration.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import DeclarationDocs from "./DeclarationDocs.astro";
66
import DeclarationSignature from "./DeclarationSignature.astro";
77
import DeclarationTitle from "./DeclarationTitle.astro";
88
9-
type Props = {
9+
interface Props {
1010
declaration: AllExtractedDeclaration;
1111
unpkgUrl: UnpkgUrlFn;
1212
declarationUrl: DeclarationUrlFn;
13-
};
13+
}
1414
1515
const { declaration, unpkgUrl, declarationUrl } = Astro.props;
1616
---

src/components/DeclarationDocs.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import type { AllExtractedDeclaration } from "@jsdocs-io/extractor";
33
import DocComment from "./DocComment.astro";
44
5-
type Props = {
5+
interface Props {
66
declaration: AllExtractedDeclaration;
7-
};
7+
}
88
99
const { declaration } = Astro.props;
1010
const docs = [...new Set(declaration.docs)];

src/components/DeclarationSignature.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import type { AllExtractedDeclaration } from "@jsdocs-io/extractor";
33
import { declarationSignatureToHtml } from "../../lib/components/declaration-signature-to-html";
44
import type { DeclarationUrlFn } from "../../lib/components/declaration-url";
55
6-
type Props = {
6+
interface Props {
77
declaration: AllExtractedDeclaration;
88
declarationUrl: DeclarationUrlFn;
9-
};
9+
}
1010
1111
const { declaration, declarationUrl } = Astro.props;
1212

src/components/DeclarationTitle.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { shortId } from "../../lib/components/short-id";
44
import { shortKind } from "../../lib/components/short-kind";
55
import type { UnpkgUrlFn } from "../../lib/components/unpkg-url";
66
7-
type Props = {
7+
interface Props {
88
declaration: AllExtractedDeclaration;
99
unpkgUrl: UnpkgUrlFn;
10-
};
10+
}
1111
1212
const { declaration, unpkgUrl } = Astro.props;
1313
const id = shortId(declaration.id);

src/components/Declarations.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import { type UnpkgUrlFn } from "../../lib/components/unpkg-url";
1515
import AnchoredH2 from "./AnchoredH2.astro";
1616
import Declaration from "./Declaration.astro";
1717
18-
type Props = {
18+
interface Props {
1919
containerName: string;
2020
declarations: ExtractedDeclaration[];
2121
unpkgUrl: UnpkgUrlFn;
2222
declarationUrl: DeclarationUrlFn;
23-
};
23+
}
2424
2525
const { containerName, declarations, unpkgUrl, declarationUrl } = Astro.props;
2626
const variables = declarations.filter((d): d is ExtractedVariable => d.kind === "variable");

src/components/DocCodeSpan.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
import { type DocCodeSpan as _DocCodeSpan } from "@microsoft/tsdoc";
33
4-
type Props = {
4+
interface Props {
55
codeSpan: _DocCodeSpan;
6-
};
6+
}
77
88
const {
99
codeSpan: { code },

src/components/DocCommentInherit.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { sanitizeUrl } from "@braintree/sanitize-url";
33
import { DocDeclarationReference } from "@microsoft/tsdoc";
44
import { resolveDeclarationReference } from "../../lib/components/resolve-declaration-reference";
55
6-
type Props = {
6+
interface Props {
77
ref: DocDeclarationReference;
8-
};
8+
}
99
1010
const { ref } = Astro.props;
1111
const { pkgName, declarationId } = resolveDeclarationReference(ref);

src/components/DocErrorText.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import type { DocErrorText as _DocErrorText } from "@microsoft/tsdoc";
33
import { mdToHtml } from "../../lib/components/md-to-html";
44
5-
type Props = {
5+
interface Props {
66
errorText: _DocErrorText;
7-
};
7+
}
88
99
const {
1010
errorText: { text },

src/components/DocEscapedText.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import type { DocEscapedText as _DocEscapedText } from "@microsoft/tsdoc";
33
import { mdToHtml } from "../../lib/components/md-to-html";
44
5-
type Props = {
5+
interface Props {
66
escapedText: _DocEscapedText;
7-
};
7+
}
88
99
const {
1010
escapedText: { decodedText },

0 commit comments

Comments
 (0)