From 3826acbacd524cc3489bb590b41baf2f01a04d3e Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 25 Oct 2024 11:51:36 -0700 Subject: [PATCH] test(fixtures): fix `generics-multiple` example (#141) --- tests/__snapshots__/fixtures.test.ts.snap | 10 +++++----- tests/fixtures/generics-multiple/input.svelte | 4 ++-- tests/fixtures/generics-multiple/output.d.ts | 4 ++-- tests/fixtures/generics-multiple/output.json | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/__snapshots__/fixtures.test.ts.snap b/tests/__snapshots__/fixtures.test.ts.snap index 670c91a..61245f1 100644 --- a/tests/__snapshots__/fixtures.test.ts.snap +++ b/tests/__snapshots__/fixtures.test.ts.snap @@ -111,13 +111,13 @@ exports[`fixtures (JSON) "generics-multiple/input.svelte" 1`] = ` }, { "type": "{ key: DataTableKey; value: Header; }", - "name": "DataTableHeader", - "ts": "interface DataTableHeader { key: DataTableKey; value: Header; }" + "name": "DataTableHeader", + "ts": "interface DataTableHeader { key: DataTableKey; value: Header; }" } ], "generics": [ "Row,Header", - "Row extends DataTableRow = DataTableRow, Header extends DataTableRow" + "Row extends DataTableRow = DataTableRow, Header extends DataTableRow = DataTableRow" ] }" `; @@ -1301,7 +1301,7 @@ export interface DataTableRow { export type DataTableKey = Exclude; -export interface DataTableHeader { +export interface DataTableHeader { key: DataTableKey; value: Header; } @@ -1320,7 +1320,7 @@ export interface GenericsMultipleProps { export default class GenericsMultiple< Row extends DataTableRow = DataTableRow, - Header extends DataTableRow + Header extends DataTableRow = DataTableRow > extends SvelteComponentTyped< GenericsMultipleProps, Record, diff --git a/tests/fixtures/generics-multiple/input.svelte b/tests/fixtures/generics-multiple/input.svelte index 97b7556..f9f5dc2 100644 --- a/tests/fixtures/generics-multiple/input.svelte +++ b/tests/fixtures/generics-multiple/input.svelte @@ -2,9 +2,9 @@ /** * @typedef {{ id: string | number; [key: string]: any; }} DataTableRow * @typedef {Exclude} DataTableKey - * @typedef {{ key: DataTableKey; value: Header; }} DataTableHeader + * @typedef {{ key: DataTableKey; value: Header; }} DataTableHeader * @template {DataTableRow} - * @generics {Row extends DataTableRow = DataTableRow, Header extends DataTableRow} Row,Header + * @generics {Row extends DataTableRow = DataTableRow, Header extends DataTableRow = DataTableRow} Row,Header */ /** @type {ReadonlyArray>} */ diff --git a/tests/fixtures/generics-multiple/output.d.ts b/tests/fixtures/generics-multiple/output.d.ts index 3401952..2cb6476 100644 --- a/tests/fixtures/generics-multiple/output.d.ts +++ b/tests/fixtures/generics-multiple/output.d.ts @@ -7,7 +7,7 @@ export interface DataTableRow { export type DataTableKey = Exclude; -export interface DataTableHeader { +export interface DataTableHeader { key: DataTableKey; value: Header; } @@ -26,7 +26,7 @@ export interface GenericsMultipleProps { export default class GenericsMultiple< Row extends DataTableRow = DataTableRow, - Header extends DataTableRow + Header extends DataTableRow = DataTableRow > extends SvelteComponentTyped< GenericsMultipleProps, Record, diff --git a/tests/fixtures/generics-multiple/output.json b/tests/fixtures/generics-multiple/output.json index db17303..b0912cb 100644 --- a/tests/fixtures/generics-multiple/output.json +++ b/tests/fixtures/generics-multiple/output.json @@ -45,12 +45,12 @@ }, { "type": "{ key: DataTableKey; value: Header; }", - "name": "DataTableHeader", - "ts": "interface DataTableHeader { key: DataTableKey; value: Header; }" + "name": "DataTableHeader", + "ts": "interface DataTableHeader { key: DataTableKey; value: Header; }" } ], "generics": [ "Row,Header", - "Row extends DataTableRow = DataTableRow, Header extends DataTableRow" + "Row extends DataTableRow = DataTableRow, Header extends DataTableRow = DataTableRow" ] } \ No newline at end of file